Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
75e4754ecd
|
|
@ -3,6 +3,8 @@ package com.bonus.canteen.core.menu.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MapBean;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesDTO;
|
||||
import com.bonus.canteen.core.menu.service.IMenuDishesService;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -23,7 +25,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
|
||||
/**
|
||||
* 菜品信息Controller
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
|
|
@ -69,11 +71,19 @@ public class MenuDishesController extends BaseController {
|
|||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(menuDishesService.selectMenuDishesById(id));
|
||||
}
|
||||
@ApiOperation(value = "获取菜品信息详细信息")
|
||||
//@RequiresPermissions("menu:dishes:query")
|
||||
@PostMapping(value = "/getDishesType")
|
||||
public AjaxResult getDishesType(@RequestBody MapBean mapBean) {
|
||||
return success(menuDishesService.getDishesType(mapBean));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*/
|
||||
@ApiOperation(value = "新增菜品信息")
|
||||
@ApiOperation(value = "新增菜品信息-已弃用")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("menu:dishes:add")
|
||||
@SysLog(title = "菜品信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增菜品信息")
|
||||
|
|
@ -85,6 +95,20 @@ public class MenuDishesController extends BaseController {
|
|||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
//MenuDishesDTO
|
||||
|
||||
@ApiOperation(value = "新增菜品信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("menu:dishes:add")
|
||||
@SysLog(title = "菜品信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增菜品信息")
|
||||
@PostMapping("/addMenuDishes")
|
||||
public AjaxResult addMenuDishes(@RequestBody MenuDishesDTO menuDishesDTO) {
|
||||
try {
|
||||
return toAjax(menuDishesService.addMenuDishes(menuDishesDTO));
|
||||
} catch (Exception e) {
|
||||
return error("系统错误, " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改菜品信息
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ import javax.validation.Valid;
|
|||
|
||||
import com.bonus.canteen.core.menu.domain.MenuMaterialCategory;
|
||||
import com.bonus.canteen.core.menu.dto.CategoryTreeListDTO;
|
||||
import com.bonus.canteen.core.menu.dto.LongIds;
|
||||
import com.bonus.canteen.core.menu.dto.MenuMaterialCategoryAddDTO;
|
||||
import com.bonus.canteen.core.menu.dto.StringIds;
|
||||
import com.bonus.canteen.core.menu.service.IMenuMaterialCategoryService;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -112,9 +114,9 @@ public class MenuMaterialCategoryController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("menu:category:remove")
|
||||
@SysLog(title = "原料类别", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除原料类别")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(menuMaterialCategoryService.deleteMenuMaterialCategoryByIds(ids));
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody StringIds ids) {
|
||||
return toAjax(menuMaterialCategoryService.deleteMenuMaterialCategoryByIds(ids.getIds()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "原料树形结构")
|
||||
|
|
@ -122,7 +124,7 @@ public class MenuMaterialCategoryController extends BaseController {
|
|||
//@RequiresPermissions("menu:category:remove")
|
||||
@SysLog(title = "原料树形结构", businessType = OperaType.QUERY, logType = 1,module = "经研院食堂->原料管理")
|
||||
@PostMapping("/getTree")
|
||||
public AjaxResult getTree( CategoryTreeListDTO content) {
|
||||
public AjaxResult getTree( @RequestBody CategoryTreeListDTO content) {
|
||||
return success(menuMaterialCategoryService.getTree(content));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MenuMaterial;
|
||||
import com.bonus.canteen.core.menu.dto.IntegerIds;
|
||||
import com.bonus.canteen.core.menu.service.IMenuMaterialService;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -111,8 +112,8 @@ public class MenuMaterialController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("menu:material:remove")
|
||||
@SysLog(title = "商家食材原料信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除商家食材原料信息")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(menuMaterialService.deleteMenuMaterialByIds(ids));
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody IntegerIds ids) {
|
||||
return toAjax(menuMaterialService.deleteMenuMaterialByIds(ids.getIds()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import com.bonus.canteen.core.menu.domain.MenuNutrition;
|
||||
import com.bonus.canteen.core.menu.dto.MenuNutritionDTO;
|
||||
import com.bonus.canteen.core.menu.dto.StringIds;
|
||||
import com.bonus.canteen.core.menu.service.IMenuNutritionService;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -110,8 +111,8 @@ public class MenuNutritionController extends BaseController {
|
|||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("menu:nutrition:remove")
|
||||
@SysLog(title = "食材营养基础信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除食材营养基础信息")
|
||||
@PostMapping("/del/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(menuNutritionService.deleteMenuNutritionByIds(ids));
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody StringIds ids) {
|
||||
return toAjax(menuNutritionService.deleteMenuNutritionByIds(ids.getIds()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ import java.util.List;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MenuNutritionType;
|
||||
import com.bonus.canteen.core.menu.dto.MenuNutritionTypeDTO;
|
||||
import com.bonus.canteen.core.menu.dto.IntegerIds;
|
||||
import com.bonus.canteen.core.menu.service.IMenuNutritionTypeService;
|
||||
import com.bonus.canteen.core.menu.vo.NutritionTypeV2VO;
|
||||
import com.bonus.canteen.core.menu.vo.NutritionTypeVo;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -113,7 +112,7 @@ public class MenuNutritionTypeController extends BaseController {
|
|||
//@RequiresPermissions("menu:type:remove")
|
||||
@SysLog(title = "营养基础类型", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除营养基础类型")
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody MenuNutritionTypeDTO menuNutritionTypeDTO) {
|
||||
public AjaxResult remove(@RequestBody IntegerIds menuNutritionTypeDTO) {
|
||||
return toAjax(menuNutritionTypeService.deleteMenuNutritionTypeByIds(menuNutritionTypeDTO.getIds()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.bonus.canteen.core.menu.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/4/10 14:35
|
||||
*/
|
||||
@Data
|
||||
public class MapBean{
|
||||
private String key;
|
||||
private String value;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.bonus.canteen.core.menu.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/4/10 19:16
|
||||
*/
|
||||
@Data
|
||||
public class MenuDishesRelation {
|
||||
private Integer id;
|
||||
private Integer keyWordId;
|
||||
private Long dishesId;
|
||||
private Integer delFlag;
|
||||
private Integer revision;
|
||||
private Long crby;
|
||||
private String crtime;
|
||||
private Integer upby;
|
||||
private String uptime;
|
||||
}
|
||||
|
|
@ -60,5 +60,7 @@ public class MenuMaterialCategory extends Model<MenuMaterialCategory> {
|
|||
private Integer level;
|
||||
@ApiModelProperty("大类id")
|
||||
private Long bigCategoryId;
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ import lombok.Data;
|
|||
* @date 2025/4/9 17:52
|
||||
*/
|
||||
@Data
|
||||
public class MenuNutritionTypeDTO {
|
||||
public class IntegerIds {
|
||||
private Integer[] ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/4/9 17:52
|
||||
*/
|
||||
@Data
|
||||
public class LongIds {
|
||||
private Long[] ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
public class MenuDishesAddMaterialDTO {
|
||||
@ApiModelProperty("食材id")
|
||||
private @NotNull(
|
||||
message = "{menu_material_id_null}"
|
||||
) Long materialId;
|
||||
@ApiModelProperty("食材重量(g)")
|
||||
private @NotNull(
|
||||
message = "{menu_weight_null}"
|
||||
) Double weight;
|
||||
@ApiModelProperty("材料类型(1主料,2辅料,3配料)")
|
||||
private @NotNull(
|
||||
message = "{menu_material_type_null}"
|
||||
) Integer materialType;
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Integer getMaterialType() {
|
||||
return this.materialType;
|
||||
}
|
||||
|
||||
public void setMaterialId(final Long materialId) {
|
||||
this.materialId = materialId;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setMaterialType(final Integer materialType) {
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/4/10 15:44
|
||||
*/
|
||||
@Data
|
||||
public class MenuDishesDTO {
|
||||
|
||||
@ApiModelProperty("基础菜品id)")
|
||||
private String baseDishesId;
|
||||
|
||||
@ApiModelProperty("菜品id")
|
||||
private String dishesId;
|
||||
|
||||
@ApiModelProperty("类型(1-菜品,2-套餐)")
|
||||
private Integer mealType;
|
||||
@ApiModelProperty("计价方式(1按份,2称重)")
|
||||
private Integer salesMode;
|
||||
|
||||
@ApiModelProperty("规格类型(1-标准,2-大小份)")
|
||||
private Integer sizeType;
|
||||
|
||||
@ApiModelProperty("成本价")
|
||||
private Integer materialCost;
|
||||
|
||||
@ApiModelProperty("成本价-小份")
|
||||
private Integer littleMaterialCost;
|
||||
|
||||
|
||||
@ApiModelProperty("是否是公共菜品(1-是,2-否,)")
|
||||
private Integer publicDishes;
|
||||
|
||||
|
||||
@ApiModelProperty("结果图转注册图 1 是 2否")
|
||||
private Integer convertFlag;
|
||||
|
||||
@ApiModelProperty("训练图数量")
|
||||
private Integer trainCount = 15;
|
||||
|
||||
@ApiModelProperty("识别图")
|
||||
private Integer identifyCount = 200;
|
||||
|
||||
@ApiModelProperty("区域id")
|
||||
private Long areaId;
|
||||
|
||||
@ApiModelProperty("食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
@ApiModelProperty("档口id")
|
||||
private Long shopstallId;
|
||||
|
||||
@ApiModelProperty("菜品编号")
|
||||
private String dishesNum;
|
||||
|
||||
@ApiModelProperty("菜品名称")
|
||||
private String dishesName;
|
||||
|
||||
@ApiModelProperty("称重单位(g)")
|
||||
private Integer unitPrice;
|
||||
|
||||
@ApiModelProperty("称重单位(g)")
|
||||
private Integer price;
|
||||
|
||||
@ApiModelProperty("标准份量")
|
||||
private Double weight;
|
||||
|
||||
@ApiModelProperty("质量偏差(g)")
|
||||
private Double weightDeviation;
|
||||
|
||||
@ApiModelProperty("菜品图片url")
|
||||
private String imageUrl;
|
||||
|
||||
@ApiModelProperty("原材料")
|
||||
private @Valid List<MenuDishesAddMaterialDTO> materialList;
|
||||
|
||||
@TableField(value = "crby", fill = FieldFill.INSERT)
|
||||
@ApiModelProperty("创建人")
|
||||
private String crby;
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime crtime;
|
||||
@TableField(value = "upby", fill = FieldFill.UPDATE)
|
||||
@ApiModelProperty("更新人")
|
||||
private String upby;
|
||||
@ApiModelProperty("更新时间")
|
||||
private LocalDateTime uptime;
|
||||
|
||||
@ApiModelProperty("功效")
|
||||
private Integer effectId;
|
||||
|
||||
@ApiModelProperty("菜系")
|
||||
private Integer styleId;
|
||||
|
||||
@ApiModelProperty("灶类")
|
||||
private Integer cookId;
|
||||
|
||||
@ApiModelProperty("菜品分类")
|
||||
private Integer classifyId;
|
||||
|
||||
@ApiModelProperty("标签id")
|
||||
private List<Integer> labelIdList;
|
||||
|
||||
@ApiModelProperty("口味id")
|
||||
private @Size( max = 3,message = "口味最多配置3个")
|
||||
List<Integer> tasteIdList;
|
||||
|
||||
@ApiModelProperty("季节分类")
|
||||
private List<Integer> season;
|
||||
|
||||
@ApiModelProperty("适宜人群")
|
||||
private List<Integer> suitIdList;
|
||||
|
||||
@ApiModelProperty("餐次")
|
||||
private List<Integer> mealList;
|
||||
|
||||
private Integer customId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,529 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NutritionEntityDTO {
|
||||
private Double edible;
|
||||
private Double water;
|
||||
private Double calories;
|
||||
private Double protein;
|
||||
private Double fat;
|
||||
private Double carbohydrate;
|
||||
private Double dietaryFiber;
|
||||
private Double cholesterol;
|
||||
private Double ash;
|
||||
private Double vitaminA;
|
||||
private Double carotene;
|
||||
private Double retinol;
|
||||
private Double thiamine;
|
||||
private Double riboflavin;
|
||||
private Double niacin;
|
||||
private Double vitaminC;
|
||||
private Double vitaminE;
|
||||
private Double calcium;
|
||||
private Double phosphorus;
|
||||
private Double kalium;
|
||||
private Double sodium;
|
||||
private Double magnesium;
|
||||
private Double iron;
|
||||
private Double zinc;
|
||||
private Double selenium;
|
||||
private Double cuprum;
|
||||
private Double manganese;
|
||||
private Double isoleucine;
|
||||
private Double leucine;
|
||||
private Double lysine;
|
||||
private Double saaTotal;
|
||||
private Double aaaTotal;
|
||||
private Double threonine;
|
||||
private Double tryptophan;
|
||||
private Double valine;
|
||||
private Double arginine;
|
||||
private Double histidine;
|
||||
private Double alanine;
|
||||
private Double asparticAcid;
|
||||
private Double glutamate;
|
||||
private Double glycine;
|
||||
private Double proline;
|
||||
private Double serine;
|
||||
private Double fattyAcid;
|
||||
private Double iodine;
|
||||
private Double folic;
|
||||
private Double choline;
|
||||
private Double biotin;
|
||||
private Double pantothenicAcid;
|
||||
private Double guanine;
|
||||
private Double adenine;
|
||||
private Double hypoxanthine;
|
||||
private Double xanthine;
|
||||
private Double purine;
|
||||
private Double glycemicIndex;
|
||||
private Double weight;
|
||||
private Double totalWeight;
|
||||
private Double baseWeight;
|
||||
|
||||
public Double getEdible() {
|
||||
return this.edible;
|
||||
}
|
||||
|
||||
public Double getWater() {
|
||||
return this.water;
|
||||
}
|
||||
|
||||
public Double getCalories() {
|
||||
return this.calories;
|
||||
}
|
||||
|
||||
public Double getProtein() {
|
||||
return this.protein;
|
||||
}
|
||||
|
||||
public Double getFat() {
|
||||
return this.fat;
|
||||
}
|
||||
|
||||
public Double getCarbohydrate() {
|
||||
return this.carbohydrate;
|
||||
}
|
||||
|
||||
public Double getDietaryFiber() {
|
||||
return this.dietaryFiber;
|
||||
}
|
||||
|
||||
public Double getCholesterol() {
|
||||
return this.cholesterol;
|
||||
}
|
||||
|
||||
public Double getAsh() {
|
||||
return this.ash;
|
||||
}
|
||||
|
||||
public Double getVitaminA() {
|
||||
return this.vitaminA;
|
||||
}
|
||||
|
||||
public Double getCarotene() {
|
||||
return this.carotene;
|
||||
}
|
||||
|
||||
public Double getRetinol() {
|
||||
return this.retinol;
|
||||
}
|
||||
|
||||
public Double getThiamine() {
|
||||
return this.thiamine;
|
||||
}
|
||||
|
||||
public Double getRiboflavin() {
|
||||
return this.riboflavin;
|
||||
}
|
||||
|
||||
public Double getNiacin() {
|
||||
return this.niacin;
|
||||
}
|
||||
|
||||
public Double getVitaminC() {
|
||||
return this.vitaminC;
|
||||
}
|
||||
|
||||
public Double getVitaminE() {
|
||||
return this.vitaminE;
|
||||
}
|
||||
|
||||
public Double getCalcium() {
|
||||
return this.calcium;
|
||||
}
|
||||
|
||||
public Double getPhosphorus() {
|
||||
return this.phosphorus;
|
||||
}
|
||||
|
||||
public Double getKalium() {
|
||||
return this.kalium;
|
||||
}
|
||||
|
||||
public Double getSodium() {
|
||||
return this.sodium;
|
||||
}
|
||||
|
||||
public Double getMagnesium() {
|
||||
return this.magnesium;
|
||||
}
|
||||
|
||||
public Double getIron() {
|
||||
return this.iron;
|
||||
}
|
||||
|
||||
public Double getZinc() {
|
||||
return this.zinc;
|
||||
}
|
||||
|
||||
public Double getSelenium() {
|
||||
return this.selenium;
|
||||
}
|
||||
|
||||
public Double getCuprum() {
|
||||
return this.cuprum;
|
||||
}
|
||||
|
||||
public Double getManganese() {
|
||||
return this.manganese;
|
||||
}
|
||||
|
||||
public Double getIsoleucine() {
|
||||
return this.isoleucine;
|
||||
}
|
||||
|
||||
public Double getLeucine() {
|
||||
return this.leucine;
|
||||
}
|
||||
|
||||
public Double getLysine() {
|
||||
return this.lysine;
|
||||
}
|
||||
|
||||
public Double getSaaTotal() {
|
||||
return this.saaTotal;
|
||||
}
|
||||
|
||||
public Double getAaaTotal() {
|
||||
return this.aaaTotal;
|
||||
}
|
||||
|
||||
public Double getThreonine() {
|
||||
return this.threonine;
|
||||
}
|
||||
|
||||
public Double getTryptophan() {
|
||||
return this.tryptophan;
|
||||
}
|
||||
|
||||
public Double getValine() {
|
||||
return this.valine;
|
||||
}
|
||||
|
||||
public Double getArginine() {
|
||||
return this.arginine;
|
||||
}
|
||||
|
||||
public Double getHistidine() {
|
||||
return this.histidine;
|
||||
}
|
||||
|
||||
public Double getAlanine() {
|
||||
return this.alanine;
|
||||
}
|
||||
|
||||
public Double getAsparticAcid() {
|
||||
return this.asparticAcid;
|
||||
}
|
||||
|
||||
public Double getGlutamate() {
|
||||
return this.glutamate;
|
||||
}
|
||||
|
||||
public Double getGlycine() {
|
||||
return this.glycine;
|
||||
}
|
||||
|
||||
public Double getProline() {
|
||||
return this.proline;
|
||||
}
|
||||
|
||||
public Double getSerine() {
|
||||
return this.serine;
|
||||
}
|
||||
|
||||
public Double getFattyAcid() {
|
||||
return this.fattyAcid;
|
||||
}
|
||||
|
||||
public Double getIodine() {
|
||||
return this.iodine;
|
||||
}
|
||||
|
||||
public Double getFolic() {
|
||||
return this.folic;
|
||||
}
|
||||
|
||||
public Double getCholine() {
|
||||
return this.choline;
|
||||
}
|
||||
|
||||
public Double getBiotin() {
|
||||
return this.biotin;
|
||||
}
|
||||
|
||||
public Double getPantothenicAcid() {
|
||||
return this.pantothenicAcid;
|
||||
}
|
||||
|
||||
public Double getGuanine() {
|
||||
return this.guanine;
|
||||
}
|
||||
|
||||
public Double getAdenine() {
|
||||
return this.adenine;
|
||||
}
|
||||
|
||||
public Double getHypoxanthine() {
|
||||
return this.hypoxanthine;
|
||||
}
|
||||
|
||||
public Double getXanthine() {
|
||||
return this.xanthine;
|
||||
}
|
||||
|
||||
public Double getPurine() {
|
||||
return this.purine;
|
||||
}
|
||||
|
||||
public Double getGlycemicIndex() {
|
||||
return this.glycemicIndex;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Double getTotalWeight() {
|
||||
return this.totalWeight;
|
||||
}
|
||||
|
||||
public Double getBaseWeight() {
|
||||
return this.baseWeight;
|
||||
}
|
||||
|
||||
public void setEdible(final Double edible) {
|
||||
this.edible = edible;
|
||||
}
|
||||
|
||||
public void setWater(final Double water) {
|
||||
this.water = water;
|
||||
}
|
||||
|
||||
public void setCalories(final Double calories) {
|
||||
this.calories = calories;
|
||||
}
|
||||
|
||||
public void setProtein(final Double protein) {
|
||||
this.protein = protein;
|
||||
}
|
||||
|
||||
public void setFat(final Double fat) {
|
||||
this.fat = fat;
|
||||
}
|
||||
|
||||
public void setCarbohydrate(final Double carbohydrate) {
|
||||
this.carbohydrate = carbohydrate;
|
||||
}
|
||||
|
||||
public void setDietaryFiber(final Double dietaryFiber) {
|
||||
this.dietaryFiber = dietaryFiber;
|
||||
}
|
||||
|
||||
public void setCholesterol(final Double cholesterol) {
|
||||
this.cholesterol = cholesterol;
|
||||
}
|
||||
|
||||
public void setAsh(final Double ash) {
|
||||
this.ash = ash;
|
||||
}
|
||||
|
||||
public void setVitaminA(final Double vitaminA) {
|
||||
this.vitaminA = vitaminA;
|
||||
}
|
||||
|
||||
public void setCarotene(final Double carotene) {
|
||||
this.carotene = carotene;
|
||||
}
|
||||
|
||||
public void setRetinol(final Double retinol) {
|
||||
this.retinol = retinol;
|
||||
}
|
||||
|
||||
public void setThiamine(final Double thiamine) {
|
||||
this.thiamine = thiamine;
|
||||
}
|
||||
|
||||
public void setRiboflavin(final Double riboflavin) {
|
||||
this.riboflavin = riboflavin;
|
||||
}
|
||||
|
||||
public void setNiacin(final Double niacin) {
|
||||
this.niacin = niacin;
|
||||
}
|
||||
|
||||
public void setVitaminC(final Double vitaminC) {
|
||||
this.vitaminC = vitaminC;
|
||||
}
|
||||
|
||||
public void setVitaminE(final Double vitaminE) {
|
||||
this.vitaminE = vitaminE;
|
||||
}
|
||||
|
||||
public void setCalcium(final Double calcium) {
|
||||
this.calcium = calcium;
|
||||
}
|
||||
|
||||
public void setPhosphorus(final Double phosphorus) {
|
||||
this.phosphorus = phosphorus;
|
||||
}
|
||||
|
||||
public void setKalium(final Double kalium) {
|
||||
this.kalium = kalium;
|
||||
}
|
||||
|
||||
public void setSodium(final Double sodium) {
|
||||
this.sodium = sodium;
|
||||
}
|
||||
|
||||
public void setMagnesium(final Double magnesium) {
|
||||
this.magnesium = magnesium;
|
||||
}
|
||||
|
||||
public void setIron(final Double iron) {
|
||||
this.iron = iron;
|
||||
}
|
||||
|
||||
public void setZinc(final Double zinc) {
|
||||
this.zinc = zinc;
|
||||
}
|
||||
|
||||
public void setSelenium(final Double selenium) {
|
||||
this.selenium = selenium;
|
||||
}
|
||||
|
||||
public void setCuprum(final Double cuprum) {
|
||||
this.cuprum = cuprum;
|
||||
}
|
||||
|
||||
public void setManganese(final Double manganese) {
|
||||
this.manganese = manganese;
|
||||
}
|
||||
|
||||
public void setIsoleucine(final Double isoleucine) {
|
||||
this.isoleucine = isoleucine;
|
||||
}
|
||||
|
||||
public void setLeucine(final Double leucine) {
|
||||
this.leucine = leucine;
|
||||
}
|
||||
|
||||
public void setLysine(final Double lysine) {
|
||||
this.lysine = lysine;
|
||||
}
|
||||
|
||||
public void setSaaTotal(final Double saaTotal) {
|
||||
this.saaTotal = saaTotal;
|
||||
}
|
||||
|
||||
public void setAaaTotal(final Double aaaTotal) {
|
||||
this.aaaTotal = aaaTotal;
|
||||
}
|
||||
|
||||
public void setThreonine(final Double threonine) {
|
||||
this.threonine = threonine;
|
||||
}
|
||||
|
||||
public void setTryptophan(final Double tryptophan) {
|
||||
this.tryptophan = tryptophan;
|
||||
}
|
||||
|
||||
public void setValine(final Double valine) {
|
||||
this.valine = valine;
|
||||
}
|
||||
|
||||
public void setArginine(final Double arginine) {
|
||||
this.arginine = arginine;
|
||||
}
|
||||
|
||||
public void setHistidine(final Double histidine) {
|
||||
this.histidine = histidine;
|
||||
}
|
||||
|
||||
public void setAlanine(final Double alanine) {
|
||||
this.alanine = alanine;
|
||||
}
|
||||
|
||||
public void setAsparticAcid(final Double asparticAcid) {
|
||||
this.asparticAcid = asparticAcid;
|
||||
}
|
||||
|
||||
public void setGlutamate(final Double glutamate) {
|
||||
this.glutamate = glutamate;
|
||||
}
|
||||
|
||||
public void setGlycine(final Double glycine) {
|
||||
this.glycine = glycine;
|
||||
}
|
||||
|
||||
public void setProline(final Double proline) {
|
||||
this.proline = proline;
|
||||
}
|
||||
|
||||
public void setSerine(final Double serine) {
|
||||
this.serine = serine;
|
||||
}
|
||||
|
||||
public void setFattyAcid(final Double fattyAcid) {
|
||||
this.fattyAcid = fattyAcid;
|
||||
}
|
||||
|
||||
public void setIodine(final Double iodine) {
|
||||
this.iodine = iodine;
|
||||
}
|
||||
|
||||
public void setFolic(final Double folic) {
|
||||
this.folic = folic;
|
||||
}
|
||||
|
||||
public void setCholine(final Double choline) {
|
||||
this.choline = choline;
|
||||
}
|
||||
|
||||
public void setBiotin(final Double biotin) {
|
||||
this.biotin = biotin;
|
||||
}
|
||||
|
||||
public void setPantothenicAcid(final Double pantothenicAcid) {
|
||||
this.pantothenicAcid = pantothenicAcid;
|
||||
}
|
||||
|
||||
public void setGuanine(final Double guanine) {
|
||||
this.guanine = guanine;
|
||||
}
|
||||
|
||||
public void setAdenine(final Double adenine) {
|
||||
this.adenine = adenine;
|
||||
}
|
||||
|
||||
public void setHypoxanthine(final Double hypoxanthine) {
|
||||
this.hypoxanthine = hypoxanthine;
|
||||
}
|
||||
|
||||
public void setXanthine(final Double xanthine) {
|
||||
this.xanthine = xanthine;
|
||||
}
|
||||
|
||||
public void setPurine(final Double purine) {
|
||||
this.purine = purine;
|
||||
}
|
||||
|
||||
public void setGlycemicIndex(final Double glycemicIndex) {
|
||||
this.glycemicIndex = glycemicIndex;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setTotalWeight(final Double totalWeight) {
|
||||
this.totalWeight = totalWeight;
|
||||
}
|
||||
|
||||
public void setBaseWeight(final Double baseWeight) {
|
||||
this.baseWeight = baseWeight;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author xliu
|
||||
* @date 2025/4/9 17:52
|
||||
*/
|
||||
@Data
|
||||
public class StringIds {
|
||||
private String[] ids;
|
||||
}
|
||||
|
|
@ -2,18 +2,23 @@ package com.bonus.canteen.core.menu.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MapBean;
|
||||
import com.bonus.canteen.core.menu.domain.MenuDishes;
|
||||
import com.bonus.canteen.core.menu.domain.MenuDishesRelation;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesDTO;
|
||||
import com.bonus.canteen.core.utils.NutritionEntity;
|
||||
|
||||
/**
|
||||
* 菜品信息Mapper接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface MenuDishesMapper {
|
||||
/**
|
||||
* 查询菜品信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 菜品信息
|
||||
*/
|
||||
|
|
@ -21,7 +26,7 @@ public interface MenuDishesMapper {
|
|||
|
||||
/**
|
||||
* 查询菜品信息列表
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 菜品信息集合
|
||||
*/
|
||||
|
|
@ -29,7 +34,7 @@ public interface MenuDishesMapper {
|
|||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -37,7 +42,7 @@ public interface MenuDishesMapper {
|
|||
|
||||
/**
|
||||
* 修改菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -45,7 +50,7 @@ public interface MenuDishesMapper {
|
|||
|
||||
/**
|
||||
* 删除菜品信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -53,9 +58,27 @@ public interface MenuDishesMapper {
|
|||
|
||||
/**
|
||||
* 批量删除菜品信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuDishesByIds(Long[] ids);
|
||||
|
||||
List<MapBean> getDishesType(MapBean mapBean);
|
||||
|
||||
MenuDishes getOne(MenuDishesDTO menuDishesDTO);
|
||||
|
||||
int addMenuDishesBase(MenuDishesDTO menuDishesDTO);
|
||||
|
||||
int addMenuDishes(MenuDishesDTO menuDishesDTO);
|
||||
|
||||
int adddishesLabel(MenuDishesRelation menuDishesRelation);
|
||||
int adddishesTaste(MenuDishesRelation menuDishesRelation);
|
||||
int adddishesSeason(MenuDishesRelation menuDishesRelation);
|
||||
int adddishesSuit(MenuDishesRelation menuDishesRelation);
|
||||
int adddishesMeal(MenuDishesRelation menuDishesRelation);
|
||||
|
||||
NutritionEntity getNutritionEntity(MenuDishesAddMaterialDTO dto);
|
||||
|
||||
int addFinalNutrition(NutritionEntity nutritionEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,9 @@ public interface MenuMaterialCategoryMapper extends BaseMapper<MenuMaterialCateg
|
|||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuMaterialCategoryByIds(Long[] ids);
|
||||
public int deleteMenuMaterialCategoryByIds(String[] ids);
|
||||
|
||||
List<String>getChildCategoryIds(String[] ids);
|
||||
|
||||
List<MenuCategoryTreeVO> selectCategoryTrees(CategoryTreeListDTO content);
|
||||
@Select({"select category_id id, parent_id, category_name,category_type,area_id from menu_material_category ${ew.customSqlSegment}"})
|
||||
|
|
@ -73,4 +75,6 @@ public interface MenuMaterialCategoryMapper extends BaseMapper<MenuMaterialCateg
|
|||
String getCategoryChildMaxNum(@Param("parentId") Long parentId, @Param("categoryType") Integer categoryType, @Param("delFlag") Integer delFlag);
|
||||
|
||||
List<Long> getTenantAreaIdList(@Param("excludeMiddle") Integer excludeMiddle, @Param("authPO") MgrUserAuthPO mgrUserAuthPO);
|
||||
|
||||
MenuMaterialCategory getOne(MenuMaterialCategory menuMaterialCategory);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,9 @@ public interface MenuMaterialMapper {
|
|||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuMaterialByIds(Long[] ids);
|
||||
public int deleteMenuMaterialByIds(Integer[] ids);
|
||||
|
||||
int getLastId();
|
||||
|
||||
MenuMaterial getOne(MenuMaterial menuMaterial);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public interface MenuNutritionMapper {
|
|||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuNutritionByIds(Long[] ids);
|
||||
public int deleteMenuNutritionByIds(String[] ids);
|
||||
/**
|
||||
* 根据食材名称查询食材营养基础信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,18 +1,21 @@
|
|||
package com.bonus.canteen.core.menu.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MapBean;
|
||||
import com.bonus.canteen.core.menu.domain.MenuDishes;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesDTO;
|
||||
|
||||
/**
|
||||
* 菜品信息Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface IMenuDishesService {
|
||||
/**
|
||||
* 查询菜品信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 菜品信息
|
||||
*/
|
||||
|
|
@ -20,7 +23,7 @@ public interface IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 查询菜品信息列表
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 菜品信息集合
|
||||
*/
|
||||
|
|
@ -28,7 +31,7 @@ public interface IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +39,7 @@ public interface IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 修改菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,7 +47,7 @@ public interface IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 批量删除菜品信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的菜品信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -52,9 +55,13 @@ public interface IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 删除菜品信息信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuDishesById(Long id);
|
||||
|
||||
List<MapBean> getDishesType(MapBean mapBean);
|
||||
|
||||
int addMenuDishes(MenuDishesDTO menuDishesDTO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public interface IMenuMaterialCategoryService extends IService<MenuMaterialCateg
|
|||
* @param ids 需要删除的原料类别主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuMaterialCategoryByIds(Long[] ids);
|
||||
public int deleteMenuMaterialCategoryByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除原料类别信息
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import com.bonus.canteen.core.menu.domain.MenuMaterial;
|
|||
|
||||
/**
|
||||
* 商家食材原料信息Service接口
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
public interface IMenuMaterialService {
|
||||
/**
|
||||
* 查询商家食材原料信息
|
||||
*
|
||||
*
|
||||
* @param id 商家食材原料信息主键
|
||||
* @return 商家食材原料信息
|
||||
*/
|
||||
|
|
@ -20,7 +20,7 @@ public interface IMenuMaterialService {
|
|||
|
||||
/**
|
||||
* 查询商家食材原料信息列表
|
||||
*
|
||||
*
|
||||
* @param menuMaterial 商家食材原料信息
|
||||
* @return 商家食材原料信息集合
|
||||
*/
|
||||
|
|
@ -28,7 +28,7 @@ public interface IMenuMaterialService {
|
|||
|
||||
/**
|
||||
* 新增商家食材原料信息
|
||||
*
|
||||
*
|
||||
* @param menuMaterial 商家食材原料信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -36,7 +36,7 @@ public interface IMenuMaterialService {
|
|||
|
||||
/**
|
||||
* 修改商家食材原料信息
|
||||
*
|
||||
*
|
||||
* @param menuMaterial 商家食材原料信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -44,15 +44,15 @@ public interface IMenuMaterialService {
|
|||
|
||||
/**
|
||||
* 批量删除商家食材原料信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的商家食材原料信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuMaterialByIds(Long[] ids);
|
||||
public int deleteMenuMaterialByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除商家食材原料信息信息
|
||||
*
|
||||
*
|
||||
* @param id 商家食材原料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public interface IMenuNutritionService {
|
|||
* @param ids 需要删除的食材营养基础信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuNutritionByIds(Long[] ids);
|
||||
public int deleteMenuNutritionByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除食材营养基础信息信息
|
||||
|
|
|
|||
|
|
@ -1,18 +1,36 @@
|
|||
package com.bonus.canteen.core.menu.service.impl;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.canteen.core.menu.domain.MapBean;
|
||||
import com.bonus.canteen.core.menu.domain.MenuDishesRelation;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO;
|
||||
import com.bonus.canteen.core.menu.dto.MenuDishesDTO;
|
||||
import com.bonus.canteen.core.menu.service.IMenuDishesService;
|
||||
import com.bonus.canteen.core.utils.Arith;
|
||||
import com.bonus.canteen.core.utils.NutritionEntity;
|
||||
import com.bonus.canteen.core.utils.NutritionEntityUtil;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.houqin.utils.id.Id;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.menu.mapper.MenuDishesMapper;
|
||||
import com.bonus.canteen.core.menu.domain.MenuDishes;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 菜品信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
|
|
@ -23,7 +41,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 查询菜品信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 菜品信息
|
||||
*/
|
||||
|
|
@ -34,7 +52,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 查询菜品信息列表
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 菜品信息
|
||||
*/
|
||||
|
|
@ -45,7 +63,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 新增菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -61,7 +79,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 修改菜品信息
|
||||
*
|
||||
*
|
||||
* @param menuDishes 菜品信息
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -77,7 +95,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 批量删除菜品信息
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的菜品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -88,7 +106,7 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
|
||||
/**
|
||||
* 删除菜品信息信息
|
||||
*
|
||||
*
|
||||
* @param id 菜品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
@ -96,4 +114,138 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
public int deleteMenuDishesById(Long id) {
|
||||
return menuDishesMapper.deleteMenuDishesById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MapBean> getDishesType(MapBean mapBean) {
|
||||
return menuDishesMapper.getDishesType(mapBean);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int addMenuDishes(MenuDishesDTO menuDishesDTO) {
|
||||
//检查菜品是否已存在
|
||||
MenuDishes menuDishesOne = menuDishesMapper.getOne(menuDishesDTO);
|
||||
if(menuDishesOne !=null){
|
||||
throw new ServiceException("菜品已存在");
|
||||
}
|
||||
Long dishesId = Id.next();
|
||||
Long baseDishesId = Id.next();
|
||||
menuDishesDTO.setCrby(SecurityUtils.getUserId()+"");
|
||||
//添加基础主表信息
|
||||
menuDishesDTO.setBaseDishesId(baseDishesId+"");
|
||||
menuDishesDTO.setDishesId(dishesId+"");
|
||||
menuDishesDTO.setCustomId(-1);
|
||||
int baseNum = menuDishesMapper.addMenuDishesBase(menuDishesDTO);
|
||||
//添加主要信息
|
||||
int dishesNum = menuDishesMapper.addMenuDishes(menuDishesDTO);
|
||||
|
||||
//添加菜品关联信息
|
||||
//标签
|
||||
List<Integer> labelIdList = menuDishesDTO.getLabelIdList();
|
||||
for (Integer i: labelIdList) {
|
||||
MenuDishesRelation menuDishesRelation = new MenuDishesRelation();
|
||||
menuDishesRelation.setKeyWordId(i);
|
||||
menuDishesRelation.setCrby(SecurityUtils.getUserId());
|
||||
menuDishesRelation.setDishesId(dishesId);
|
||||
menuDishesMapper.adddishesLabel(menuDishesRelation);
|
||||
}
|
||||
//口味
|
||||
List<Integer> tasteIdList = menuDishesDTO.getTasteIdList();
|
||||
for (Integer i: tasteIdList) {
|
||||
MenuDishesRelation menuDishesRelation = new MenuDishesRelation();
|
||||
menuDishesRelation.setKeyWordId(i);
|
||||
menuDishesRelation.setCrby(SecurityUtils.getUserId());
|
||||
menuDishesRelation.setDishesId(dishesId);
|
||||
menuDishesMapper.adddishesTaste(menuDishesRelation);
|
||||
}
|
||||
//季节分类
|
||||
List<Integer> seasonList = menuDishesDTO.getSeason();
|
||||
for (Integer i: tasteIdList) {
|
||||
MenuDishesRelation menuDishesRelation = new MenuDishesRelation();
|
||||
menuDishesRelation.setKeyWordId(i);
|
||||
menuDishesRelation.setCrby(SecurityUtils.getUserId());
|
||||
menuDishesRelation.setDishesId(dishesId);
|
||||
menuDishesMapper.adddishesSeason(menuDishesRelation);
|
||||
}
|
||||
//适宜人群
|
||||
List<Integer> suitIdList = menuDishesDTO.getSuitIdList();
|
||||
for (Integer i: suitIdList) {
|
||||
MenuDishesRelation menuDishesRelation = new MenuDishesRelation();
|
||||
menuDishesRelation.setKeyWordId(i);
|
||||
menuDishesRelation.setCrby(SecurityUtils.getUserId());
|
||||
menuDishesRelation.setDishesId(dishesId);
|
||||
menuDishesMapper.adddishesSuit(menuDishesRelation);
|
||||
}
|
||||
//餐次
|
||||
List<Integer> mealList= menuDishesDTO.getMealList();
|
||||
for (Integer i: mealList) {
|
||||
MenuDishesRelation menuDishesRelation = new MenuDishesRelation();
|
||||
menuDishesRelation.setKeyWordId(i);
|
||||
menuDishesRelation.setCrby(SecurityUtils.getUserId());
|
||||
menuDishesRelation.setDishesId(dishesId);
|
||||
menuDishesMapper.adddishesMeal(menuDishesRelation);
|
||||
}
|
||||
|
||||
List<MenuDishesAddMaterialDTO> materialList= menuDishesDTO.getMaterialList();
|
||||
List<NutritionEntity> nutritionEntityList = new ArrayList<>();
|
||||
System.err.println("长度:"+materialList.size());
|
||||
for (MenuDishesAddMaterialDTO i: materialList) {
|
||||
NutritionEntity nutritionEntity = menuDishesMapper.getNutritionEntity(i);
|
||||
System.err.println(i.getMaterialId()+",开始值:"+nutritionEntity.getCalcium());
|
||||
nutritionEntity.setWeight(i.getWeight());
|
||||
nutritionEntity.setBaseWeight(100.0);
|
||||
nutritionEntityList.add(nutritionEntity);
|
||||
}
|
||||
NutritionEntityUtil nutritionEntityUtil = new NutritionEntityUtil();
|
||||
NutritionEntity nutritionEntity = nutritionEntityUtil.countNutrition(nutritionEntityList);
|
||||
|
||||
|
||||
System.err.println("最终值:"+nutritionEntity.getCalcium());
|
||||
return menuDishesMapper.addFinalNutrition(nutritionEntity);
|
||||
}
|
||||
|
||||
|
||||
private NutritionEntity countNum(NutritionEntity nutritionEntity,Double weight) {
|
||||
Field[] fields = nutritionEntity.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
Double value = (Double) field.get(nutritionEntity);
|
||||
if(value !=null){
|
||||
System.err.println("先前值----:"+value);
|
||||
double proportion = Arith.div(weight , 100);
|
||||
value = Arith.mul(value, proportion);
|
||||
field.set(nutritionEntity, value);
|
||||
System.err.println("后来值++++:"+value);
|
||||
}else{
|
||||
field.set(nutritionEntity, 0.00);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return nutritionEntity;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//首字母转小写
|
||||
public static String toLowerCaseFirstOne(String s)
|
||||
{
|
||||
if(Character.isLowerCase(s.charAt(0)))
|
||||
return s;
|
||||
else
|
||||
return (new StringBuilder()).append(Character.toLowerCase(s.charAt(0))).append(s.substring(1)).toString();
|
||||
}
|
||||
//首字母转大写
|
||||
public static String toUpperCaseFirstOne(String s) {
|
||||
if (Character.isUpperCase(s.charAt(0)))
|
||||
return s;
|
||||
else
|
||||
return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
|
|||
import com.bonus.canteen.core.menu.mapper.MenuMaterialCategoryMapper;
|
||||
import com.bonus.canteen.core.menu.domain.MenuMaterialCategory;
|
||||
import com.bonus.canteen.core.menu.service.IMenuMaterialCategoryService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +85,7 @@ public class MenuMaterialCategoryServiceImpl extends ServiceImpl<MenuMaterialCat
|
|||
.isNull(content.getAreaId() == null, MenuMaterialCategory::getAreaId)
|
||||
.eq(MenuMaterialCategory::getDelFlag, DelFlagEnum.DEL_FALSE.key()));
|
||||
if (ObjectUtil.isNotNull(count) && count > 0L) {
|
||||
throw new ServiceException(I18n.getMessage("menu_material_name_repeat", new Object[0]));
|
||||
throw new ServiceException(I18n.getMessage("添加物品已存在", new Object[0]));
|
||||
} else {
|
||||
Long parentId = content.getParentId();
|
||||
if (ObjectUtil.isNotNull(parentId) && parentId != -1L) {
|
||||
|
|
@ -116,7 +117,7 @@ public class MenuMaterialCategoryServiceImpl extends ServiceImpl<MenuMaterialCat
|
|||
//return menuMaterialCategoryMapper.insertMenuMaterialCategory(menuMaterialCategory);
|
||||
return num;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -235,9 +236,14 @@ public class MenuMaterialCategoryServiceImpl extends ServiceImpl<MenuMaterialCat
|
|||
@Override
|
||||
public int updateMenuMaterialCategory(MenuMaterialCategory menuMaterialCategory) {
|
||||
try {
|
||||
|
||||
MenuMaterialCategory one = menuMaterialCategoryMapper.getOne(menuMaterialCategory);
|
||||
if(one != null){
|
||||
throw new ServiceException(I18n.getMessage("修改物品已存在!", new Object[0]));
|
||||
}
|
||||
return menuMaterialCategoryMapper.updateMenuMaterialCategory(menuMaterialCategory);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
throw new ServiceException(""+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -248,8 +254,21 @@ public class MenuMaterialCategoryServiceImpl extends ServiceImpl<MenuMaterialCat
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMenuMaterialCategoryByIds(Long[] ids) {
|
||||
return menuMaterialCategoryMapper.deleteMenuMaterialCategoryByIds(ids);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteMenuMaterialCategoryByIds(String[] ids) {
|
||||
try{
|
||||
menuMaterialCategoryMapper.deleteMenuMaterialCategoryByIds(ids);
|
||||
List<String> childCategoryIds = menuMaterialCategoryMapper.getChildCategoryIds(ids);
|
||||
if(childCategoryIds !=null && childCategoryIds.size() > 0){
|
||||
String[] idss = childCategoryIds.toArray(new String[childCategoryIds.size()]); // 避免数组扩容
|
||||
//递归删除
|
||||
deleteMenuMaterialCategoryByIds(idss);
|
||||
}
|
||||
return 1;
|
||||
}catch (Exception e){
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@ public class MenuMaterialServiceImpl implements IMenuMaterialService {
|
|||
@Override
|
||||
public int insertMenuMaterial(MenuMaterial menuMaterial) {
|
||||
try {
|
||||
MenuMaterial one = menuMaterialMapper.getOne(menuMaterial);
|
||||
if(one !=null){
|
||||
throw new ServiceException("食材原料名称已存在");
|
||||
}
|
||||
menuMaterial.setMaterialId(Id.next());
|
||||
System.err.println("menuMaterial= " + menuMaterial.toString());
|
||||
int maxId = menuMaterialMapper.getLastId();
|
||||
|
|
@ -61,7 +65,7 @@ public class MenuMaterialServiceImpl implements IMenuMaterialService {
|
|||
return menuMaterialMapper.insertMenuMaterial(menuMaterial);
|
||||
} catch (Exception e) {
|
||||
System.err.println("menuMaterial= " + menuMaterial.toString());
|
||||
throw new ServiceException("错误信息描述");
|
||||
throw new ServiceException(""+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,9 +90,13 @@ public class MenuMaterialServiceImpl implements IMenuMaterialService {
|
|||
@Override
|
||||
public int updateMenuMaterial(MenuMaterial menuMaterial) {
|
||||
try {
|
||||
MenuMaterial one = menuMaterialMapper.getOne(menuMaterial);
|
||||
if(one !=null){
|
||||
throw new ServiceException("食材原料名称已存在");
|
||||
}
|
||||
return menuMaterialMapper.updateMenuMaterial(menuMaterial);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +107,7 @@ public class MenuMaterialServiceImpl implements IMenuMaterialService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMenuMaterialByIds(Long[] ids) {
|
||||
public int deleteMenuMaterialByIds(Integer[] ids) {
|
||||
return menuMaterialMapper.deleteMenuMaterialByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public class MenuNutritionServiceImpl implements IMenuNutritionService {
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMenuNutritionByIds(Long[] ids) {
|
||||
public int deleteMenuNutritionByIds(String[] ids) {
|
||||
return menuNutritionMapper.deleteMenuNutritionByIds(ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.bonus.canteen.core.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class Arith {
|
||||
private static final int DEF_DIV_SCALE = 10;
|
||||
|
||||
private Arith() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 加法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double add(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.add(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 减法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double sub(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.subtract(b2).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 乘法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double mul(double v1, double v2) {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.multiply(b2).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 除法
|
||||
* @param v1
|
||||
* @param v2
|
||||
* @return
|
||||
*/
|
||||
public static double div(double v1, double v2) {
|
||||
return div(v1, v2, 10);
|
||||
}
|
||||
|
||||
public static double div(double v1, double v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
} else {
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||
return b1.divide(b2, scale, 4).doubleValue();
|
||||
}
|
||||
}
|
||||
|
||||
public static double round(double v, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
} else {
|
||||
BigDecimal b = new BigDecimal(Double.toString(v));
|
||||
BigDecimal one = new BigDecimal("1");
|
||||
return b.divide(one, scale, 4).doubleValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,529 @@
|
|||
package com.bonus.canteen.core.utils;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NutritionEntity {
|
||||
private Double edible;
|
||||
private Double water;
|
||||
private Double calories;
|
||||
private Double protein;
|
||||
private Double fat;
|
||||
private Double carbohydrate;
|
||||
private Double dietaryFiber;
|
||||
private Double cholesterol;
|
||||
private Double ash;
|
||||
private Double vitaminA;
|
||||
private Double carotene;
|
||||
private Double retinol;
|
||||
private Double thiamine;
|
||||
private Double riboflavin;
|
||||
private Double niacin;
|
||||
private Double vitaminC;
|
||||
private Double vitaminE;
|
||||
private Double calcium;
|
||||
private Double phosphorus;
|
||||
private Double kalium;
|
||||
private Double sodium;
|
||||
private Double magnesium;
|
||||
private Double iron;
|
||||
private Double zinc;
|
||||
private Double selenium;
|
||||
private Double cuprum;
|
||||
private Double manganese;
|
||||
private Double isoleucine;
|
||||
private Double leucine;
|
||||
private Double lysine;
|
||||
private Double saaTotal;
|
||||
private Double aaaTotal;
|
||||
private Double threonine;
|
||||
private Double tryptophan;
|
||||
private Double valine;
|
||||
private Double arginine;
|
||||
private Double histidine;
|
||||
private Double alanine;
|
||||
private Double asparticAcid;
|
||||
private Double glutamate;
|
||||
private Double glycine;
|
||||
private Double proline;
|
||||
private Double serine;
|
||||
private Double fattyAcid;
|
||||
private Double iodine;
|
||||
private Double folic;
|
||||
private Double choline;
|
||||
private Double biotin;
|
||||
private Double pantothenicAcid;
|
||||
private Double guanine;
|
||||
private Double adenine;
|
||||
private Double hypoxanthine;
|
||||
private Double xanthine;
|
||||
private Double purine;
|
||||
private Double glycemicIndex;
|
||||
private Double weight;
|
||||
private Double totalWeight;
|
||||
private Double baseWeight;
|
||||
|
||||
public Double getEdible() {
|
||||
return this.edible;
|
||||
}
|
||||
|
||||
public Double getWater() {
|
||||
return this.water;
|
||||
}
|
||||
|
||||
public Double getCalories() {
|
||||
return this.calories;
|
||||
}
|
||||
|
||||
public Double getProtein() {
|
||||
return this.protein;
|
||||
}
|
||||
|
||||
public Double getFat() {
|
||||
return this.fat;
|
||||
}
|
||||
|
||||
public Double getCarbohydrate() {
|
||||
return this.carbohydrate;
|
||||
}
|
||||
|
||||
public Double getDietaryFiber() {
|
||||
return this.dietaryFiber;
|
||||
}
|
||||
|
||||
public Double getCholesterol() {
|
||||
return this.cholesterol;
|
||||
}
|
||||
|
||||
public Double getAsh() {
|
||||
return this.ash;
|
||||
}
|
||||
|
||||
public Double getVitaminA() {
|
||||
return this.vitaminA;
|
||||
}
|
||||
|
||||
public Double getCarotene() {
|
||||
return this.carotene;
|
||||
}
|
||||
|
||||
public Double getRetinol() {
|
||||
return this.retinol;
|
||||
}
|
||||
|
||||
public Double getThiamine() {
|
||||
return this.thiamine;
|
||||
}
|
||||
|
||||
public Double getRiboflavin() {
|
||||
return this.riboflavin;
|
||||
}
|
||||
|
||||
public Double getNiacin() {
|
||||
return this.niacin;
|
||||
}
|
||||
|
||||
public Double getVitaminC() {
|
||||
return this.vitaminC;
|
||||
}
|
||||
|
||||
public Double getVitaminE() {
|
||||
return this.vitaminE;
|
||||
}
|
||||
|
||||
public Double getCalcium() {
|
||||
return this.calcium;
|
||||
}
|
||||
|
||||
public Double getPhosphorus() {
|
||||
return this.phosphorus;
|
||||
}
|
||||
|
||||
public Double getKalium() {
|
||||
return this.kalium;
|
||||
}
|
||||
|
||||
public Double getSodium() {
|
||||
return this.sodium;
|
||||
}
|
||||
|
||||
public Double getMagnesium() {
|
||||
return this.magnesium;
|
||||
}
|
||||
|
||||
public Double getIron() {
|
||||
return this.iron;
|
||||
}
|
||||
|
||||
public Double getZinc() {
|
||||
return this.zinc;
|
||||
}
|
||||
|
||||
public Double getSelenium() {
|
||||
return this.selenium;
|
||||
}
|
||||
|
||||
public Double getCuprum() {
|
||||
return this.cuprum;
|
||||
}
|
||||
|
||||
public Double getManganese() {
|
||||
return this.manganese;
|
||||
}
|
||||
|
||||
public Double getIsoleucine() {
|
||||
return this.isoleucine;
|
||||
}
|
||||
|
||||
public Double getLeucine() {
|
||||
return this.leucine;
|
||||
}
|
||||
|
||||
public Double getLysine() {
|
||||
return this.lysine;
|
||||
}
|
||||
|
||||
public Double getSaaTotal() {
|
||||
return this.saaTotal;
|
||||
}
|
||||
|
||||
public Double getAaaTotal() {
|
||||
return this.aaaTotal;
|
||||
}
|
||||
|
||||
public Double getThreonine() {
|
||||
return this.threonine;
|
||||
}
|
||||
|
||||
public Double getTryptophan() {
|
||||
return this.tryptophan;
|
||||
}
|
||||
|
||||
public Double getValine() {
|
||||
return this.valine;
|
||||
}
|
||||
|
||||
public Double getArginine() {
|
||||
return this.arginine;
|
||||
}
|
||||
|
||||
public Double getHistidine() {
|
||||
return this.histidine;
|
||||
}
|
||||
|
||||
public Double getAlanine() {
|
||||
return this.alanine;
|
||||
}
|
||||
|
||||
public Double getAsparticAcid() {
|
||||
return this.asparticAcid;
|
||||
}
|
||||
|
||||
public Double getGlutamate() {
|
||||
return this.glutamate;
|
||||
}
|
||||
|
||||
public Double getGlycine() {
|
||||
return this.glycine;
|
||||
}
|
||||
|
||||
public Double getProline() {
|
||||
return this.proline;
|
||||
}
|
||||
|
||||
public Double getSerine() {
|
||||
return this.serine;
|
||||
}
|
||||
|
||||
public Double getFattyAcid() {
|
||||
return this.fattyAcid;
|
||||
}
|
||||
|
||||
public Double getIodine() {
|
||||
return this.iodine;
|
||||
}
|
||||
|
||||
public Double getFolic() {
|
||||
return this.folic;
|
||||
}
|
||||
|
||||
public Double getCholine() {
|
||||
return this.choline;
|
||||
}
|
||||
|
||||
public Double getBiotin() {
|
||||
return this.biotin;
|
||||
}
|
||||
|
||||
public Double getPantothenicAcid() {
|
||||
return this.pantothenicAcid;
|
||||
}
|
||||
|
||||
public Double getGuanine() {
|
||||
return this.guanine;
|
||||
}
|
||||
|
||||
public Double getAdenine() {
|
||||
return this.adenine;
|
||||
}
|
||||
|
||||
public Double getHypoxanthine() {
|
||||
return this.hypoxanthine;
|
||||
}
|
||||
|
||||
public Double getXanthine() {
|
||||
return this.xanthine;
|
||||
}
|
||||
|
||||
public Double getPurine() {
|
||||
return this.purine;
|
||||
}
|
||||
|
||||
public Double getGlycemicIndex() {
|
||||
return this.glycemicIndex;
|
||||
}
|
||||
|
||||
public Double getWeight() {
|
||||
return this.weight;
|
||||
}
|
||||
|
||||
public Double getTotalWeight() {
|
||||
return this.totalWeight;
|
||||
}
|
||||
|
||||
public Double getBaseWeight() {
|
||||
return this.baseWeight;
|
||||
}
|
||||
|
||||
public void setEdible(final Double edible) {
|
||||
this.edible = edible;
|
||||
}
|
||||
|
||||
public void setWater(final Double water) {
|
||||
this.water = water;
|
||||
}
|
||||
|
||||
public void setCalories(final Double calories) {
|
||||
this.calories = calories;
|
||||
}
|
||||
|
||||
public void setProtein(final Double protein) {
|
||||
this.protein = protein;
|
||||
}
|
||||
|
||||
public void setFat(final Double fat) {
|
||||
this.fat = fat;
|
||||
}
|
||||
|
||||
public void setCarbohydrate(final Double carbohydrate) {
|
||||
this.carbohydrate = carbohydrate;
|
||||
}
|
||||
|
||||
public void setDietaryFiber(final Double dietaryFiber) {
|
||||
this.dietaryFiber = dietaryFiber;
|
||||
}
|
||||
|
||||
public void setCholesterol(final Double cholesterol) {
|
||||
this.cholesterol = cholesterol;
|
||||
}
|
||||
|
||||
public void setAsh(final Double ash) {
|
||||
this.ash = ash;
|
||||
}
|
||||
|
||||
public void setVitaminA(final Double vitaminA) {
|
||||
this.vitaminA = vitaminA;
|
||||
}
|
||||
|
||||
public void setCarotene(final Double carotene) {
|
||||
this.carotene = carotene;
|
||||
}
|
||||
|
||||
public void setRetinol(final Double retinol) {
|
||||
this.retinol = retinol;
|
||||
}
|
||||
|
||||
public void setThiamine(final Double thiamine) {
|
||||
this.thiamine = thiamine;
|
||||
}
|
||||
|
||||
public void setRiboflavin(final Double riboflavin) {
|
||||
this.riboflavin = riboflavin;
|
||||
}
|
||||
|
||||
public void setNiacin(final Double niacin) {
|
||||
this.niacin = niacin;
|
||||
}
|
||||
|
||||
public void setVitaminC(final Double vitaminC) {
|
||||
this.vitaminC = vitaminC;
|
||||
}
|
||||
|
||||
public void setVitaminE(final Double vitaminE) {
|
||||
this.vitaminE = vitaminE;
|
||||
}
|
||||
|
||||
public void setCalcium(final Double calcium) {
|
||||
this.calcium = calcium;
|
||||
}
|
||||
|
||||
public void setPhosphorus(final Double phosphorus) {
|
||||
this.phosphorus = phosphorus;
|
||||
}
|
||||
|
||||
public void setKalium(final Double kalium) {
|
||||
this.kalium = kalium;
|
||||
}
|
||||
|
||||
public void setSodium(final Double sodium) {
|
||||
this.sodium = sodium;
|
||||
}
|
||||
|
||||
public void setMagnesium(final Double magnesium) {
|
||||
this.magnesium = magnesium;
|
||||
}
|
||||
|
||||
public void setIron(final Double iron) {
|
||||
this.iron = iron;
|
||||
}
|
||||
|
||||
public void setZinc(final Double zinc) {
|
||||
this.zinc = zinc;
|
||||
}
|
||||
|
||||
public void setSelenium(final Double selenium) {
|
||||
this.selenium = selenium;
|
||||
}
|
||||
|
||||
public void setCuprum(final Double cuprum) {
|
||||
this.cuprum = cuprum;
|
||||
}
|
||||
|
||||
public void setManganese(final Double manganese) {
|
||||
this.manganese = manganese;
|
||||
}
|
||||
|
||||
public void setIsoleucine(final Double isoleucine) {
|
||||
this.isoleucine = isoleucine;
|
||||
}
|
||||
|
||||
public void setLeucine(final Double leucine) {
|
||||
this.leucine = leucine;
|
||||
}
|
||||
|
||||
public void setLysine(final Double lysine) {
|
||||
this.lysine = lysine;
|
||||
}
|
||||
|
||||
public void setSaaTotal(final Double saaTotal) {
|
||||
this.saaTotal = saaTotal;
|
||||
}
|
||||
|
||||
public void setAaaTotal(final Double aaaTotal) {
|
||||
this.aaaTotal = aaaTotal;
|
||||
}
|
||||
|
||||
public void setThreonine(final Double threonine) {
|
||||
this.threonine = threonine;
|
||||
}
|
||||
|
||||
public void setTryptophan(final Double tryptophan) {
|
||||
this.tryptophan = tryptophan;
|
||||
}
|
||||
|
||||
public void setValine(final Double valine) {
|
||||
this.valine = valine;
|
||||
}
|
||||
|
||||
public void setArginine(final Double arginine) {
|
||||
this.arginine = arginine;
|
||||
}
|
||||
|
||||
public void setHistidine(final Double histidine) {
|
||||
this.histidine = histidine;
|
||||
}
|
||||
|
||||
public void setAlanine(final Double alanine) {
|
||||
this.alanine = alanine;
|
||||
}
|
||||
|
||||
public void setAsparticAcid(final Double asparticAcid) {
|
||||
this.asparticAcid = asparticAcid;
|
||||
}
|
||||
|
||||
public void setGlutamate(final Double glutamate) {
|
||||
this.glutamate = glutamate;
|
||||
}
|
||||
|
||||
public void setGlycine(final Double glycine) {
|
||||
this.glycine = glycine;
|
||||
}
|
||||
|
||||
public void setProline(final Double proline) {
|
||||
this.proline = proline;
|
||||
}
|
||||
|
||||
public void setSerine(final Double serine) {
|
||||
this.serine = serine;
|
||||
}
|
||||
|
||||
public void setFattyAcid(final Double fattyAcid) {
|
||||
this.fattyAcid = fattyAcid;
|
||||
}
|
||||
|
||||
public void setIodine(final Double iodine) {
|
||||
this.iodine = iodine;
|
||||
}
|
||||
|
||||
public void setFolic(final Double folic) {
|
||||
this.folic = folic;
|
||||
}
|
||||
|
||||
public void setCholine(final Double choline) {
|
||||
this.choline = choline;
|
||||
}
|
||||
|
||||
public void setBiotin(final Double biotin) {
|
||||
this.biotin = biotin;
|
||||
}
|
||||
|
||||
public void setPantothenicAcid(final Double pantothenicAcid) {
|
||||
this.pantothenicAcid = pantothenicAcid;
|
||||
}
|
||||
|
||||
public void setGuanine(final Double guanine) {
|
||||
this.guanine = guanine;
|
||||
}
|
||||
|
||||
public void setAdenine(final Double adenine) {
|
||||
this.adenine = adenine;
|
||||
}
|
||||
|
||||
public void setHypoxanthine(final Double hypoxanthine) {
|
||||
this.hypoxanthine = hypoxanthine;
|
||||
}
|
||||
|
||||
public void setXanthine(final Double xanthine) {
|
||||
this.xanthine = xanthine;
|
||||
}
|
||||
|
||||
public void setPurine(final Double purine) {
|
||||
this.purine = purine;
|
||||
}
|
||||
|
||||
public void setGlycemicIndex(final Double glycemicIndex) {
|
||||
this.glycemicIndex = glycemicIndex;
|
||||
}
|
||||
|
||||
public void setWeight(final Double weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public void setTotalWeight(final Double totalWeight) {
|
||||
this.totalWeight = totalWeight;
|
||||
}
|
||||
|
||||
public void setBaseWeight(final Double baseWeight) {
|
||||
this.baseWeight = baseWeight;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.bonus.canteen.core.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.bonus.common.houqin.utils.Arith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class NutritionEntityUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(NutritionEntityUtil.class);
|
||||
|
||||
public NutritionEntityUtil() {
|
||||
}
|
||||
|
||||
public static NutritionEntity countNutrition(List<NutritionEntity> nutritionEntityList) {
|
||||
if (CollectionUtils.isEmpty(nutritionEntityList)) {
|
||||
return new NutritionEntity();
|
||||
} else {
|
||||
NutritionEntity nutritionEntity = new NutritionEntity();
|
||||
Iterator var2 = nutritionEntityList.iterator();
|
||||
|
||||
while(var2.hasNext()) {
|
||||
NutritionEntity tempNutrition = (NutritionEntity)var2.next();
|
||||
double proportion = Arith.div(tempNutrition.getWeight(), tempNutrition.getBaseWeight(), 4);
|
||||
Field[] var6 = tempNutrition.getClass().getDeclaredFields();
|
||||
int var7 = var6.length;
|
||||
|
||||
for(int var8 = 0; var8 < var7; ++var8) {
|
||||
Field field = var6[var8];
|
||||
ReflectionUtils.makeAccessible(field);
|
||||
|
||||
try {
|
||||
String fieldName = field.getName();
|
||||
Object temp = field.get(tempNutrition);
|
||||
double param = 0.0;
|
||||
if (temp != null && (Double)temp != -1.0) {
|
||||
param = (Double)temp;
|
||||
}
|
||||
|
||||
Field declaredField = nutritionEntity.getClass().getDeclaredField(fieldName);
|
||||
ReflectionUtils.makeAccessible(declaredField);
|
||||
Object tempObject = declaredField.get(nutritionEntity);
|
||||
double lastValue = 0.0;
|
||||
if (tempObject != null) {
|
||||
lastValue = (Double)tempObject;
|
||||
}
|
||||
|
||||
double newValue = Arith.add(Arith.mul(param, proportion), lastValue);
|
||||
// System.err.println(fieldName+",newValue:"+newValue+" ,lastValue="+lastValue);
|
||||
declaredField.set(nutritionEntity, newValue);
|
||||
} catch (NoSuchFieldException | IllegalAccessException var21) {
|
||||
log.info("获取属性值异常 : {}", var21.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Field[] var22 = nutritionEntity.getClass().getDeclaredFields();
|
||||
int var23 = var22.length;
|
||||
|
||||
for(int var24 = 0; var24 < var23; ++var24) {
|
||||
Field field = var22[var24];
|
||||
ReflectionUtils.makeAccessible(field);
|
||||
|
||||
try {
|
||||
Object tempObject = field.get(nutritionEntity);
|
||||
if (tempObject != null && (Double)tempObject != -1.0) {
|
||||
field.set(nutritionEntity, Arith.round((Double)tempObject, 2));
|
||||
}
|
||||
} catch (Exception var20) {
|
||||
log.info("最终获取属性值异常 : {}", var20.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return nutritionEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectMenuDishesList" parameterType="com.bonus.canteen.core.menu.domain.MenuDishes" resultMap="MenuDishesResult">
|
||||
<include refid="selectMenuDishesVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="dishesId != null "> and dishes_id = #{dishesId}</if>
|
||||
<if test="baseDishesId != null "> and base_dishes_id = #{baseDishesId}</if>
|
||||
<if test="mealType != null "> and meal_type = #{mealType}</if>
|
||||
|
|
@ -159,12 +159,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="revision != null "> and revision = #{revision}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectMenuDishesById" parameterType="Long" resultMap="MenuDishesResult">
|
||||
<include refid="selectMenuDishesVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertMenuDishes" parameterType="com.bonus.canteen.core.menu.domain.MenuDishes" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into menu_dishes
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -407,9 +407,166 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteMenuDishesByIds" parameterType="String">
|
||||
delete from menu_dishes where id in
|
||||
delete from menu_dishes where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
<select id="getDishesType" resultType="com.bonus.canteen.core.menu.domain.MapBean" parameterType="com.bonus.canteen.core.menu.domain.MapBean">
|
||||
select dict_label as `key`,dict_value as `value` from sys_dict_data where is_default ='Y' and dict_type = #{key} order by dict_sort
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getOne" parameterType="com.bonus.canteen.core.menu.dto.MenuDishesDTO" resultMap="MenuDishesResult">
|
||||
select * from menu_dishes where area_id = #{areaId} and (
|
||||
dishes_num =#{dishesNum} or
|
||||
dishes_name = #{dishesName}
|
||||
) limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addMenuDishesBase" parameterType="com.bonus.canteen.core.menu.dto.MenuDishesDTO">
|
||||
insert into menu_dishes_base
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="baseDishesId != null">base_dishes_id,</if>
|
||||
<if test="dishesName != null">dishes_name,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test=" baseDishesId!= null">#{baseDishesId},</if>
|
||||
<if test=" dishesName!= null">#{dishesName},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="addMenuDishes" parameterType="com.bonus.canteen.core.menu.dto.MenuDishesDTO">
|
||||
insert into menu_dishes
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="baseDishesId != null">base_dishes_id,</if>
|
||||
<if test="sizeType != null">size_type,</if>
|
||||
<if test="materialCost != null">material_cost,</if>
|
||||
<if test="publicDishes != null">public_dishes,</if>
|
||||
<if test="areaId != null">area_id,</if>
|
||||
<if test="canteenId != null">canteen_id,</if>
|
||||
<if test="shopstallId != null">shopstall_id,</if>
|
||||
<if test="dishesNum != null">dishes_num,</if>
|
||||
<if test="dishesName != null">dishes_name,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="weightDeviation != null">weight_deviation,</if>
|
||||
<if test="imageUrl != null">image_url,</if>
|
||||
<if test="effectId != null">effect_id,</if>
|
||||
<if test="styleId != null">style_id,</if>
|
||||
<if test="cookId != null">cook_id,</if>
|
||||
<if test="classifyId != null">classify_id,</if>
|
||||
<if test="crby != null">create_by,</if>
|
||||
<if test="customId != null">custom_id,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="baseDishesId != null">#{baseDishesId},</if>
|
||||
<if test="sizeType != null">#{sizeType},</if>
|
||||
<if test="materialCost != null">#{materialCost},</if>
|
||||
<if test="publicDishes != null">#{publicDishes},</if>
|
||||
<if test="areaId != null">#{areaId},</if>
|
||||
<if test="canteenId != null">#{canteenId},</if>
|
||||
<if test="shopstallId != null">#{shopstallId},</if>
|
||||
<if test="dishesNum != null">#{dishesNum},</if>
|
||||
<if test="dishesName != null">#{dishesName},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="weightDeviation != null">#{weightDeviation},</if>
|
||||
<if test="imageUrl != null">#{imageUrl},</if>
|
||||
<if test="effectId != null">#{effectId}},</if>
|
||||
<if test="styleId != null">#{styleId},</if>
|
||||
<if test="cookId != null">#{cookId},</if>
|
||||
<if test="classifyId != null">#{classifyId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
<if test="customId != null">#{customId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="adddishesLabel" parameterType="com.bonus.canteen.core.menu.domain.MenuDishesRelation">
|
||||
insert into menu_dishes_label_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">label_id,</if>
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">#{keyWordId},</if>
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="adddishesTaste" parameterType="com.bonus.canteen.core.menu.domain.MenuDishesRelation">
|
||||
insert into menu_dishes_taste_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">taste_id,</if>
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">#{keyWordId},</if>
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="adddishesSeason" parameterType="com.bonus.canteen.core.menu.domain.MenuDishesRelation">
|
||||
insert into menu_dishes_season_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">season_id,</if>
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">#{keyWordId},</if>
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="adddishesSuit" parameterType="com.bonus.canteen.core.menu.domain.MenuDishesRelation">
|
||||
insert into menu_dishes_suit_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">suit_id,</if>
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">#{keyWordId},</if>
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="adddishesMeal" parameterType="com.bonus.canteen.core.menu.domain.MenuDishesRelation">
|
||||
insert into menu_dishes_meal_relation
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">meal_id,</if>
|
||||
<if test="dishesId != null">dishes_id,</if>
|
||||
<if test="crby != null">crby,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="keyWordId != null">#{keyWordId},</if>
|
||||
<if test="dishesId != null">#{dishesId},</if>
|
||||
<if test="crby != null">#{crby},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<select id="getNutritionEntity" resultType="com.bonus.canteen.core.utils.NutritionEntity" parameterType="com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO">
|
||||
select calories,fat,protein,carbohydrate,dietary_fiber as dietaryFiber,
|
||||
cholesterol,calcium,sodium,purine,iron,
|
||||
iodine,kalium,vitamin_a as vitaminA,vitamin_c as vitaminC,vitamin_e as vitaminE,
|
||||
magnesium,zinc,glycemic_index as glycemicIndex
|
||||
from menu_nutrition where nutrition_id = #{materialId}
|
||||
</select>
|
||||
|
||||
<select id="addFinalNutrition" resultType="int"></select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="selectMenuMaterialCategoryById" parameterType="Long" resultMap="MenuMaterialCategoryResult">
|
||||
<include refid="selectMenuMaterialCategoryVo"/>
|
||||
where id = #{id}
|
||||
where category_id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMenuMaterialCategory" parameterType="com.bonus.canteen.core.menu.domain.MenuMaterialCategory" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="categoryId != null">category_id = #{categoryId},</if>
|
||||
<if test="categoryNum != null">category_num = #{categoryNum},</if>
|
||||
<if test="categoryName != null and categoryName != ''">category_name = #{categoryName},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<!-- <if test="parentId != null">parent_id = #{parentId},</if>-->
|
||||
<if test="categoryType != null">category_type = #{categoryType},</if>
|
||||
<if test="revision != null">revision = #{revision},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
|
|
@ -99,23 +99,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
where category_id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMenuMaterialCategoryById" parameterType="Long">
|
||||
<update id="deleteMenuMaterialCategoryById" parameterType="Long">
|
||||
delete from menu_material_category where id = #{id}
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<delete id="deleteMenuMaterialCategoryByIds" parameterType="String">
|
||||
delete from menu_material_category where id in
|
||||
<update id="deleteMenuMaterialCategoryByIds" parameterType="java.lang.String">
|
||||
update menu_material_category set del_flag =1 where category_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<select id="getChildCategoryIds" resultType="java.lang.String">
|
||||
select category_id from menu_material_category where parent_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectCategoryTrees" resultType="com.bonus.canteen.core.menu.vo.MenuCategoryTreeVO">
|
||||
select category_id as id, parent_id as parentId, category_name as categoryName,category_type as categoryType,area_id as areaId from menu_material_category
|
||||
</select>
|
||||
<where>
|
||||
<if test="categoryType != null"> and category_type = #{categoryType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getTenantAreaIdList" resultType="java.lang.Long">
|
||||
SELECT r.area_id
|
||||
|
|
@ -126,4 +136,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND o.role_key = #{authPO.roleCode}
|
||||
AND o.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="getOne" resultMap="MenuMaterialCategoryResult">
|
||||
select * from menu_material_category where parent_id =#{parentId} and category_name =#{categoryName} and category_type =#{categoryType} and area_id =#{areaId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -203,4 +203,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getLastId" resultType="int">
|
||||
select max(id) from menu_material
|
||||
</select>
|
||||
|
||||
<select id="getOne" resultMap="MenuMaterialResult" parameterType="com.bonus.canteen.core.menu.domain.MenuMaterial">
|
||||
select * from menu_material where material_name = #{materialName} and area_id = #{areaId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -457,12 +457,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from menu_nutrition where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMenuNutritionByIds" parameterType="String">
|
||||
delete from menu_nutrition where id in
|
||||
<update id="deleteMenuNutritionByIds" parameterType="String">
|
||||
update menu_nutrition set del_flag = '1' where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<select id="getOne" resultMap="MenuNutritionResult" parameterType="com.bonus.canteen.core.menu.dto.MenuNutritionDTO">
|
||||
select *
|
||||
|
|
|
|||
Loading…
Reference in New Issue