| | |
| | | package com.oying.modules.pc.store.service.impl; |
| | | |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAddress(Long storeId, String address, Long version) { |
| | | public boolean updateAddress(Long storeId, String address, Double longitude, Double latitude, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |
| | | .set(Store::getAddress, address); |
| | | if (ObjectUtil.isNotEmpty(longitude)) { |
| | | wrapper.set(Store::getLongitude, longitude); |
| | | } |
| | | if (ObjectUtil.isNotEmpty(latitude)) { |
| | | wrapper.set(Store::getLatitude, latitude); |
| | | } |
| | | return update(wrapper); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updatePackagingFee(Long storeId, BigDecimal packagingFee, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |
| | | .set(Store::getPackagingFee, packagingFee); |
| | | return update(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateStatus(Long storeId, Integer status, Long version) { |
| | | Store existingStore = this.getOrThrow(storeId, version); |
| | | LambdaUpdateWrapper<Store> wrapper = this.createLambdaUpdateWrapper(storeId, existingStore.getVersion()) |