use of cn.lili.modules.store.entity.dos.Store in project lilishop by lilishop.
the class StoreDetailServiceImpl method editMerchantEuid.
@Override
public Boolean editMerchantEuid(String merchantEuid) {
AuthUser tokenUser = Objects.requireNonNull(UserContext.getCurrentUser());
Store store = storeService.getById(tokenUser.getStoreId());
store.setMerchantEuid(merchantEuid);
return storeService.updateById(store);
}
use of cn.lili.modules.store.entity.dos.Store in project lilishop by lilishop.
the class StoreServiceImpl method add.
@Override
@Transactional(rollbackFor = Exception.class)
public Store add(AdminStoreApplyDTO adminStoreApplyDTO) {
// 判断店铺名称是否存在
QueryWrapper<Store> queryWrapper = Wrappers.query();
queryWrapper.eq("store_name", adminStoreApplyDTO.getStoreName());
if (this.getOne(queryWrapper) != null) {
throw new ServiceException(ResultCode.STORE_NAME_EXIST_ERROR);
}
Member member = memberService.getById(adminStoreApplyDTO.getMemberId());
// 判断用户是否存在
if (member == null) {
throw new ServiceException(ResultCode.USER_NOT_EXIST);
}
// 判断是否拥有店铺
if (Boolean.TRUE.equals(member.getHaveStore())) {
throw new ServiceException(ResultCode.STORE_APPLY_DOUBLE_ERROR);
}
// 添加店铺
Store store = new Store(member, adminStoreApplyDTO);
this.save(store);
// 判断是否存在店铺详情,如果没有则进行新建,如果存在则进行修改
StoreDetail storeDetail = new StoreDetail(store, adminStoreApplyDTO);
storeDetailService.save(storeDetail);
// 设置会员-店铺信息
memberService.update(new LambdaUpdateWrapper<Member>().eq(Member::getId, member.getId()).set(Member::getHaveStore, true).set(Member::getStoreId, store.getId()));
return store;
}
use of cn.lili.modules.store.entity.dos.Store in project lilishop by lilishop.
the class StoreServiceImpl method disable.
@Override
public boolean disable(String id) {
Store store = this.getById(id);
if (store != null) {
store.setStoreDisable(StoreStatusEnum.CLOSED.value());
// 下架所有此店铺商品
goodsService.underStoreGoods(id);
return this.updateById(store);
}
throw new ServiceException(ResultCode.STORE_NOT_EXIST);
}
use of cn.lili.modules.store.entity.dos.Store in project lilishop by lilishop.
the class StoreServiceImpl method applyThirdStep.
@Override
public boolean applyThirdStep(StoreOtherInfoDTO storeOtherInfoDTO) {
// 获取当前操作的店铺
Store store = getStoreByMember();
BeanUtil.copyProperties(storeOtherInfoDTO, store);
this.updateById(store);
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
// 设置店铺的其他信息
BeanUtil.copyProperties(storeOtherInfoDTO, storeDetail);
// 设置店铺经营范围
storeDetail.setGoodsManagementCategory(storeOtherInfoDTO.getGoodsManagementCategory());
// 最后一步申请,给予店铺设置库存预警默认值
storeDetail.setStockWarning(10);
// 修改店铺详细信息
storeDetailService.updateById(storeDetail);
// 设置店铺名称,修改店铺信息
store.setStoreName(storeOtherInfoDTO.getStoreName());
store.setStoreDisable(StoreStatusEnum.APPLYING.name());
store.setStoreCenter(storeOtherInfoDTO.getStoreCenter());
store.setStoreDesc(storeOtherInfoDTO.getStoreDesc());
store.setStoreLogo(storeOtherInfoDTO.getStoreLogo());
return this.updateById(store);
}
use of cn.lili.modules.store.entity.dos.Store in project lilishop by lilishop.
the class StoreServiceImpl method applySecondStep.
@Override
public boolean applySecondStep(StoreBankDTO storeBankDTO) {
// 获取当前操作的店铺
Store store = getStoreByMember();
StoreDetail storeDetail = storeDetailService.getStoreDetail(store.getId());
// 设置店铺的银行信息
BeanUtil.copyProperties(storeBankDTO, storeDetail);
return storeDetailService.updateById(storeDetail);
}
Aggregations