| | |
| | | package com.ruoyi.shop.service.impl.shop; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.shop.domain.dto.MgtShopProportionEditDto; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopAuthentication; |
| | | import com.ruoyi.shop.domain.pojo.shop.ShopProportion; |
| | | import com.ruoyi.shop.mapper.shop.ShopProportionMapper; |
| | | import com.ruoyi.shop.service.shop.ShopProportionService; |
| | |
| | | public void editMgtShopProportion(MgtShopProportionEditDto mgtShopProportionEditDto){ |
| | | //删除旧分成 |
| | | ShopProportion shopProportionOld = this.getById(mgtShopProportionEditDto.getProportionId()); |
| | | shopProportionOld.setDelFlag(1); |
| | | shopProportionOld.setUpdateUserId(mgtShopProportionEditDto.getUserId()); |
| | | shopProportionOld.setUpdateTime(new Date()); |
| | | this.saveOrUpdate(shopProportionOld); |
| | | if(shopProportionOld!=null){ |
| | | shopProportionOld.setDelFlag(1); |
| | | shopProportionOld.setUpdateUserId(mgtShopProportionEditDto.getUserId()); |
| | | shopProportionOld.setUpdateTime(new Date()); |
| | | this.saveOrUpdate(shopProportionOld); |
| | | } |
| | | //创建新分成 |
| | | ShopProportion shopProportionNew = new ShopProportion(); |
| | | shopProportionNew.setDelFlag(0); |
| | |
| | | shopProportionNew.setUpdateUserId(mgtShopProportionEditDto.getUserId()); |
| | | this.saveOrUpdate(shopProportionNew); |
| | | } |
| | | |
| | | @Override |
| | | public ShopProportion getByShopId(Long shopId) { |
| | | LambdaQueryWrapper<ShopProportion> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(ShopProportion::getShopId, shopId) |
| | | .eq(ShopProportion::getDelFlag, 0) |
| | | .last(" limit 1 "); |
| | | return this.getOne(queryWrapper); |
| | | } |
| | | } |