当前菜谱bind
This commit is contained in:
parent
d9bfcc0c30
commit
a3693858fe
|
|
@ -310,13 +310,14 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
public void bindCookRecipe(CookRecipeBindDTO cookRecipeDTO) {
|
||||
CookRecipe menuRecipe = this.cookRecipeMapper.selectCookRecipeByRecipeId(cookRecipeDTO.getRecipeId());
|
||||
List<Integer> deviceInfoList = new ArrayList<>();
|
||||
List<String> deviceSnList = new ArrayList<>();
|
||||
if(cookRecipeDTO.getStallId() !=null){
|
||||
deviceInfoList = this.cookRecipeMapper.getDeviceIdByDevivce(null, String.valueOf(cookRecipeDTO.getStallId()));
|
||||
if(deviceInfoList == null || deviceInfoList.isEmpty() || deviceInfoList.size() == 0){
|
||||
throw new ServiceException("该食堂档口下没有设备信息");
|
||||
}
|
||||
deviceSnList = this.cookRecipeMapper.getDeviceSnByIds(deviceInfoList);
|
||||
}
|
||||
List<String> deviceSnList = this.cookRecipeMapper.getDeviceSnByIds(deviceInfoList);
|
||||
CookRecipeSortEnum sortEnum = CookRecipeSortEnum.getBindTypeMap().get(cookRecipeDTO.getBindType());
|
||||
CookAppRecipe mar = new CookAppRecipe();
|
||||
mar.setRecipeId(cookRecipeDTO.getRecipeId());
|
||||
|
|
@ -362,9 +363,11 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
}
|
||||
}
|
||||
//发送mq
|
||||
for (String deviceSn : deviceSnList){
|
||||
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(0,cookRecipeDTO.getHandleType().equals(1) ? "update" : "del");
|
||||
MqUtil.pushToSingleDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_MENU_CONFIG_V4, deviceSn);
|
||||
if (!CollectionUtils.isEmpty(deviceSnList)) {
|
||||
for (String deviceSn : deviceSnList) {
|
||||
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(0, cookRecipeDTO.getHandleType().equals(1) ? "update" : "del");
|
||||
MqUtil.pushToSingleDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_MENU_CONFIG_V4, deviceSn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue