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