更新菜谱发送mq
This commit is contained in:
parent
c89cb30e93
commit
565e63072b
|
|
@ -28,6 +28,7 @@ import com.bonus.canteen.core.cook.mapper.CookRecipeDetailMapper;
|
|||
import com.bonus.canteen.core.cook.mapper.CookRecipeDishesMapper;
|
||||
import com.bonus.canteen.core.cook.utils.CookRecipeImportListener;
|
||||
import com.bonus.canteen.core.cook.vo.*;
|
||||
import com.bonus.canteen.core.user.domain.DeviceMqPersonalUpdateMessageDTO;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.houqin.constant.GlobalConstants;
|
||||
|
|
@ -294,6 +295,15 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
|||
deleteOldCookRecipeDetailsAndDishes(cookRecipeDTO);
|
||||
// 重新创建详情+菜品数据
|
||||
createRecipeDetails(cookRecipeDTO);
|
||||
// 发送mq
|
||||
List<Integer> deviceInfoList = this.cookRecipeMapper.getDeviceIdByDevice(String.valueOf(cookRecipeDTO.getCanteenId()), String.valueOf(cookRecipeDTO.getStallId()));
|
||||
if(deviceInfoList !=null && deviceInfoList.size() >0){
|
||||
List<String> deviceSnList = this.cookRecipeMapper.getDeviceSnByIds(deviceInfoList);
|
||||
for (String deviceSn : deviceSnList){
|
||||
DeviceMqPersonalUpdateMessageDTO bean = new DeviceMqPersonalUpdateMessageDTO().setUpdatePerson(0,"update");
|
||||
MqUtil.pushToSingleDevice(bean, LeMqConstant.Topic.DEVICE_UPDATE_MENU_CONFIG_V4, deviceSn);
|
||||
}
|
||||
}
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue