| | |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsDAO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.dao.ComShopStoreDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import com.panzhihua.service_community.service.ComShopStoreService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | @Override |
| | | public R saveStore(ShopStoreVO storeVO) { |
| | | if (storeVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | return R.fail("500", "数据为空!"); |
| | | } |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount())); |
| | | if (comShopStoreDO != null) { |
| | | return R.ok("500", "商家账号存在"); |
| | | return R.fail("500", "商家账号存在"); |
| | | } |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | BeanUtils.copyProperties(storeVO, storeDO); |
| | |
| | | @Override |
| | | public R editStore(Long id, ShopStoreVO storeVO) { |
| | | if (storeVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | return R.fail("500", "数据为空!"); |
| | | } |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getId, id); |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getStoreByPhone(String phone) { |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>(); |
| | | query.eq(ComShopStoreDO::getPhone, phone); |
| | | query.eq(ComShopStoreDO::getDeleteStatus, 1); |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(query); |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | } |