diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenCategoryService.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenCategoryService.java new file mode 100644 index 000000000..d498550d7 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenCategoryService.java @@ -0,0 +1,44 @@ +/* + * + * Copyright (c) 2018-2025, pjcloud All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: pjcloud + * + */ + +package com.bsd.pjcloud.canteen.api.feign; + + +import com.bsd.pjcloud.common.core.constant.ServiceNameConstants; +import com.bsd.pjcloud.common.core.util.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +/** + * @author zjf + * @date 2018/6/22 + */ +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.CANTEEN_SERVICE) +public interface RemoteCanteenCategoryService { + + + /** + * 查询所有的菜品分类 + * @param categoryType 餐段类型,1早餐 2中 3晚餐 不传默认所有 + * @return R + */ + @GetMapping("/canteenCategory/getAllSimple") + R getAllSimple(@RequestParam(value = "categoryType",required = false) String categoryType); + +} diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenSpuService.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenSpuService.java new file mode 100644 index 000000000..02351e614 --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/api/feign/RemoteCanteenSpuService.java @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2018-2025, pjcloud All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: pjcloud + * + */ + +package com.bsd.pjcloud.canteen.api.feign; + + +import com.bsd.pjcloud.canteen.dto.CanteenSpuUpdateStockReqDTO; +import com.bsd.pjcloud.common.core.constant.ServiceNameConstants; +import com.bsd.pjcloud.common.core.util.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * @author zjf + * @date 2018/6/22 + */ +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.CANTEEN_SERVICE) +public interface RemoteCanteenSpuService { + + + /** + * 获取菜品列表 + * @param categoryId 不填默认查全部 + * @return + */ + @GetMapping("/canteenSpu/ad/getCanteenSpuList") + R getCanteenSpuList(@RequestParam(value = "categoryId",required = false)String categoryId); + + + /** + * 扣减菜品库存 + * @param updateStockReqDTO + * @return + */ + @PostMapping("/canteenSpu/ad/updateSkuStock") + R getAllSimple(@RequestBody CanteenSpuUpdateStockReqDTO updateStockReqDTO); + +} diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/dto/DailyMenuAll.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/dto/DailyMenuAll.java index cdfebdb7e..480ecff37 100644 --- a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/dto/DailyMenuAll.java +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/dto/DailyMenuAll.java @@ -7,7 +7,7 @@ import java.util.List; /** * @author ml - * 菜品下拉框主页展示 + * 后台每日菜谱菜品下拉框 */ @Data public class DailyMenuAll { diff --git a/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/ADCanteenSpuListVO.java b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/ADCanteenSpuListVO.java new file mode 100644 index 000000000..76ca68bff --- /dev/null +++ b/pjcloud-canteen/pjcloud-canteen-api/src/main/java/com/bsd/pjcloud/canteen/vo/ADCanteenSpuListVO.java @@ -0,0 +1,82 @@ +package com.bsd.pjcloud.canteen.vo; + + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +@Schema(description = "安卓机在线点餐获取菜品信息") +public class ADCanteenSpuListVO { + + + /** + * 商品 SPU 编号,自增 + */ + @Schema(description="商品 SPU 编号,自增") + private Long id; + + /** + * 商品名称 + */ + @Schema(description="商品名称") + private String name; + + + /** + * 商品分类编号 + */ + @Schema(description="商品分类编号") + private Long categoryId; + + /** + * 商品封面图 + */ + @Schema(description="商品封面图") + private String picUrl; + + + /** + * 商品价格,单位使用:分 + */ + @Schema(description="商品价格,单位使用:分") + private Integer price; + + + /** + * 市场价,单位使用:分 + */ + @Schema(description="市场价,单位使用:分") + private Integer marketPrice; + + + /** + * 库存 + */ + @Schema(description="库存") + private Integer stock; + + + /** + * 商品销量 + */ + @Schema(description="商品销量") + private Integer salesCount; + + + /** + * 商户编号 + */ + @Schema(description="商户编号") + private Long merchantId; + + /** + * 部门id + */ + @Schema(description="部门id") + private Long deptId; + + +} diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java index aaa456975..2b627c938 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenCategoryController.java @@ -134,8 +134,8 @@ public class CanteenCategoryController { public R getAllSimple(@RequestParam(value = "categoryType",required = false)String categoryType) { LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); wrapper.orderByAsc(CanteenCategoryEntity::getSort); - wrapper.eq(StringUtils.isNotEmpty(categoryType),CanteenCategoryEntity::getCategoryType,categoryType); - List list = canteenCategoryService.list(wrapper); + wrapper.apply(StringUtils.isNotEmpty(categoryType),"FIND_IN_SET({0}, your_column_name)",categoryType); + List list = canteenCategoryService.listScope(wrapper); return R.ok(list); } } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenSpuController.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenSpuController.java index 4919cb4ac..839bf5000 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenSpuController.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/controller/CanteenSpuController.java @@ -131,8 +131,19 @@ public class CanteenSpuController { // --------------APP----------------- + /** + * 获取菜品列表 + * @param categoryId 分类编号,不传默认查询全部 + * @return + */ + @GetMapping("/ad/getCanteenSpuList") + public R getCanteenSpuList(@RequestParam(value = "categoryId",required = false)String categoryId){ + return canteenSpuService.getCanteenSpuList(categoryId); + } + @PostMapping("/ad/updateSkuStock") @SysLog("更新菜品库存") + @PreAuthorize("@pms.hasPermission('canteen_canteenSpu_edit')" ) public R updateSkuStock(@RequestBody CanteenSpuUpdateStockReqDTO updateStockReqDTO){ return canteenSpuService.updateSkuStock(updateStockReqDTO); } diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenCategoryService.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenCategoryService.java index e22131df3..d6924a47f 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenCategoryService.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenCategoryService.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.bsd.pjcloud.canteen.entity.CanteenCategoryEntity; +import java.util.List; + public interface CanteenCategoryService extends IService { @@ -15,4 +17,12 @@ public interface CanteenCategoryService extends IService * @return */ Page selectPageByScope(Page page, LambdaQueryWrapper wrapper); + + + /** + * 获取菜品分类 + * @param wrapper + * @return + */ + List listScope(LambdaQueryWrapper wrapper); } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenSpuService.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenSpuService.java index 158f5bdd2..e0963b5f4 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenSpuService.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/CanteenSpuService.java @@ -27,4 +27,11 @@ public interface CanteenSpuService extends IService { */ R updateSkuStock(CanteenSpuUpdateStockReqDTO updateStockReqDTO); + + /** + * 根据菜品分类id获取菜品信息 + * @param categoryId + * @return + */ + R getCanteenSpuList(String categoryId); } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenCategoryServiceImpl.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenCategoryServiceImpl.java index 2d446376b..c954f8c32 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenCategoryServiceImpl.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenCategoryServiceImpl.java @@ -26,4 +26,9 @@ public class CanteenCategoryServiceImpl extends ServiceImpl listScope(LambdaQueryWrapper wrapper) { + return baseMapper.selectListByScope(wrapper,DataScope.of()); + } } \ No newline at end of file diff --git a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenSpuServiceImpl.java b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenSpuServiceImpl.java index 6cbca93d9..5ce70a262 100644 --- a/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenSpuServiceImpl.java +++ b/pjcloud-canteen/pjcloud-canteen-biz/src/main/java/com/bsd/pjcloud/canteen/service/impl/CanteenSpuServiceImpl.java @@ -8,12 +8,15 @@ import com.bsd.pjcloud.canteen.entity.CanteenSpuEntity; import com.bsd.pjcloud.canteen.mapper.CanteenSpuMapper; import com.bsd.pjcloud.canteen.service.CanteenDailyMenuService; import com.bsd.pjcloud.canteen.service.CanteenSpuService; +import com.bsd.pjcloud.canteen.vo.ADCanteenSpuListVO; +import com.bsd.pjcloud.common.core.util.BeanUtils; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.common.data.datascope.DataScope; import com.github.yulichang.wrapper.MPJLambdaWrapper; import lombok.AllArgsConstructor; import lombok.Data; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +54,14 @@ public class CanteenSpuServiceImpl extends ServiceImpl canteenSpuEntities = baseMapper.selectListByScope(new LambdaQueryWrapper() + .eq(StringUtils.isNotEmpty(categoryId), CanteenSpuEntity::getCategoryId, categoryId),DataScope.of()); + List bean = BeanUtils.toBean(canteenSpuEntities, ADCanteenSpuListVO.class); + return R.ok(bean); + + } } \ No newline at end of file diff --git a/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/ServiceNameConstants.java b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/ServiceNameConstants.java index 7ff46284e..8d6157d26 100644 --- a/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/ServiceNameConstants.java +++ b/pjcloud-common/pjcloud-common-core/src/main/java/com/bsd/pjcloud/common/core/constant/ServiceNameConstants.java @@ -67,6 +67,16 @@ public interface ServiceNameConstants { */ String CANTEEN_SERVICE = "pjcloud-canteen-biz"; + /** + * 超市服务 + */ + String SUPERMARKET_SERVICE = "pjcloud-supermarket-biz"; + + /** + * 超市erp服务 + */ + String SUPERMARKET_ERP_SERVICE = "pjcloud-supermarket-erp-biz"; + /** * 钱包模块 */ diff --git a/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketCategoryService.java b/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketCategoryService.java new file mode 100644 index 000000000..07dcde2a9 --- /dev/null +++ b/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketCategoryService.java @@ -0,0 +1,46 @@ +/* + * + * Copyright (c) 2018-2025, pjcloud All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: pjcloud + * + */ + +package com.bsd.pjcloud.supermarket.api.feign; + + +import com.bsd.pjcloud.common.core.constant.ServiceNameConstants; +import com.bsd.pjcloud.common.core.util.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +/** + * @author zjf + * @date 2018/6/22 + */ +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SUPERMARKET_SERVICE) +public interface RemoteSupermarketCategoryService { + + + + + /** + * 查询所有的分类 + * @return R + */ + @GetMapping("/supermarketCategory/simpleAll") + R getSimpleAll(); + +} diff --git a/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketSpuService.java b/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketSpuService.java new file mode 100644 index 000000000..4f63d4d4a --- /dev/null +++ b/pjcloud-supermarket/pjcloud-supermarket-api/src/main/java/com/bsd/pjcloud/supermarket/api/feign/RemoteSupermarketSpuService.java @@ -0,0 +1,42 @@ +/* + * + * Copyright (c) 2018-2025, pjcloud All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: pjcloud + * + */ + +package com.bsd.pjcloud.supermarket.api.feign; + + +import com.bsd.pjcloud.common.core.constant.ServiceNameConstants; +import com.bsd.pjcloud.common.core.util.R; +import com.bsd.pjcloud.common.feign.annotation.NoToken; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author zjf + * @date 2018/6/22 + */ +@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SUPERMARKET_SERVICE) +public interface RemoteSupermarketSpuService { + + + + + +} diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketCategoryController.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketCategoryController.java index fc129aa86..e796ae06a 100644 --- a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketCategoryController.java +++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketCategoryController.java @@ -123,7 +123,7 @@ public class SupermarketCategoryController { /** - * 下拉查询 + * 获取所有分类 * @return */ @Operation(summary = "下拉查询") diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java index 7bfe61426..da6177bc8 100644 --- a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java +++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/controller/SupermarketSpuController.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.common.log.annotation.SysLog; +import com.bsd.pjcloud.common.security.util.SecurityUtils; import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO; import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity; import com.bsd.pjcloud.supermarket.service.SupermarketSpuService; @@ -52,7 +53,7 @@ public class SupermarketSpuController { wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getProductCode()),SupermarketSpuEntity::getProductCode,supermarketSpu.getProductCode()); wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getBarcode()),SupermarketSpuEntity::getBarcode,supermarketSpu.getBarcode()); wrapper.eq(StrUtil.isNotBlank(supermarketSpu.getProductName()),SupermarketSpuEntity::getProductName,supermarketSpu.getProductName()); - return R.ok(supermarketSpuService.page(page, wrapper)); + return R.ok(supermarketSpuService.pageScope(page, wrapper)); } @@ -78,6 +79,7 @@ public class SupermarketSpuController { @PostMapping @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_add')" ) public R save(@RequestBody SupermarketSpuEntity supermarketSpu) { + supermarketSpu.setDeptId(SecurityUtils.getUser().getDeptId()); return supermarketSpuService.saveSpu(supermarketSpu); } @@ -126,4 +128,17 @@ public class SupermarketSpuController { public R updateSkuStock(@RequestBody SupermarketSpuUpdateStockReqDTO updateStockReqDTO){ return supermarketSpuService.updateSpuStock(updateStockReqDTO); } + + + /** + * 条件查询 + * @param supermarketSpu 商品spu + * @return + */ + @Operation(summary = "条件查询所有" , description = "条件查询所有" ) + @GetMapping("/selectListAll" ) + @PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_view')" ) + public R getSupermarketSpuPage(@ParameterObject SupermarketSpuEntity supermarketSpu) { + return R.ok(supermarketSpuService.selectListAllScope(supermarketSpu)); + } } \ No newline at end of file diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java index e332ec451..db1e0fa0d 100644 --- a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java +++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/SupermarketSpuService.java @@ -1,5 +1,7 @@ package com.bsd.pjcloud.supermarket.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.bsd.pjcloud.common.core.util.R; import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO; @@ -25,4 +27,20 @@ public interface SupermarketSpuService extends IService { * @return */ R updateSpuStock(SupermarketSpuUpdateStockReqDTO updateStockReqDTO); + + + /** + * 分页查询 + * @param page + * @param wrapper + * @return + */ + Object pageScope(Page page, LambdaQueryWrapper wrapper); + + /** + * 根据条件查询所有数据,app/收银机接口 + * @param supermarketSpu + * @return + */ + Object selectListAllScope(SupermarketSpuEntity supermarketSpu); } \ No newline at end of file diff --git a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java index 6f09adddf..ee5cdda03 100644 --- a/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java +++ b/pjcloud-supermarket/pjcloud-supermarket-biz/src/main/java/com/bsd/pjcloud/supermarket/service/impl/SupermarketSpuServiceImpl.java @@ -1,8 +1,10 @@ package com.bsd.pjcloud.supermarket.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.bsd.pjcloud.common.core.util.R; +import com.bsd.pjcloud.common.data.datascope.DataScope; import com.bsd.pjcloud.supermarket.dto.SupermarketSpuUpdateStockReqDTO; import com.bsd.pjcloud.supermarket.entity.SupermarketAuxiliaryCodeEntity; import com.bsd.pjcloud.supermarket.entity.SupermarketSpuEntity; @@ -123,4 +125,17 @@ public class SupermarketSpuServiceImpl extends ServiceImpl wrapper) { + return baseMapper.selectPageByScope(page, wrapper, DataScope.of()); + } + + @Override + public Object selectListAllScope(SupermarketSpuEntity supermarketSpu) { + + return null; + + + } } \ No newline at end of file