pad点餐接口实现

This commit is contained in:
张松 2025-02-20 14:33:41 +08:00
parent 6d990e5a72
commit 3c91d463dc
1 changed files with 2 additions and 13 deletions

View File

@ -3,14 +3,11 @@ package com.czg.service.account.service.impl;
import com.czg.account.dto.pad.*;
import com.czg.account.entity.*;
import com.czg.account.service.*;
import com.czg.enums.StatusEnum;
import com.czg.exception.ApiNotPrintException;
import com.czg.service.account.mapper.PadProductCategoryDetailMapper;
import com.czg.utils.JoinQueryWrapper;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.util.LambdaUtil;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@ -35,10 +32,6 @@ public class PadProdServiceImpl implements PadProdService {
@Resource
private PadProductCategoryDetailService padProductCategoryDetailService;
void main() {
LambdaUtil.getQueryColumn(SysUser::getId).getName();
// new QueryWrapper().eq()
}
@Override
public Page<PadProductCategoryDTO> pageInfo(Page<PadProductCategoryDTO> objectPage, Long productCategoryId, Long shopId) {
JoinQueryWrapper queryWrapper = new JoinQueryWrapper().eq(PadProductCategory::getShopId, shopId);
@ -84,9 +77,7 @@ public class PadProdServiceImpl implements PadProdService {
padProductCategoryService.save(padProductCategory);
ArrayList<PadProductCategoryDetail> details = new ArrayList<>();
padDetailAddDTO.getProductIdList().forEach(item -> {
details.add(new PadProductCategoryDetail().setPadProductCategoryId(padProductCategory.getId()).setProductId(item));
});
padDetailAddDTO.getProductIdList().forEach(item -> details.add(new PadProductCategoryDetail().setPadProductCategoryId(padProductCategory.getId()).setProductId(item)));
return padProductCategoryDetailService.saveBatch(details);
}
@ -106,9 +97,7 @@ public class PadProdServiceImpl implements PadProdService {
if (padDetailEditDTO.getProductIdList() != null && !padDetailEditDTO.getProductIdList().isEmpty()) {
padProductCategoryDetailService.remove(new QueryWrapper().eq(PadProductCategoryDetail::getPadProductCategoryId, padDetailEditDTO.getId()));
ArrayList<PadProductCategoryDetail> details = new ArrayList<>();
padDetailEditDTO.getProductIdList().forEach(item -> {
details.add(new PadProductCategoryDetail().setPadProductCategoryId(padDetailEditDTO.getId()).setProductId(item));
});
padDetailEditDTO.getProductIdList().forEach(item -> details.add(new PadProductCategoryDetail().setPadProductCategoryId(padDetailEditDTO.getId()).setProductId(item)));
return padProductCategoryDetailService.saveBatch(details);
}
return true;