diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccCardHisController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccCardHisController.java index 38af3de..644e91c 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccCardHisController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/account/controller/AccCardHisController.java @@ -26,7 +26,7 @@ import com.bonus.common.core.web.page.TableDataInfo; /** * 人员换卡历史记录Controller - * + * * @author xsheng * @date 2025-04-23 */ @@ -85,7 +85,7 @@ public class AccCardHisController extends BaseController { try { return toAjax(accCardHisService.insertAccCardHis(accCardHis)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/AppletRecipeH5Controller.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/AppletRecipeH5Controller.java index 00cbcef..ae7c589 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/AppletRecipeH5Controller.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/AppletRecipeH5Controller.java @@ -53,7 +53,7 @@ public class AppletRecipeH5Controller extends BaseController { startPage(); return getDataTable(this.appletRecipeH5Service.getWeekRecipeDetailList(content)); } catch (Exception e) { - return getDataTable(null); + throw new RuntimeException(e.toString()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuDishesController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuDishesController.java index 13f8987..054e4d4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuDishesController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuDishesController.java @@ -91,7 +91,7 @@ public class MenuDishesController extends BaseController { try { return toAjax(menuDishesService.insertMenuDishes(menuDishes)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } //MenuDishesDTO @@ -105,7 +105,7 @@ public class MenuDishesController extends BaseController { try { return toAjax(menuDishesService.addMenuDishes(menuDishesDTO)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuMaterialController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuMaterialController.java index 9222ee7..0e4e6bb 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuMaterialController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuMaterialController.java @@ -83,7 +83,7 @@ public class MenuMaterialController extends BaseController { try { return toAjax(menuMaterialService.insertMenuMaterial(menuMaterial)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } @@ -101,7 +101,7 @@ public class MenuMaterialController extends BaseController { try { return toAjax(menuMaterialService.updateMenuMaterial(menuMaterial)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error( e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionTypeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionTypeController.java index f39b860..40e69c3 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionTypeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuNutritionTypeController.java @@ -84,7 +84,7 @@ public class MenuNutritionTypeController extends BaseController { try { return toAjax(menuNutritionTypeService.insertMenuNutritionType(menuNutritionType)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } @@ -100,7 +100,7 @@ public class MenuNutritionTypeController extends BaseController { try { return toAjax(menuNutritionTypeService.updateMenuNutritionType(menuNutritionType)); } catch (Exception e) { - return error("系统错误, " + e.getMessage()); + return error(e.getMessage()); } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuRecipeController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuRecipeController.java index cc140b3..12f45ff 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuRecipeController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/controller/MenuRecipeController.java @@ -26,6 +26,7 @@ import com.bonus.common.security.annotation.Logical; import com.bonus.common.security.annotation.RequiresPermissions; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import net.bytebuddy.implementation.bytecode.Throw; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -188,8 +189,12 @@ public class MenuRecipeController extends BaseController { @ApiOperation("批量导入菜谱中的菜品信息") @Transactional public AjaxResult recipeImportDishes(@RequestParam("file") MultipartFile excel, @RequestParam("recipeId") Long recipeId) { - return ObjectUtil.isNull(excel) ? AjaxResult.error("请选择导入文件 ^_^") : - AjaxResult.success(this.menuRecipeService.recipeImportDishes(excel, recipeId)); + try{ + return ObjectUtil.isNull(excel) ? AjaxResult.error("请选择导入文件 ^_^") : + AjaxResult.success(this.menuRecipeService.recipeImportDishes(excel, recipeId)); + }catch (Exception e){ + throw new ServiceException(e.toString()); + } } @PostMapping({"/generateRecipe"}) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java index ba9464f..9d0b8f8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/mapper/MenuDishesMapper.java @@ -96,4 +96,5 @@ public interface MenuDishesMapper extends BaseMapper { MenuDishes getDishMessageByDishesId(String dishesId); List getDishesType(MapBean mapBean); + List getDishesTypeByList(@Param("key")String key,@Param("keyList")List keyList); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/AppletRecipeH5ServiceImpl.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/AppletRecipeH5ServiceImpl.java index d06c222..39ac162 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/AppletRecipeH5ServiceImpl.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/service/impl/AppletRecipeH5ServiceImpl.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bonus.canteen.core.android.vo.UserInfoVo; +import com.bonus.canteen.core.menu.domain.MapBean; import com.bonus.canteen.core.menu.domain.MenuRecipe; import com.bonus.canteen.core.menu.domain.MenuRecipeDetail; import com.bonus.canteen.core.menu.domain.MenuRecipeDishes; @@ -31,6 +32,7 @@ import com.bonus.common.houqin.utils.id.Id; import com.bonus.common.security.utils.SecurityUtils; import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import org.hibernate.validator.internal.util.StringHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -60,6 +62,9 @@ public class AppletRecipeH5ServiceImpl extends ServiceImpl getWeekMealList(AppletWeekCanteenDTO content) { //人员范围 暂时不用 @@ -123,7 +128,19 @@ public class AppletRecipeH5ServiceImpl extends ServiceImpl0){ + String tasteIds = appletDishesDetailVO.getDishesDetailList().get(0).getTasteIds(); + if(!StringHelper.isNullOrEmptyString(tasteIds)){ + List list = Arrays.asList(tasteIds.split(",")); + List mapBean = menuDishesMapper.getDishesTypeByList("dishes_taste",list); + System.err.println("mapBean="+mapBean); + String result = mapBean.stream() + .map(MapBean::getKey) // 提取每个 MapBean 的 key + .collect(Collectors.joining(",")); // 用逗号连 + appletDishesDetailVO.getDishesDetailList().get(0).setTasteIds(result); + } + // return menuDishesMapper.getDishesType(mapBean); + } Long dishesId = ((AppletDishesSizeV2VO) appletDishesDetailVO.getDishesDetailList().get(0)).getDishesId(); List materialList; if (appletDishesDetailVO.getMealType() == 1) { @@ -150,6 +167,7 @@ public class AppletRecipeH5ServiceImpl extends ServiceImpl getWeekRecipeDetailList(AppletWeekRecipeDTO content) { + try{ List recipeIdList = Lists.newArrayList(); Set effIdSet = this.getShopstallIdListByCustId(content.getCustId(), false); if (ObjectUtil.isNull(content.getRecipeId())) { @@ -208,6 +226,10 @@ public class AppletRecipeH5ServiceImpl extends ServiceImpl recipeImportDishes(MultipartFile excel, Long recipeId) { ExcelReader excelReader = null; + try { Set notImportDishesNames = new HashSet(); List listeners = new ArrayList(); - try { + excelReader = EasyExcel.read(excel.getInputStream()).build(); List readSheets = excelReader.excelExecutor().sheetList(); for (ReadSheet readSheet : readSheets) { @@ -1437,14 +1438,16 @@ private IMenuRecipeDetailService menuRecipeDetailService; .flatMap(listener -> listener.getNotImportDishesNames().stream()) .collect(Collectors.toList()) ); - }catch (Exception var16) { - log.error("导入菜品失败", var16); + + return notImportDishesNames; + }catch (Exception e) { + // log.error("导入菜品失败", e); + throw new ServiceException(e.toString()); } finally { if (excelReader != null) { excelReader.finish(); } } - return notImportDishesNames; } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/vo/AppletDishesSizeV2VO.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/vo/AppletDishesSizeV2VO.java index 0c060bf..93914ef 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/vo/AppletDishesSizeV2VO.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/menu/vo/AppletDishesSizeV2VO.java @@ -4,6 +4,7 @@ import com.bonus.canteen.core.utils.BigDecimalSerializer; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; import java.math.BigDecimal; import java.math.RoundingMode; @@ -88,6 +89,14 @@ public class AppletDishesSizeV2VO { @ApiModelProperty("钠NRV(mg/100g)") private BigDecimal sodiumNrv; + @Getter + @ApiModelProperty("餐品口味") + private String tasteIds; + + public void setTasteIds(String tasteIds) { + this.tasteIds = tasteIds; + } + public Integer getMonthlySales() { return (Integer)Optional.ofNullable(this.monthlySales).orElse(0); } diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketDeviceController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketDeviceController.java index c2927aa..8b58a84 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketDeviceController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/controller/SupermarketDeviceController.java @@ -52,9 +52,10 @@ public class SupermarketDeviceController extends BaseController { @ApiOperation(value = "查询 - 双屏超市收银机") @SysLog(title = "超市", businessType = OperaType.INSERT, logType = 1,module = "商超管理->查询 -双屏超市收银机") - @PostMapping("/list") - public TableDataInfo list(@RequestBody DeviceDTO dto) { + @GetMapping("/list") + public TableDataInfo list(DeviceDTO dto) { try { + startPage(); return getDataTable(supermarketDeviceService.selectSupermarketDevice(dto)); } catch (Exception e) { throw new RuntimeException("系统错误, " + e.getMessage()); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/DifferenceCalculator.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/DifferenceCalculator.java new file mode 100644 index 0000000..85fdbb5 --- /dev/null +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/DifferenceCalculator.java @@ -0,0 +1,27 @@ +package com.bonus.canteen.core.utils.excel; + +import com.bonus.canteen.core.menu.domain.MenuDishes; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @author xliu + * @date 2025/5/9 11:20 + */ +public class DifferenceCalculator { + public static Set calculateDifference(Set stringSet, List menuDishesList) { + // 从menuDishesList中提取所有dishesName的集合 + Set menuDishesNames = menuDishesList.stream() + .map(MenuDishes::getDishesName) + .collect(Collectors.toSet()); + + // 计算差集:stringSet中有而menuDishesNames中没有的元素 + Set difference = new HashSet<>(stringSet); + difference.removeAll(menuDishesNames); + + return difference; + } +} diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/MenuRecipeImportListener.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/MenuRecipeImportListener.java index 038186c..227e723 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/MenuRecipeImportListener.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/utils/excel/MenuRecipeImportListener.java @@ -13,6 +13,7 @@ import com.bonus.canteen.core.menu.dto.ImportRecipeDishesDto; import com.bonus.canteen.core.menu.service.IMenuDishesService; import com.bonus.canteen.core.menu.service.IMenuRecipeDetailService; import com.bonus.canteen.core.menu.service.IMenuRecipeDishesService; +import com.bonus.common.core.exception.ServiceException; import com.bonus.common.houqin.utils.id.Id; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,58 +103,68 @@ public class MenuRecipeImportListener extends AnalysisEventListener dates = new HashSet(this.dateMap.values()); - if (!dates.isEmpty()) { - IMenuRecipeDetailService menuRecipeDetailService = SpringContextHolder.getBean(IMenuRecipeDetailService.class); - List byRecipeIdAndDates = menuRecipeDetailService.getByRecipeIdAndDatesAndIntervalId(this.recipeId, dates, this.mealtimeType); - Map dateDetailMap = byRecipeIdAndDates.stream().collect(Collectors.groupingBy(MenuRecipeDetail::getApplyDate, Collectors.collectingAndThen(Collectors.toList(), (list) -> { - return list.get(0); - }))); - if (!this.dishesNames.isEmpty()) { - IMenuDishesService menuDishesService = SpringContextHolder.getBean(IMenuDishesService.class); - List menuDishesList = menuDishesService.getByNames(this.dishesNames); - Map nameMap = menuDishesList.stream().collect(Collectors.groupingBy(MenuDishes::getDishesName, Collectors.collectingAndThen(Collectors.toList(), (list) -> { - return list.get(0); - }))); - IMenuRecipeDishesService menuRecipeDishesService = SpringContextHolder.getBean(IMenuRecipeDishesService.class); - List inserData = new ArrayList<>(); + try { + HashSet dates = new HashSet(this.dateMap.values()); + if (!dates.isEmpty()) { + IMenuRecipeDetailService menuRecipeDetailService = SpringContextHolder.getBean(IMenuRecipeDetailService.class); + List byRecipeIdAndDates = menuRecipeDetailService.getByRecipeIdAndDatesAndIntervalId(this.recipeId, dates, this.mealtimeType); + Map dateDetailMap = byRecipeIdAndDates.stream().collect(Collectors.groupingBy(MenuRecipeDetail::getApplyDate, Collectors.collectingAndThen(Collectors.toList(), (list) -> { + return list.get(0); + }))); + if (!this.dishesNames.isEmpty()) { + IMenuDishesService menuDishesService = SpringContextHolder.getBean(IMenuDishesService.class); + List menuDishesList = menuDishesService.getByNames(this.dishesNames); - for (LocalDate date : dates) { - MenuRecipeDetail menuRecipeDetail = dateDetailMap.get(date); - if (menuRecipeDetail == null) { - menuRecipeDetail = new MenuRecipeDetail(); - menuRecipeDetail.setRecipeId(this.recipeId); - menuRecipeDetail.setApplyDate(date); - menuRecipeDetail.setMealtimeType(this.mealtimeType); - menuRecipeDetail.setDetailId(Id.next()); - menuRecipeDetailService.save(menuRecipeDetail); - } else { - menuRecipeDishesService.deleteByDetailId(menuRecipeDetail.getDetailId()); - } + Set difference = DifferenceCalculator.calculateDifference(this.dishesNames, menuDishesList); + System.out.println("差集结果: " + difference); + if (difference != null && difference.size() > 0) { + throw new ServiceException("以下菜品不存在:" + difference); + } + Map nameMap = menuDishesList.stream().collect(Collectors.groupingBy(MenuDishes::getDishesName, Collectors.collectingAndThen(Collectors.toList(), (list) -> { + return list.get(0); + }))); + IMenuRecipeDishesService menuRecipeDishesService = SpringContextHolder.getBean(IMenuRecipeDishesService.class); + List inserData = new ArrayList<>(); - List importRecipeDishesDtos = this.datas.get(date); - MenuRecipeDetail finalMenuRecipeDetail = menuRecipeDetail; - List saveDatas = importRecipeDishesDtos.stream().filter(distinctByKey(ImportRecipeDishesDto::getDishesName)).map((importRecipeDishesDto) -> { - MenuRecipeDishes menuRecipeDishes = null; - MenuDishes menuDishes = nameMap.get(importRecipeDishesDto.getDishesName()); - if (menuDishes != null) { - menuRecipeDishes = BeanUtil.copyProperties(importRecipeDishesDto, MenuRecipeDishes.class, new String[0]); - menuRecipeDishes.setDetailId(finalMenuRecipeDetail.getDetailId()); - menuRecipeDishes.setSizeType(menuDishes.getSizeType()); - menuRecipeDishes.setDishesId(menuDishes.getDishesId()); - } else { - this.notImportDishesNames.add(importRecipeDishesDto.getDishesName()); - } + for (LocalDate date : dates) { + MenuRecipeDetail menuRecipeDetail = dateDetailMap.get(date); + if (menuRecipeDetail == null) { + menuRecipeDetail = new MenuRecipeDetail(); + menuRecipeDetail.setRecipeId(this.recipeId); + menuRecipeDetail.setApplyDate(date); + menuRecipeDetail.setMealtimeType(this.mealtimeType); + menuRecipeDetail.setDetailId(Id.next()); + menuRecipeDetailService.save(menuRecipeDetail); + } else { + menuRecipeDishesService.deleteByDetailId(menuRecipeDetail.getDetailId()); + } - return menuRecipeDishes; - }).filter(Objects::nonNull).collect(Collectors.toList()); - inserData.addAll(saveDatas); - } + List importRecipeDishesDtos = this.datas.get(date); + MenuRecipeDetail finalMenuRecipeDetail = menuRecipeDetail; + List saveDatas = importRecipeDishesDtos.stream().filter(distinctByKey(ImportRecipeDishesDto::getDishesName)).map((importRecipeDishesDto) -> { + MenuRecipeDishes menuRecipeDishes = null; + MenuDishes menuDishes = nameMap.get(importRecipeDishesDto.getDishesName()); + if (menuDishes != null) { + menuRecipeDishes = BeanUtil.copyProperties(importRecipeDishesDto, MenuRecipeDishes.class, new String[0]); + menuRecipeDishes.setDetailId(finalMenuRecipeDetail.getDetailId()); + menuRecipeDishes.setSizeType(menuDishes.getSizeType()); + menuRecipeDishes.setDishesId(menuDishes.getDishesId()); + } else { + this.notImportDishesNames.add(importRecipeDishesDto.getDishesName()); + } - menuRecipeDishesService.saveBatch(inserData); - } - } + return menuRecipeDishes; + }).filter(Objects::nonNull).collect(Collectors.toList()); + inserData.addAll(saveDatas); + } + menuRecipeDishesService.saveBatch(inserData); + } + } + + }catch (Exception e){ + throw new RuntimeException(e); + } } static Predicate distinctByKey(Function keyExtractor) { @@ -162,4 +173,5 @@ public class MenuRecipeImportListener extends AnalysisEventListener + @@ -97,7 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" md.dietary_fiber, md.cholesterol, md.calcium, - md.sodium + md.sodium, + md.taste_id from menu_dishes_base mdb left join menu_dishes md on mdb.base_dishes_id = md.base_dishes_id diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml index e9edbdc..bcebcb4 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/menu/MenuDishesMapper.xml @@ -387,6 +387,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 + + + diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketDeviceMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketDeviceMapper.xml index 4878c8c..b8e9c2b 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketDeviceMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketDeviceMapper.xml @@ -33,7 +33,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN alloc_area aaa ON aaa.area_id = aa.parent_id LEFT JOIN supermarket_info ac ON db.canteen_id = ac.supermarket_id where di.device_type = 53 - + + and ( di.device_name LIKE CONCAT( '%', #{keyWord}, '%' ) + OR di.device_num LIKE CONCAT( '%', #{keyWord}, '%' ) + OR di.device_sn LIKE CONCAT( '%', #{keyWord}, '%' ) + OR di.device_ip LIKE CONCAT( '%', #{keyWord}, '%' ) + OR di.device_mac LIKE CONCAT( '%', #{keyWord}, '%' ) + OR di.device_gateway LIKECONCAT( '%', #{keyWord}, '%' ) + ) + + + and aa.area_id = #{areaId} + + + and ac.supermarket_id = #{canteenId} + GROUP BY di.device_id