fix:下发菜谱修改
This commit is contained in:
1 parent
ecf050204a
commit
b5262330a6
4 files changed
+55
-51
No files matched your search
+36
-31
@@ -32,50 +32,53 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/canteenCategory" )
|
||||
@Tag(description = "canteenCategory" , name = "菜品分类管理" )
|
||||
@RequestMapping("/canteenCategory")
|
||||
@Tag(description = "canteenCategory", name = "菜品分类管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class CanteenCategoryController {
|
||||
|
||||
private final CanteenCategoryService canteenCategoryService;
|
||||
private final CanteenCategoryService canteenCategoryService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param canteenCategory 菜品分类
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')" )
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')")
|
||||
public R getCanteenCategoryPage(@ParameterObject Page page, @ParameterObject CanteenCategoryEntity canteenCategory) {
|
||||
LambdaQueryWrapper<CanteenCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(canteenCategory.getName()),CanteenCategoryEntity::getName,canteenCategory.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(canteenCategory.getName()), CanteenCategoryEntity::getName, canteenCategory.getName());
|
||||
return R.ok(canteenCategoryService.selectPageByScope(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询菜品分类
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(canteenCategoryService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增菜品分类
|
||||
*
|
||||
* @param canteenCategory 菜品分类
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增菜品分类" , description = "新增菜品分类" )
|
||||
@SysLog("新增菜品分类" )
|
||||
@Operation(summary = "新增菜品分类", description = "新增菜品分类")
|
||||
@SysLog("新增菜品分类")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_add')" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_add')")
|
||||
public R save(@RequestBody CanteenCategoryEntity canteenCategory) {
|
||||
canteenCategory.setDeptId(SecurityUtils.getUser().getDeptId());
|
||||
return R.ok(canteenCategoryService.save(canteenCategory));
|
||||
@@ -83,26 +86,28 @@ public class CanteenCategoryController {
|
||||
|
||||
/**
|
||||
* 修改菜品分类
|
||||
*
|
||||
* @param canteenCategory 菜品分类
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改菜品分类" , description = "修改菜品分类" )
|
||||
@SysLog("修改菜品分类" )
|
||||
@Operation(summary = "修改菜品分类", description = "修改菜品分类")
|
||||
@SysLog("修改菜品分类")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_edit')")
|
||||
public R updateById(@RequestBody CanteenCategoryEntity canteenCategory) {
|
||||
return R.ok(canteenCategoryService.updateById(canteenCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除菜品分类
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除菜品分类" , description = "通过id删除菜品分类" )
|
||||
@SysLog("通过id删除菜品分类" )
|
||||
@Operation(summary = "通过id删除菜品分类", description = "通过id删除菜品分类")
|
||||
@SysLog("通过id删除菜品分类")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_del')" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(canteenCategoryService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
@@ -110,14 +115,15 @@ public class CanteenCategoryController {
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param canteenCategory 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_export')" )
|
||||
public List<CanteenCategoryEntity> export(CanteenCategoryEntity canteenCategory,Long[] ids) {
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_export')")
|
||||
public List<CanteenCategoryEntity> export(CanteenCategoryEntity canteenCategory, Long[] ids) {
|
||||
return canteenCategoryService.list(Wrappers.lambdaQuery(canteenCategory).in(ArrayUtil.isNotEmpty(ids), CanteenCategoryEntity::getId, ids));
|
||||
}
|
||||
|
||||
@@ -126,21 +132,20 @@ public class CanteenCategoryController {
|
||||
|
||||
/**
|
||||
* 查询所有的菜品分类
|
||||
*
|
||||
* @param categoryType 餐段类型,1早餐 2中 3晚餐 不传默认所有
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/getAllSimple" )
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')" )
|
||||
public R getAllSimple(@RequestParam(value = "categoryType",required = false)String categoryType) {
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/getAllSimple")
|
||||
@PreAuthorize("@pms.hasPermission('canteen_canteenCategory_view')")
|
||||
public R getAllSimple(@RequestParam(value = "categoryType", required = false) String categoryType) {
|
||||
LambdaQueryWrapper<CanteenCategoryEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.orderByAsc(CanteenCategoryEntity::getSort);
|
||||
wrapper.apply(StringUtils.isNotEmpty(categoryType),"FIND_IN_SET({0}, your_column_name)",categoryType);
|
||||
wrapper.apply(StringUtils.isNotEmpty(categoryType), "FIND_IN_SET({0}, your_column_name)", categoryType);
|
||||
List<CanteenCategoryEntity> list = canteenCategoryService.listScope(wrapper);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+2
-12
@@ -98,24 +98,14 @@ public class CanteenDailyMenuServiceImpl extends ServiceImpl<CanteenDailyMenuMap
|
||||
baseMapper.insert(todayDO);
|
||||
});
|
||||
// 发送mq消息
|
||||
if (ObjectUtil.isNotEmpty(canteenDailyMenu.getMerchantId())) {
|
||||
MchManageVo mch = remoteMchService.getById(canteenDailyMenu.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mch)) {
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(mch.getDeptId());
|
||||
}
|
||||
}
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean delByIds(ArrayList<Long> list, Long merchantId) {
|
||||
baseMapper.deleteByIds(list);
|
||||
// 发送mq消息
|
||||
if (ObjectUtil.isNotEmpty(merchantId)) {
|
||||
MchManageVo mch = remoteMchService.getById(merchantId).getData();
|
||||
if (ObjectUtil.isNotEmpty(mch)) {
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(mch.getDeptId());
|
||||
}
|
||||
}
|
||||
remoteMqttEventService.sendCanteenProductChangeMsg(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -30,28 +30,28 @@ public interface RemoteMqttEventService {
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-canteen-product-change-msg")
|
||||
R<Boolean> sendCanteenProductChangeMsg(@RequestParam Long mchDeptId);
|
||||
R<Boolean> sendCanteenProductChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
|
||||
/**
|
||||
* 食堂分类变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-canteen-classify-change-msg")
|
||||
R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam Long mchDeptId);
|
||||
R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
|
||||
/**
|
||||
* 超市商品变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-supermarket-product-change-msg")
|
||||
R<Boolean> sendSupermarketProductChangeMsg(@RequestParam Long mchDeptId);
|
||||
R<Boolean> sendSupermarketProductChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
|
||||
/**
|
||||
* 超市分类变化
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/mqtt/send-supermarket-classify-change-msg")
|
||||
R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam Long mchDeptId);
|
||||
R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam(required = false) Long mchDeptId);
|
||||
|
||||
/**
|
||||
* 人脸变化
|
||||
|
||||
+13
-4
@@ -1,5 +1,6 @@
|
||||
package com.bsd.pjcloud.mqtt.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.mqtt.constant.MqttActionEnum;
|
||||
@@ -45,7 +46,9 @@ public class MqttEventController {
|
||||
@GetMapping("/send-canteen-product-change-msg")
|
||||
public R<Boolean> sendCanteenProductChangeMsg(@RequestParam Long mchDeptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.CANTEEN_PRODUCT);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
@@ -57,7 +60,9 @@ public class MqttEventController {
|
||||
@GetMapping("/send-canteen-classify-change-msg")
|
||||
public R<Boolean> sendCanteenClassifyChangeMsg(@RequestParam Long mchDeptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.CANTEEN_CLASSIFY);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
@@ -69,7 +74,9 @@ public class MqttEventController {
|
||||
@GetMapping("/send-supermarket-product-change-msg")
|
||||
public R<Boolean> sendSupermarketProductChangeMsg(@RequestParam Long mchDeptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.SUPERMARKET_PRODUCT);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
@@ -81,7 +88,9 @@ public class MqttEventController {
|
||||
@GetMapping("/send-supermarket-classify-change-msg")
|
||||
public R<Boolean> sendSupermarketClassifyChangeMsg(@RequestParam Long mchDeptId) {
|
||||
MqttBaseDto dto = new MqttBaseDto<>();
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
if (ObjectUtil.isNotEmpty(mchDeptId)) {
|
||||
dto.setMerchantDeptId(mchDeptId);
|
||||
}
|
||||
dto.setAction(MqttActionEnum.SUPERMARKET_CLASSIFY);
|
||||
return R.ok(mqttEventService.defaultAction(dto));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user