diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialController.java index 2d8e126..f5b70f4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialController.java @@ -1,119 +1,119 @@ -package com.bonus.canteen.core.supermarket.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import com.bonus.common.log.enums.OperaType; -//import com.bonus.canteen.core.supermarket.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.supermarket.domain.SupermarketMaterial; -import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialService; -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("/supermarket_material") -public class SupermarketMaterialController extends BaseController { - @Autowired - private ISupermarketMaterialService supermarketMaterialService; - - /** - * 查询商品信息列表 - */ - @ApiOperation(value = "查询商品信息列表") - //@RequiresPermissions("supermarket:material:list") - @GetMapping("/list") - public TableDataInfo list(SupermarketMaterial supermarketMaterial) { - startPage(); - List list = supermarketMaterialService.selectSupermarketMaterialList(supermarketMaterial); - return getDataTable(list); - } - - /** - * 导出商品信息列表 - */ - @ApiOperation(value = "导出商品信息列表") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:material:export") - @SysLog(title = "商品信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出商品信息") - @PostMapping("/export") - public void export(HttpServletResponse response, SupermarketMaterial supermarketMaterial) { - List list = supermarketMaterialService.selectSupermarketMaterialList(supermarketMaterial); - ExcelUtil util = new ExcelUtil(SupermarketMaterial.class); - util.exportExcel(response, list, "商品信息数据"); - } - - /** - * 获取商品信息详细信息 - */ - @ApiOperation(value = "获取商品信息详细信息") - //@RequiresPermissions("supermarket:material:query") - @GetMapping(value = "/{materialId}") - public AjaxResult getInfo(@PathVariable("materialId") Long materialId) { - return success(supermarketMaterialService.selectSupermarketMaterialByMaterialId(materialId)); - } - - /** - * 新增商品信息 - */ - @ApiOperation(value = "新增商品信息") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:material:add") - @SysLog(title = "商品信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增商品信息") - @PostMapping - public AjaxResult add(@RequestBody SupermarketMaterial supermarketMaterial) { - try { - return toAjax(supermarketMaterialService.insertSupermarketMaterial(supermarketMaterial)); - } catch (Exception e) { - return error(e.getMessage()); - } - } - - /** - * 修改商品信息 - */ - @ApiOperation(value = "修改商品信息") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:material:edit") - @SysLog(title = "商品信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改商品信息") - @PostMapping("/edit") - public AjaxResult edit(@RequestBody SupermarketMaterial supermarketMaterial) { - try { - return toAjax(supermarketMaterialService.updateSupermarketMaterial(supermarketMaterial)); - } catch (Exception e) { - return error(e.getMessage()); - } - } - - /** - * 删除商品信息 - */ - @ApiOperation(value = "删除商品信息") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:material:remove") - @SysLog(title = "商品信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除商品信息") - @PostMapping("/del/{materialIds}") - public AjaxResult remove(@PathVariable Long[] materialIds) { - return toAjax(supermarketMaterialService.deleteSupermarketMaterialByMaterialIds(materialIds)); - } -} +//package com.bonus.canteen.core.supermarket.controller; +// +//import java.util.List; +//import javax.servlet.http.HttpServletResponse; +//import com.bonus.common.log.enums.OperaType; +////import com.bonus.canteen.core.supermarket.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.supermarket.domain.SupermarketMaterial; +//import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialService; +//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("/supermarket_material") +//public class SupermarketMaterialController extends BaseController { +// @Autowired +// private ISupermarketMaterialService supermarketMaterialService; +// +// /** +// * 查询商品信息列表 +// */ +// @ApiOperation(value = "查询商品信息列表") +// //@RequiresPermissions("supermarket:material:list") +// @GetMapping("/list") +// public TableDataInfo list(SupermarketMaterial supermarketMaterial) { +// startPage(); +// List list = supermarketMaterialService.selectSupermarketMaterialList(supermarketMaterial); +// return getDataTable(list); +// } +// +// /** +// * 导出商品信息列表 +// */ +// @ApiOperation(value = "导出商品信息列表") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:material:export") +// @SysLog(title = "商品信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出商品信息") +// @PostMapping("/export") +// public void export(HttpServletResponse response, SupermarketMaterial supermarketMaterial) { +// List list = supermarketMaterialService.selectSupermarketMaterialList(supermarketMaterial); +// ExcelUtil util = new ExcelUtil(SupermarketMaterial.class); +// util.exportExcel(response, list, "商品信息数据"); +// } +// +// /** +// * 获取商品信息详细信息 +// */ +// @ApiOperation(value = "获取商品信息详细信息") +// //@RequiresPermissions("supermarket:material:query") +// @GetMapping(value = "/{materialId}") +// public AjaxResult getInfo(@PathVariable("materialId") Long materialId) { +// return success(supermarketMaterialService.selectSupermarketMaterialByMaterialId(materialId)); +// } +// +// /** +// * 新增商品信息 +// */ +// @ApiOperation(value = "新增商品信息") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:material:add") +// @SysLog(title = "商品信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增商品信息") +// @PostMapping +// public AjaxResult add(@RequestBody SupermarketMaterial supermarketMaterial) { +// try { +// return toAjax(supermarketMaterialService.insertSupermarketMaterial(supermarketMaterial)); +// } catch (Exception e) { +// return error(e.getMessage()); +// } +// } +// +// /** +// * 修改商品信息 +// */ +// @ApiOperation(value = "修改商品信息") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:material:edit") +// @SysLog(title = "商品信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改商品信息") +// @PostMapping("/edit") +// public AjaxResult edit(@RequestBody SupermarketMaterial supermarketMaterial) { +// try { +// return toAjax(supermarketMaterialService.updateSupermarketMaterial(supermarketMaterial)); +// } catch (Exception e) { +// return error(e.getMessage()); +// } +// } +// +// /** +// * 删除商品信息 +// */ +// @ApiOperation(value = "删除商品信息") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:material:remove") +// @SysLog(title = "商品信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除商品信息") +// @PostMapping("/del/{materialIds}") +// public AjaxResult remove(@PathVariable Long[] materialIds) { +// return toAjax(supermarketMaterialService.deleteSupermarketMaterialByMaterialIds(materialIds)); +// } +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialTypeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialTypeController.java index e27b50a..e361e78 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialTypeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketMaterialTypeController.java @@ -1,119 +1,119 @@ -package com.bonus.canteen.core.supermarket.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import com.bonus.common.log.enums.OperaType; -//import com.bonus.canteen.core.supermarket.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.supermarket.domain.SupermarketMaterialType; -import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialTypeService; -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("/supermarket_material_type") -public class SupermarketMaterialTypeController extends BaseController { - @Autowired - private ISupermarketMaterialTypeService supermarketMaterialTypeService; - - /** - * 查询商品类别列表 - */ - @ApiOperation(value = "查询商品类别列表") - //@RequiresPermissions("supermarket:type:list") - @GetMapping("/list") - public TableDataInfo list(SupermarketMaterialType supermarketMaterialType) { - startPage(); - List list = supermarketMaterialTypeService.selectSupermarketMaterialTypeList(supermarketMaterialType); - return getDataTable(list); - } - - /** - * 导出商品类别列表 - */ - @ApiOperation(value = "导出商品类别列表") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:type:export") - @SysLog(title = "商品类别", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出商品类别") - @PostMapping("/export") - public void export(HttpServletResponse response, SupermarketMaterialType supermarketMaterialType) { - List list = supermarketMaterialTypeService.selectSupermarketMaterialTypeList(supermarketMaterialType); - ExcelUtil util = new ExcelUtil(SupermarketMaterialType.class); - util.exportExcel(response, list, "商品类别数据"); - } - - /** - * 获取商品类别详细信息 - */ - @ApiOperation(value = "获取商品类别详细信息") - //@RequiresPermissions("supermarket:type:query") - @GetMapping(value = "/{materialTypeId}") - public AjaxResult getInfo(@PathVariable("materialTypeId") Long materialTypeId) { - return success(supermarketMaterialTypeService.selectSupermarketMaterialTypeByMaterialTypeId(materialTypeId)); - } - - /** - * 新增商品类别 - */ - @ApiOperation(value = "新增商品类别") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:type:add") - @SysLog(title = "商品类别", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增商品类别") - @PostMapping - public AjaxResult add(@RequestBody SupermarketMaterialType supermarketMaterialType) { - try { - return toAjax(supermarketMaterialTypeService.insertSupermarketMaterialType(supermarketMaterialType)); - } catch (Exception e) { - return error(e.getMessage()); - } - } - - /** - * 修改商品类别 - */ - @ApiOperation(value = "修改商品类别") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:type:edit") - @SysLog(title = "商品类别", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改商品类别") - @PostMapping("/edit") - public AjaxResult edit(@RequestBody SupermarketMaterialType supermarketMaterialType) { - try { - return toAjax(supermarketMaterialTypeService.updateSupermarketMaterialType(supermarketMaterialType)); - } catch (Exception e) { - return error(e.getMessage()); - } - } - - /** - * 删除商品类别 - */ - @ApiOperation(value = "删除商品类别") - //@PreventRepeatSubmit - //@RequiresPermissions("supermarket:type:remove") - @SysLog(title = "商品类别", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除商品类别") - @PostMapping("/del/{materialTypeIds}") - public AjaxResult remove(@PathVariable Long[] materialTypeIds) { - return toAjax(supermarketMaterialTypeService.deleteSupermarketMaterialTypeByMaterialTypeIds(materialTypeIds)); - } -} +//package com.bonus.canteen.core.supermarket.controller; +// +//import java.util.List; +//import javax.servlet.http.HttpServletResponse; +//import com.bonus.common.log.enums.OperaType; +////import com.bonus.canteen.core.supermarket.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.supermarket.domain.SupermarketMaterialType; +//import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialTypeService; +//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("/supermarket_material_type") +//public class SupermarketMaterialTypeController extends BaseController { +// @Autowired +// private ISupermarketMaterialTypeService supermarketMaterialTypeService; +// +// /** +// * 查询商品类别列表 +// */ +// @ApiOperation(value = "查询商品类别列表") +// //@RequiresPermissions("supermarket:type:list") +// @GetMapping("/list") +// public TableDataInfo list(SupermarketMaterialType supermarketMaterialType) { +// startPage(); +// List list = supermarketMaterialTypeService.selectSupermarketMaterialTypeList(supermarketMaterialType); +// return getDataTable(list); +// } +// +// /** +// * 导出商品类别列表 +// */ +// @ApiOperation(value = "导出商品类别列表") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:type:export") +// @SysLog(title = "商品类别", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出商品类别") +// @PostMapping("/export") +// public void export(HttpServletResponse response, SupermarketMaterialType supermarketMaterialType) { +// List list = supermarketMaterialTypeService.selectSupermarketMaterialTypeList(supermarketMaterialType); +// ExcelUtil util = new ExcelUtil(SupermarketMaterialType.class); +// util.exportExcel(response, list, "商品类别数据"); +// } +// +// /** +// * 获取商品类别详细信息 +// */ +// @ApiOperation(value = "获取商品类别详细信息") +// //@RequiresPermissions("supermarket:type:query") +// @GetMapping(value = "/{materialTypeId}") +// public AjaxResult getInfo(@PathVariable("materialTypeId") Long materialTypeId) { +// return success(supermarketMaterialTypeService.selectSupermarketMaterialTypeByMaterialTypeId(materialTypeId)); +// } +// +// /** +// * 新增商品类别 +// */ +// @ApiOperation(value = "新增商品类别") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:type:add") +// @SysLog(title = "商品类别", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增商品类别") +// @PostMapping +// public AjaxResult add(@RequestBody SupermarketMaterialType supermarketMaterialType) { +// try { +// return toAjax(supermarketMaterialTypeService.insertSupermarketMaterialType(supermarketMaterialType)); +// } catch (Exception e) { +// return error(e.getMessage()); +// } +// } +// +// /** +// * 修改商品类别 +// */ +// @ApiOperation(value = "修改商品类别") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:type:edit") +// @SysLog(title = "商品类别", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改商品类别") +// @PostMapping("/edit") +// public AjaxResult edit(@RequestBody SupermarketMaterialType supermarketMaterialType) { +// try { +// return toAjax(supermarketMaterialTypeService.updateSupermarketMaterialType(supermarketMaterialType)); +// } catch (Exception e) { +// return error(e.getMessage()); +// } +// } +// +// /** +// * 删除商品类别 +// */ +// @ApiOperation(value = "删除商品类别") +// //@PreventRepeatSubmit +// //@RequiresPermissions("supermarket:type:remove") +// @SysLog(title = "商品类别", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除商品类别") +// @PostMapping("/del/{materialTypeIds}") +// public AjaxResult remove(@PathVariable Long[] materialTypeIds) { +// return toAjax(supermarketMaterialTypeService.deleteSupermarketMaterialTypeByMaterialTypeIds(materialTypeIds)); +// } +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java index 8857e59..2551dfc 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterial.java @@ -1,124 +1,124 @@ -package com.bonus.canteen.core.supermarket.domain; - -import com.bonus.canteen.core.common.utils.FileUrlUtil; -import com.bonus.common.core.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; -import com.bonus.common.core.web.domain.BaseEntity; - -/** - * 商品信息对象 supermarket_material - * - * @author xsheng - * @date 2025-05-25 - */ - - -@Data -@ToString -public class SupermarketMaterial extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 原料id */ - private Long materialId; - - /** 区域id */ - @Excel(name = "区域id") - @ApiModelProperty(value = "区域id") - private Long areaId; - - private String areaName; - - /** 原料名称 */ - @Excel(name = "原料名称") - @ApiModelProperty(value = "原料名称") - private String materialName; - - /** 原料编码 */ - @Excel(name = "原料编码") - @ApiModelProperty(value = "原料编码") - private String materialCode; - - /** 原料图片 */ - @Excel(name = "原料图片") - @ApiModelProperty(value = "原料图片") - private String imgUrl; - - /** 类别id */ - @Excel(name = "类别id") - @ApiModelProperty(value = "类别id") - private Long materialTypeId; - - private String materialTypeName; - - /** 类别ids */ - @Excel(name = "类别ids") - @ApiModelProperty(value = "类别ids") - private Long[] materialTypeIds; - - /** 原料类型(1原料2商品) */ - @ApiModelProperty(value = "原料类型(1原料2商品)") - private Long goodsType; - - /** 条码 */ - @Excel(name = "条码") - @ApiModelProperty(value = "条码") - private String barCode; - - /** 单位 */ - @Excel(name = "单位") - @ApiModelProperty(value = "单位") - private Long unitId; - - private String unitName; - - /** 销售价 */ - @Excel(name = "销售价") - @ApiModelProperty(value = "销售价") - private Long salePrice; - - /** 进价 */ - @Excel(name = "进价") - @ApiModelProperty(value = "进价") - private Long unitPrice; - - /** 售卖类型(1计量2散称) */ - @Excel(name = "售卖类型(1计量2散称)") - @ApiModelProperty(value = "售卖类型(1计量2散称)") - private Long salesMode; - - /** 保质期类型 1年 2月 3日 */ - @Excel(name = "保质期类型 1年 2月 3日") - @ApiModelProperty(value = "保质期类型 1年 2月 3日") - private Long shelfLifeType; - - /** 保质期数 */ - @Excel(name = "保质期数") - @ApiModelProperty(value = "保质期数") - private Long shelfLifeDays; - - /** 采购价格上限 */ - @Excel(name = "采购价格上限") - @ApiModelProperty(value = "采购价格上限") - private Long purPriceCeiling; - - /** 大类id */ - @Excel(name = "大类id") - @ApiModelProperty(value = "大类id") - private Long bigCategoryId; - - /** 规格 */ - @Excel(name = "规格") - @ApiModelProperty(value = "规格") - private String size; - - /** 简介 */ - @Excel(name = "简介") - @ApiModelProperty(value = "简介") - private String description; - - public String getImgUrl() { - return FileUrlUtil.getFileUrl(imgUrl); - } -} +//package com.bonus.canteen.core.supermarket.domain; +// +//import com.bonus.canteen.core.common.utils.FileUrlUtil; +//import com.bonus.common.core.annotation.Excel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +//import lombok.ToString; +//import com.bonus.common.core.web.domain.BaseEntity; +// +///** +// * 商品信息对象 supermarket_material +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +// +// +//@Data +//@ToString +//public class SupermarketMaterial extends BaseEntity { +// private static final long serialVersionUID = 1L; +// +// /** 原料id */ +// private Long materialId; +// +// /** 区域id */ +// @Excel(name = "区域id") +// @ApiModelProperty(value = "区域id") +// private Long areaId; +// +// private String areaName; +// +// /** 原料名称 */ +// @Excel(name = "原料名称") +// @ApiModelProperty(value = "原料名称") +// private String materialName; +// +// /** 原料编码 */ +// @Excel(name = "原料编码") +// @ApiModelProperty(value = "原料编码") +// private String materialCode; +// +// /** 原料图片 */ +// @Excel(name = "原料图片") +// @ApiModelProperty(value = "原料图片") +// private String imgUrl; +// +// /** 类别id */ +// @Excel(name = "类别id") +// @ApiModelProperty(value = "类别id") +// private Long materialTypeId; +// +// private String materialTypeName; +// +// /** 类别ids */ +// @Excel(name = "类别ids") +// @ApiModelProperty(value = "类别ids") +// private Long[] materialTypeIds; +// +// /** 原料类型(1原料2商品) */ +// @ApiModelProperty(value = "原料类型(1原料2商品)") +// private Long goodsType; +// +// /** 条码 */ +// @Excel(name = "条码") +// @ApiModelProperty(value = "条码") +// private String barCode; +// +// /** 单位 */ +// @Excel(name = "单位") +// @ApiModelProperty(value = "单位") +// private Long unitId; +// +// private String unitName; +// +// /** 销售价 */ +// @Excel(name = "销售价") +// @ApiModelProperty(value = "销售价") +// private Long salePrice; +// +// /** 进价 */ +// @Excel(name = "进价") +// @ApiModelProperty(value = "进价") +// private Long unitPrice; +// +// /** 售卖类型(1计量2散称) */ +// @Excel(name = "售卖类型(1计量2散称)") +// @ApiModelProperty(value = "售卖类型(1计量2散称)") +// private Long salesMode; +// +// /** 保质期类型 1年 2月 3日 */ +// @Excel(name = "保质期类型 1年 2月 3日") +// @ApiModelProperty(value = "保质期类型 1年 2月 3日") +// private Long shelfLifeType; +// +// /** 保质期数 */ +// @Excel(name = "保质期数") +// @ApiModelProperty(value = "保质期数") +// private Long shelfLifeDays; +// +// /** 采购价格上限 */ +// @Excel(name = "采购价格上限") +// @ApiModelProperty(value = "采购价格上限") +// private Long purPriceCeiling; +// +// /** 大类id */ +// @Excel(name = "大类id") +// @ApiModelProperty(value = "大类id") +// private Long bigCategoryId; +// +// /** 规格 */ +// @Excel(name = "规格") +// @ApiModelProperty(value = "规格") +// private String size; +// +// /** 简介 */ +// @Excel(name = "简介") +// @ApiModelProperty(value = "简介") +// private String description; +// +// public String getImgUrl() { +// return FileUrlUtil.getFileUrl(imgUrl); +// } +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterialType.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterialType.java index f87256c..e349497 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterialType.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketMaterialType.java @@ -1,49 +1,49 @@ -package com.bonus.canteen.core.supermarket.domain; - -import com.bonus.common.core.annotation.Excel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.ToString; -import com.bonus.common.core.web.domain.BaseEntity; - -/** - * 商品类别对象 supermarket_material_type - * - * @author xsheng - * @date 2025-05-25 - */ - - -@Data -@ToString -public class SupermarketMaterialType extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** 主键id */ - private Long materialTypeId; - - /** 类别名称 */ - @Excel(name = "类别名称") - @ApiModelProperty(value = "类别名称") - private String materialTypeName; - - /** 父类id */ - @Excel(name = "父类id") - @ApiModelProperty(value = "父类id") - private Long parentId; - - /** 等级(0,1,2,3) */ - @Excel(name = "等级(0,1,2,3)") - @ApiModelProperty(value = "等级(0,1,2,3)") - private Long level; - - /** 区域id */ - @Excel(name = "区域id") - @ApiModelProperty(value = "区域id") - private Long areaId; - - /** 商品类型(1原料2商品) */ - @Excel(name = "商品类型(1原料2商品)") - @ApiModelProperty(value = "商品类型(1原料2商品)") - private Long goodsType; -} +//package com.bonus.canteen.core.supermarket.domain; +// +//import com.bonus.common.core.annotation.Excel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +//import lombok.ToString; +//import com.bonus.common.core.web.domain.BaseEntity; +// +///** +// * 商品类别对象 supermarket_material_type +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +// +// +//@Data +//@ToString +//public class SupermarketMaterialType extends BaseEntity { +// private static final long serialVersionUID = 1L; +// +// /** 主键id */ +// private Long materialTypeId; +// +// /** 类别名称 */ +// @Excel(name = "类别名称") +// @ApiModelProperty(value = "类别名称") +// private String materialTypeName; +// +// /** 父类id */ +// @Excel(name = "父类id") +// @ApiModelProperty(value = "父类id") +// private Long parentId; +// +// /** 等级(0,1,2,3) */ +// @Excel(name = "等级(0,1,2,3)") +// @ApiModelProperty(value = "等级(0,1,2,3)") +// private Long level; +// +// /** 区域id */ +// @Excel(name = "区域id") +// @ApiModelProperty(value = "区域id") +// private Long areaId; +// +// /** 商品类型(1原料2商品) */ +// @Excel(name = "商品类型(1原料2商品)") +// @ApiModelProperty(value = "商品类型(1原料2商品)") +// private Long goodsType; +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialMapper.java index a58789e..47eea6e 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialMapper.java @@ -1,62 +1,62 @@ -package com.bonus.canteen.core.supermarket.mapper; - -import java.util.List; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; - -/** - * 商品信息Mapper接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface SupermarketMaterialMapper { - /** - * 查询商品信息 - * - * @param materialId 商品信息主键 - * @return 商品信息 - */ - public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId); - - /** - * 查询商品信息列表 - * - * @param supermarketMaterial 商品信息 - * @return 商品信息集合 - */ - public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial); - - /** - * 新增商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial); - - /** - * 修改商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial); - - /** - * 删除商品信息 - * - * @param materialId 商品信息主键 - * @return 结果 - */ - public int deleteSupermarketMaterialByMaterialId(Long materialId); - - /** - * 批量删除商品信息 - * - * @param materialIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds); - - public int getSupermarketMaterialCountByMaterialTypes(Long[] materialTypeIds); -} +//package com.bonus.canteen.core.supermarket.mapper; +// +//import java.util.List; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; +// +///** +// * 商品信息Mapper接口 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//public interface SupermarketMaterialMapper { +// /** +// * 查询商品信息 +// * +// * @param materialId 商品信息主键 +// * @return 商品信息 +// */ +// public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId); +// +// /** +// * 查询商品信息列表 +// * +// * @param supermarketMaterial 商品信息 +// * @return 商品信息集合 +// */ +// public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial); +// +// /** +// * 新增商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial); +// +// /** +// * 修改商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial); +// +// /** +// * 删除商品信息 +// * +// * @param materialId 商品信息主键 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialByMaterialId(Long materialId); +// +// /** +// * 批量删除商品信息 +// * +// * @param materialIds 需要删除的数据主键集合 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds); +// +// public int getSupermarketMaterialCountByMaterialTypes(Long[] materialTypeIds); +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialTypeMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialTypeMapper.java index 9975486..a3b40ed 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialTypeMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/mapper/SupermarketMaterialTypeMapper.java @@ -1,64 +1,64 @@ -package com.bonus.canteen.core.supermarket.mapper; - -import java.util.List; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; - -/** - * 商品类别Mapper接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface SupermarketMaterialTypeMapper { - /** - * 查询商品类别 - * - * @param materialTypeId 商品类别主键 - * @return 商品类别 - */ - public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); - - public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeName(SupermarketMaterialType supermarketMaterialType); - - /** - * 查询商品类别列表 - * - * @param supermarketMaterialType 商品类别 - * @return 商品类别集合 - */ - public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType); - - /** - * 新增商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); - - /** - * 修改商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); - - /** - * 删除商品类别 - * - * @param materialTypeId 商品类别主键 - * @return 结果 - */ - public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); - - /** - * 批量删除商品类别 - * - * @param materialTypeIds 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds); - - public int getSupermarketMaterialTypeChildCountByMaterialTypes(Long[] materialTypeIds); -} +//package com.bonus.canteen.core.supermarket.mapper; +// +//import java.util.List; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; +// +///** +// * 商品类别Mapper接口 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//public interface SupermarketMaterialTypeMapper { +// /** +// * 查询商品类别 +// * +// * @param materialTypeId 商品类别主键 +// * @return 商品类别 +// */ +// public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); +// +// public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeName(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 查询商品类别列表 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 商品类别集合 +// */ +// public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 新增商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 修改商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 删除商品类别 +// * +// * @param materialTypeId 商品类别主键 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); +// +// /** +// * 批量删除商品类别 +// * +// * @param materialTypeIds 需要删除的数据主键集合 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds); +// +// public int getSupermarketMaterialTypeChildCountByMaterialTypes(Long[] materialTypeIds); +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialService.java index 0fe7bce..515d111 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialService.java @@ -1,60 +1,60 @@ -package com.bonus.canteen.core.supermarket.service; - -import java.util.List; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; - -/** - * 商品信息Service接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface ISupermarketMaterialService { - /** - * 查询商品信息 - * - * @param materialId 商品信息主键 - * @return 商品信息 - */ - public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId); - - /** - * 查询商品信息列表 - * - * @param supermarketMaterial 商品信息 - * @return 商品信息集合 - */ - public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial); - - /** - * 新增商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial); - - /** - * 修改商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial); - - /** - * 批量删除商品信息 - * - * @param materialIds 需要删除的商品信息主键集合 - * @return 结果 - */ - public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds); - - /** - * 删除商品信息信息 - * - * @param materialId 商品信息主键 - * @return 结果 - */ - public int deleteSupermarketMaterialByMaterialId(Long materialId); -} +//package com.bonus.canteen.core.supermarket.service; +// +//import java.util.List; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; +// +///** +// * 商品信息Service接口 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//public interface ISupermarketMaterialService { +// /** +// * 查询商品信息 +// * +// * @param materialId 商品信息主键 +// * @return 商品信息 +// */ +// public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId); +// +// /** +// * 查询商品信息列表 +// * +// * @param supermarketMaterial 商品信息 +// * @return 商品信息集合 +// */ +// public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial); +// +// /** +// * 新增商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial); +// +// /** +// * 修改商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial); +// +// /** +// * 批量删除商品信息 +// * +// * @param materialIds 需要删除的商品信息主键集合 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds); +// +// /** +// * 删除商品信息信息 +// * +// * @param materialId 商品信息主键 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialByMaterialId(Long materialId); +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialTypeService.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialTypeService.java index a45c7bb..492ae3c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialTypeService.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/ISupermarketMaterialTypeService.java @@ -1,60 +1,60 @@ -package com.bonus.canteen.core.supermarket.service; - -import java.util.List; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; - -/** - * 商品类别Service接口 - * - * @author xsheng - * @date 2025-05-25 - */ -public interface ISupermarketMaterialTypeService { - /** - * 查询商品类别 - * - * @param materialTypeId 商品类别主键 - * @return 商品类别 - */ - public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); - - /** - * 查询商品类别列表 - * - * @param supermarketMaterialType 商品类别 - * @return 商品类别集合 - */ - public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType); - - /** - * 新增商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); - - /** - * 修改商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); - - /** - * 批量删除商品类别 - * - * @param materialTypeIds 需要删除的商品类别主键集合 - * @return 结果 - */ - public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds); - - /** - * 删除商品类别信息 - * - * @param materialTypeId 商品类别主键 - * @return 结果 - */ - public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); -} +//package com.bonus.canteen.core.supermarket.service; +// +//import java.util.List; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; +// +///** +// * 商品类别Service接口 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//public interface ISupermarketMaterialTypeService { +// /** +// * 查询商品类别 +// * +// * @param materialTypeId 商品类别主键 +// * @return 商品类别 +// */ +// public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); +// +// /** +// * 查询商品类别列表 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 商品类别集合 +// */ +// public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 新增商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 修改商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType); +// +// /** +// * 批量删除商品类别 +// * +// * @param materialTypeIds 需要删除的商品类别主键集合 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds); +// +// /** +// * 删除商品类别信息 +// * +// * @param materialTypeId 商品类别主键 +// * @return 结果 +// */ +// public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId); +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketInfoServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketInfoServiceImpl.java index 4f41ac4..f84baa0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketInfoServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketInfoServiceImpl.java @@ -3,11 +3,7 @@ package com.bonus.canteen.core.supermarket.service.impl; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; - -import com.bonus.canteen.core.basic.domain.BasicCanteen; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; import com.bonus.canteen.core.supermarket.domain.SupermarketProduct; -import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialMapper; import com.bonus.canteen.core.supermarket.mapper.SupermarketProductMapper; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialServiceImpl.java index a0bb2b1..9a499fb 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialServiceImpl.java @@ -1,108 +1,108 @@ -package com.bonus.canteen.core.supermarket.service.impl; - -import java.util.List; - -import com.bonus.canteen.core.supermarket.domain.SupermarketProduct; -import com.bonus.canteen.core.supermarket.mapper.SupermarketProductMapper; -import com.bonus.common.core.exception.ServiceException; -import com.bonus.common.core.utils.DateUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialMapper; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; -import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialService; -import org.springframework.util.CollectionUtils; - -/** - * 商品信息Service业务层处理 - * - * @author xsheng - * @date 2025-05-25 - */ -@Service -public class SupermarketMaterialServiceImpl implements ISupermarketMaterialService { - @Autowired - private SupermarketMaterialMapper supermarketMaterialMapper; - @Autowired - private SupermarketProductMapper supermarketProductMapper; - - /** - * 查询商品信息 - * - * @param materialId 商品信息主键 - * @return 商品信息 - */ - @Override - public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId) { - return supermarketMaterialMapper.selectSupermarketMaterialByMaterialId(materialId); - } - - /** - * 查询商品信息列表 - * - * @param supermarketMaterial 商品信息 - * @return 商品信息 - */ - @Override - public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial) { - return supermarketMaterialMapper.selectSupermarketMaterialList(supermarketMaterial); - } - - /** - * 新增商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - @Override - public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial) { - supermarketMaterial.setCreateTime(DateUtils.getNowDate()); - try { - return supermarketMaterialMapper.insertSupermarketMaterial(supermarketMaterial); - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 修改商品信息 - * - * @param supermarketMaterial 商品信息 - * @return 结果 - */ - @Override - public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial) { - supermarketMaterial.setUpdateTime(DateUtils.getNowDate()); - try { - return supermarketMaterialMapper.updateSupermarketMaterial(supermarketMaterial); - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 批量删除商品信息 - * - * @param materialIds 需要删除的商品信息主键 - * @return 结果 - */ - @Override - public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds) { - List list = supermarketProductMapper.selectSupermarketProductByMaterialIds(materialIds); - if (!CollectionUtils.isEmpty(list)) { - throw new ServiceException("该原料下含有商品,不能删除"); - } - return supermarketMaterialMapper.deleteSupermarketMaterialByMaterialIds(materialIds); - } - - /** - * 删除商品信息信息 - * - * @param materialId 商品信息主键 - * @return 结果 - */ - @Override - public int deleteSupermarketMaterialByMaterialId(Long materialId) { - return supermarketMaterialMapper.deleteSupermarketMaterialByMaterialId(materialId); - } -} +//package com.bonus.canteen.core.supermarket.service.impl; +// +//import java.util.List; +// +//import com.bonus.canteen.core.supermarket.domain.SupermarketProduct; +//import com.bonus.canteen.core.supermarket.mapper.SupermarketProductMapper; +//import com.bonus.common.core.exception.ServiceException; +//import com.bonus.common.core.utils.DateUtils; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +//import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialMapper; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterial; +//import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialService; +//import org.springframework.util.CollectionUtils; +// +///** +// * 商品信息Service业务层处理 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//@Service +//public class SupermarketMaterialServiceImpl implements ISupermarketMaterialService { +// @Autowired +// private SupermarketMaterialMapper supermarketMaterialMapper; +// @Autowired +// private SupermarketProductMapper supermarketProductMapper; +// +// /** +// * 查询商品信息 +// * +// * @param materialId 商品信息主键 +// * @return 商品信息 +// */ +// @Override +// public SupermarketMaterial selectSupermarketMaterialByMaterialId(Long materialId) { +// return supermarketMaterialMapper.selectSupermarketMaterialByMaterialId(materialId); +// } +// +// /** +// * 查询商品信息列表 +// * +// * @param supermarketMaterial 商品信息 +// * @return 商品信息 +// */ +// @Override +// public List selectSupermarketMaterialList(SupermarketMaterial supermarketMaterial) { +// return supermarketMaterialMapper.selectSupermarketMaterialList(supermarketMaterial); +// } +// +// /** +// * 新增商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// @Override +// public int insertSupermarketMaterial(SupermarketMaterial supermarketMaterial) { +// supermarketMaterial.setCreateTime(DateUtils.getNowDate()); +// try { +// return supermarketMaterialMapper.insertSupermarketMaterial(supermarketMaterial); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// +// /** +// * 修改商品信息 +// * +// * @param supermarketMaterial 商品信息 +// * @return 结果 +// */ +// @Override +// public int updateSupermarketMaterial(SupermarketMaterial supermarketMaterial) { +// supermarketMaterial.setUpdateTime(DateUtils.getNowDate()); +// try { +// return supermarketMaterialMapper.updateSupermarketMaterial(supermarketMaterial); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// +// /** +// * 批量删除商品信息 +// * +// * @param materialIds 需要删除的商品信息主键 +// * @return 结果 +// */ +// @Override +// public int deleteSupermarketMaterialByMaterialIds(Long[] materialIds) { +// List list = supermarketProductMapper.selectSupermarketProductByMaterialIds(materialIds); +// if (!CollectionUtils.isEmpty(list)) { +// throw new ServiceException("该原料下含有商品,不能删除"); +// } +// return supermarketMaterialMapper.deleteSupermarketMaterialByMaterialIds(materialIds); +// } +// +// /** +// * 删除商品信息信息 +// * +// * @param materialId 商品信息主键 +// * @return 结果 +// */ +// @Override +// public int deleteSupermarketMaterialByMaterialId(Long materialId) { +// return supermarketMaterialMapper.deleteSupermarketMaterialByMaterialId(materialId); +// } +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialTypeServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialTypeServiceImpl.java index 2d8f338..5a4201c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialTypeServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/service/impl/SupermarketMaterialTypeServiceImpl.java @@ -1,124 +1,124 @@ -package com.bonus.canteen.core.supermarket.service.impl; - -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialMapper; -import com.bonus.common.core.exception.ServiceException; -import com.bonus.common.core.utils.DateUtils; -import com.bonus.common.security.utils.SecurityUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialTypeMapper; -import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; -import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialTypeService; - -/** - * 商品类别Service业务层处理 - * - * @author xsheng - * @date 2025-05-25 - */ -@Service -public class SupermarketMaterialTypeServiceImpl implements ISupermarketMaterialTypeService { - @Autowired - private SupermarketMaterialTypeMapper supermarketMaterialTypeMapper; - @Autowired - private SupermarketMaterialMapper supermarketMaterialMapper; - - /** - * 查询商品类别 - * - * @param materialTypeId 商品类别主键 - * @return 商品类别 - */ - @Override - public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId) { - return supermarketMaterialTypeMapper.selectSupermarketMaterialTypeByMaterialTypeId(materialTypeId); - } - - /** - * 查询商品类别列表 - * - * @param supermarketMaterialType 商品类别 - * @return 商品类别 - */ - @Override - public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType) { - return supermarketMaterialTypeMapper.selectSupermarketMaterialTypeList(supermarketMaterialType); - } - - /** - * 新增商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - @Override - public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType) { - supermarketMaterialType.setCreateTime(DateUtils.getNowDate()); - supermarketMaterialType.setCreateBy(SecurityUtils.getUsername()); - try { - SupermarketMaterialType checkResult = supermarketMaterialTypeMapper.selectSupermarketMaterialTypeByMaterialTypeName(supermarketMaterialType); - if (Objects.nonNull(checkResult)) { - throw new ServiceException("该超市商品类别名已存在"); - } - return supermarketMaterialTypeMapper.insertSupermarketMaterialType(supermarketMaterialType); - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 修改商品类别 - * - * @param supermarketMaterialType 商品类别 - * @return 结果 - */ - @Override - public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType) { - supermarketMaterialType.setUpdateTime(DateUtils.getNowDate()); - supermarketMaterialType.setUpdateBy(SecurityUtils.getUsername()); - try { - List allSupermarketMaterialTypeList = supermarketMaterialTypeMapper.selectSupermarketMaterialTypeList(new SupermarketMaterialType()); - List otherSupermarketMaterialTypeList = allSupermarketMaterialTypeList.stream().filter(item -> !item.getMaterialTypeId().equals(supermarketMaterialType.getMaterialTypeId())) - .map(SupermarketMaterialType::getMaterialTypeName).collect(Collectors.toList()); - if (otherSupermarketMaterialTypeList.contains(supermarketMaterialType.getMaterialTypeName())) { - throw new ServiceException("该超市商品类别名已存在"); - } - return supermarketMaterialTypeMapper.updateSupermarketMaterialType(supermarketMaterialType); - } catch (Exception e) { - throw new ServiceException(e.getMessage()); - } - } - - /** - * 批量删除商品类别 - * - * @param materialTypeIds 需要删除的商品类别主键 - * @return 结果 - */ - @Override - public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds) { - int count1 = supermarketMaterialMapper.getSupermarketMaterialCountByMaterialTypes(materialTypeIds); - if (count1 > 0) { - throw new ServiceException("该超市商品类型含有商品信息,不能删除"); - } - int count2 = supermarketMaterialTypeMapper.getSupermarketMaterialTypeChildCountByMaterialTypes(materialTypeIds); - if (count2 > 0) { - throw new ServiceException("该超市商品类型含有子类型,不能删除"); - } - return supermarketMaterialTypeMapper.deleteSupermarketMaterialTypeByMaterialTypeIds(materialTypeIds); - } - - /** - * 删除商品类别信息 - * - * @param materialTypeId 商品类别主键 - * @return 结果 - */ - @Override - public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId) { - return supermarketMaterialTypeMapper.deleteSupermarketMaterialTypeByMaterialTypeId(materialTypeId); - } -} +//package com.bonus.canteen.core.supermarket.service.impl; +// +//import java.util.List; +//import java.util.Objects; +//import java.util.stream.Collectors; +//import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialMapper; +//import com.bonus.common.core.exception.ServiceException; +//import com.bonus.common.core.utils.DateUtils; +//import com.bonus.common.security.utils.SecurityUtils; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Service; +//import com.bonus.canteen.core.supermarket.mapper.SupermarketMaterialTypeMapper; +//import com.bonus.canteen.core.supermarket.domain.SupermarketMaterialType; +//import com.bonus.canteen.core.supermarket.service.ISupermarketMaterialTypeService; +// +///** +// * 商品类别Service业务层处理 +// * +// * @author xsheng +// * @date 2025-05-25 +// */ +//@Service +//public class SupermarketMaterialTypeServiceImpl implements ISupermarketMaterialTypeService { +// @Autowired +// private SupermarketMaterialTypeMapper supermarketMaterialTypeMapper; +// @Autowired +// private SupermarketMaterialMapper supermarketMaterialMapper; +// +// /** +// * 查询商品类别 +// * +// * @param materialTypeId 商品类别主键 +// * @return 商品类别 +// */ +// @Override +// public SupermarketMaterialType selectSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId) { +// return supermarketMaterialTypeMapper.selectSupermarketMaterialTypeByMaterialTypeId(materialTypeId); +// } +// +// /** +// * 查询商品类别列表 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 商品类别 +// */ +// @Override +// public List selectSupermarketMaterialTypeList(SupermarketMaterialType supermarketMaterialType) { +// return supermarketMaterialTypeMapper.selectSupermarketMaterialTypeList(supermarketMaterialType); +// } +// +// /** +// * 新增商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// @Override +// public int insertSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType) { +// supermarketMaterialType.setCreateTime(DateUtils.getNowDate()); +// supermarketMaterialType.setCreateBy(SecurityUtils.getUsername()); +// try { +// SupermarketMaterialType checkResult = supermarketMaterialTypeMapper.selectSupermarketMaterialTypeByMaterialTypeName(supermarketMaterialType); +// if (Objects.nonNull(checkResult)) { +// throw new ServiceException("该超市商品类别名已存在"); +// } +// return supermarketMaterialTypeMapper.insertSupermarketMaterialType(supermarketMaterialType); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// +// /** +// * 修改商品类别 +// * +// * @param supermarketMaterialType 商品类别 +// * @return 结果 +// */ +// @Override +// public int updateSupermarketMaterialType(SupermarketMaterialType supermarketMaterialType) { +// supermarketMaterialType.setUpdateTime(DateUtils.getNowDate()); +// supermarketMaterialType.setUpdateBy(SecurityUtils.getUsername()); +// try { +// List allSupermarketMaterialTypeList = supermarketMaterialTypeMapper.selectSupermarketMaterialTypeList(new SupermarketMaterialType()); +// List otherSupermarketMaterialTypeList = allSupermarketMaterialTypeList.stream().filter(item -> !item.getMaterialTypeId().equals(supermarketMaterialType.getMaterialTypeId())) +// .map(SupermarketMaterialType::getMaterialTypeName).collect(Collectors.toList()); +// if (otherSupermarketMaterialTypeList.contains(supermarketMaterialType.getMaterialTypeName())) { +// throw new ServiceException("该超市商品类别名已存在"); +// } +// return supermarketMaterialTypeMapper.updateSupermarketMaterialType(supermarketMaterialType); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// +// /** +// * 批量删除商品类别 +// * +// * @param materialTypeIds 需要删除的商品类别主键 +// * @return 结果 +// */ +// @Override +// public int deleteSupermarketMaterialTypeByMaterialTypeIds(Long[] materialTypeIds) { +// int count1 = supermarketMaterialMapper.getSupermarketMaterialCountByMaterialTypes(materialTypeIds); +// if (count1 > 0) { +// throw new ServiceException("该超市商品类型含有商品信息,不能删除"); +// } +// int count2 = supermarketMaterialTypeMapper.getSupermarketMaterialTypeChildCountByMaterialTypes(materialTypeIds); +// if (count2 > 0) { +// throw new ServiceException("该超市商品类型含有子类型,不能删除"); +// } +// return supermarketMaterialTypeMapper.deleteSupermarketMaterialTypeByMaterialTypeIds(materialTypeIds); +// } +// +// /** +// * 删除商品类别信息 +// * +// * @param materialTypeId 商品类别主键 +// * @return 结果 +// */ +// @Override +// public int deleteSupermarketMaterialTypeByMaterialTypeId(Long materialTypeId) { +// return supermarketMaterialTypeMapper.deleteSupermarketMaterialTypeByMaterialTypeId(materialTypeId); +// } +//} diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialMapper.xml deleted file mode 100644 index bac730f..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialMapper.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select sm.material_id, sm.area_id, sm.material_name, sm.material_code, sm.img_url, sm.material_type_id, - sm.bar_code, sm.unit_id, sm.sale_price, sm.unit_price, sm.sales_mode, sm.shelf_life_type, - sm.shelf_life_days, sm.pur_price_ceiling, sm.big_category_id, sm.`size`, sm.description, sm.goods_type, - sm.create_by, sm.create_time, sm.update_by, sm.update_time, - ba.area_name, smt.material_type_name, iu.unit_name - from cook_material sm - left join basic_area ba on ba.area_id = sm.area_id - left join cook_material_type smt on smt.material_type_id = sm.material_type_id - left join ims_unit iu on iu.unit_id = sm.unit_id - - - - - - - - insert into cook_material - - area_id, - material_name, - material_code, - img_url, - material_type_id, - goods_type, - bar_code, - unit_id, - sale_price, - unit_price, - sales_mode, - shelf_life_type, - shelf_life_days, - pur_price_ceiling, - big_category_id, - `size`, - description, - create_by, - create_time, - update_by, - update_time, - - - #{areaId}, - #{materialName}, - #{materialCode}, - #{imgUrl}, - #{materialTypeId}, - #{goodsType}, - #{barCode}, - #{unitId}, - #{salePrice}, - #{unitPrice}, - #{salesMode}, - #{shelfLifeType}, - #{shelfLifeDays}, - #{purPriceCeiling}, - #{bigCategoryId}, - #{size}, - #{description}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update cook_material - - area_id = #{areaId}, - material_name = #{materialName}, - material_code = #{materialCode}, - img_url = #{imgUrl}, - material_type_id = #{materialTypeId}, - goods_type = #{goodsType}, - bar_code = #{barCode}, - unit_id = #{unitId}, - sale_price = #{salePrice}, - unit_price = #{unitPrice}, - sales_mode = #{salesMode}, - shelf_life_type = #{shelfLifeType}, - shelf_life_days = #{shelfLifeDays}, - pur_price_ceiling = #{purPriceCeiling}, - big_category_id = #{bigCategoryId}, - `size` = #{size}, - description = #{description}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where material_id = #{materialId} - - - - delete from cook_material where material_id = #{materialId} - - - - delete from cook_material where material_id in - - #{materialId} - - - - - \ No newline at end of file diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialTypeMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialTypeMapper.xml deleted file mode 100644 index 8273d59..0000000 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketMaterialTypeMapper.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - select material_type_id, material_type_name, parent_id, level, area_id, goods_type, create_by, create_time, update_by, update_time - from cook_material_type - - - - - - - - - - insert into cook_material_type - - material_type_name, - parent_id, - level, - area_id, - goods_type, - create_by, - create_time, - update_by, - update_time, - - - #{materialTypeName}, - #{parentId}, - #{level}, - #{areaId}, - #{goodsType}, - #{createBy}, - #{createTime}, - #{updateBy}, - #{updateTime}, - - - - - update cook_material_type - - material_type_name = #{materialTypeName}, - parent_id = #{parentId}, - level = #{level}, - area_id = #{areaId}, - goods_type = #{goodsType}, - create_by = #{createBy}, - create_time = #{createTime}, - update_by = #{updateBy}, - update_time = #{updateTime}, - - where material_type_id = #{materialTypeId} - - - - delete from cook_material_type where material_type_id = #{materialTypeId} - - - - delete from cook_material_type where material_type_id in - - #{materialTypeId} - - - - - \ No newline at end of file