Compare commits
2 Commits
8d6d145dff
...
06a083c91a
| Author | SHA1 | Date |
|---|---|---|
|
|
06a083c91a | |
|
|
0fa9bb8baa |
|
|
@ -32,6 +32,7 @@ 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;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 菜品计划信息Controller
|
||||
|
|
@ -179,4 +180,14 @@ public class MenuRecipeController extends BaseController {
|
|||
return this.menuRecipeService.intervalConfig(HeaderFetchUtil.getMachineSn(headers));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping({"/import/check"})
|
||||
@ApiOperation("导入之前检查数据是否可以导入")
|
||||
public AjaxResult importDishesCheck(@RequestParam("file") MultipartFile excel) {
|
||||
return AjaxResult.success(this.menuRecipeService.importDishesCheck(excel));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.canteen.core.menu.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DishesImportCheckResult {
|
||||
// private List<MenuDishesImportDTO> successList;
|
||||
// private List<MenuDishesImportDTO> errorList;
|
||||
//
|
||||
// public List<MenuDishesImportDTO> getSuccessList() {
|
||||
// return this.successList;
|
||||
// }
|
||||
//
|
||||
// public List<MenuDishesImportDTO> getErrorList() {
|
||||
// return this.errorList;
|
||||
// }
|
||||
//
|
||||
// public void setSuccessList(final List<MenuDishesImportDTO> successList) {
|
||||
// this.successList = successList;
|
||||
// }
|
||||
//
|
||||
// public void setErrorList(final List<MenuDishesImportDTO> errorList) {
|
||||
// this.errorList = errorList;
|
||||
// }
|
||||
}
|
||||
|
|
@ -18,7 +18,18 @@ public class MenuDishesAddMaterialDTO {
|
|||
message = "{menu_material_type_null}"
|
||||
) Integer materialType;
|
||||
|
||||
public Long getMaterialId() {
|
||||
@ApiModelProperty("食材名称")
|
||||
private String materialName;
|
||||
|
||||
public String getMaterialName() {
|
||||
return materialName;
|
||||
}
|
||||
|
||||
public void setMaterialName(String materialName) {
|
||||
this.materialName = materialName;
|
||||
}
|
||||
|
||||
public Long getMaterialId() {
|
||||
return this.materialId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.bonus.canteen.core.menu.dto.MenuRecipeAddDTO;
|
|||
import com.bonus.canteen.core.menu.dto.MenuRecipeParamDTO;
|
||||
import com.bonus.canteen.core.menu.dto.MenuTypeDishesDTO;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
|
|
@ -105,4 +106,6 @@ public interface IMenuRecipeService extends IService<MenuRecipe> {
|
|||
DviceTimeIntervalVO intervalConfig(String machineSn);
|
||||
|
||||
List<AllocRecipeStallVO> selectMenuRecipeListV2(AllocRecipeStallDTO dto);
|
||||
|
||||
DishesImportCheckResult importDishesCheck(MultipartFile excel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ public class MenuDishesServiceImpl implements IMenuDishesService {
|
|||
return menuDishesMapper.addFinalNutrition(nutritionEntity,Long.parseLong(menuDishesDTO.getDishesId()));
|
||||
}
|
||||
|
||||
|
||||
//添加菜品和材料关系表
|
||||
menuDishesMapper.addMenuMaterialDishes(Long.parseLong(menuDishesDTO.getDishesId()),materialList);
|
||||
return menuDishesMapper.editMenuDishes(menuDishesDTO);
|
||||
// } catch (Exception e) {
|
||||
// throw new ServiceException(e.toString());
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ import org.springframework.core.task.AsyncTaskExecutor;
|
|||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.menu.mapper.MenuRecipeMapper;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
@ -186,6 +187,11 @@ public class MenuRecipeServiceImpl extends ServiceImpl<MenuRecipeMapper, MenuRec
|
|||
return records;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DishesImportCheckResult importDishesCheck(MultipartFile excel) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindAppRecipe(MenuRecipeBindDTO content) {
|
||||
MenuRecipe menuRecipe = this.menuRecipeMapper.selectMenuRecipe(content.getRecipeId());
|
||||
|
|
|
|||
|
|
@ -529,8 +529,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<insert id="addMenuMaterialDishes" parameterType="java.util.List">
|
||||
delete from menu_material_dishes where dishes_id = #{dishesId};
|
||||
insert into menu_material_dishes(dishes_id,material_id,weight,material_type)
|
||||
|
||||
values
|
||||
<foreach collection="materialList" item="item" separator=",">
|
||||
(#{dishesId}, #{item.materialId}, #{item.weight}, #{item.materialType})
|
||||
|
|
@ -538,7 +538,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<select id="getMenuMaterialDishes" resultType="com.bonus.canteen.core.menu.dto.MenuDishesAddMaterialDTO">
|
||||
select material_id as materialId,weight,material_type as materialType from menu_material_dishes where dishes_id = #{dishesId}
|
||||
select mmd.material_id as materialId,mmd.weight,mmd.material_type as materialType,mm.material_name as materialName
|
||||
from menu_material_dishes mmd
|
||||
LEFT JOIN menu_material mm on mm.material_id = mmd.material_id
|
||||
where mmd.dishes_id = #{dishesId}
|
||||
</select>
|
||||
|
||||
<select id="getDishMessageByDishesId" resultType="com.bonus.canteen.core.menu.domain.MenuDishes">
|
||||
|
|
|
|||
|
|
@ -714,13 +714,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from device_recipe
|
||||
where device_id = (select device_id from device_info where device_sn = #{machineSn} limit 1) limit 1
|
||||
</select>
|
||||
<select id="selectMenuRecipeDetailList" resultType="com.bonus.canteen.core.menu.vo.MenuAndroidRecipeDetailVO">
|
||||
select
|
||||
detail_id as detailId,
|
||||
mealtime_type as mealTimeType,
|
||||
apply_date as applyData
|
||||
from menu_recipe_detail where recipe_id = #{recipeId} and apply_date >= Date(NOW())
|
||||
</select>
|
||||
<!-- <select id="selectMenuRecipeDetailList" resultType="com.bonus.canteen.core.menu.vo.MenuAndroidRecipeDetailVO">-->
|
||||
<!-- select-->
|
||||
<!-- detail_id as detailId,-->
|
||||
<!-- mealtime_type as mealTimeType,-->
|
||||
<!-- apply_date as applyData-->
|
||||
<!-- from menu_recipe_detail where recipe_id = #{recipeId} and apply_date >= Date(NOW())-->
|
||||
<!-- </select>-->
|
||||
<select id="selectRecipeDishList" resultType="com.bonus.canteen.core.menu.vo.IssueRecipeDetailCompressVO">
|
||||
select
|
||||
detail_id as detailId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue