|
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.tenant.entity.dict.po.DictCommonData;
|
|
|
import com.fjhx.tenant.service.dict.DictCommonDataService;
|
|
|
+import com.ruoyi.common.constant.StatusConstant;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
@@ -302,6 +303,37 @@ public class SkuSpecServiceImpl extends ServiceImpl<SkuSpecMapper, SkuSpec> impl
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Page<SkuSpecVo> getGiftPage(SkuSpecSelectDto dto) {
|
|
|
+ IWrapper<SkuSpec> wrapper = getWrapper();
|
|
|
+ wrapper.orderByDesc("ss", SkuSpec::getId);
|
|
|
+ wrapper.eq("ss", SkuSpec::getGiftTag, StatusConstant.YES);
|
|
|
+ wrapper.like("ss", SkuSpec::getName, dto.getName());
|
|
|
+ wrapper.like("ss", SkuSpec::getCode, dto.getCode());
|
|
|
+ Page<SkuSpecVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void giftAdd(Long id) {
|
|
|
+ SkuSpec skuSpec = this.getById(id);
|
|
|
+ if (skuSpec == null) {
|
|
|
+ throw new ServiceException("没有找到sku信息");
|
|
|
+ }
|
|
|
+ skuSpec.setGiftTag(StatusConstant.YES);
|
|
|
+ this.updateById(skuSpec);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void giftDelete(Long id) {
|
|
|
+ SkuSpec skuSpec = this.getById(id);
|
|
|
+ if (skuSpec == null) {
|
|
|
+ throw new ServiceException("没有找到sku信息");
|
|
|
+ }
|
|
|
+ skuSpec.setGiftTag(StatusConstant.NO);
|
|
|
+ this.updateById(skuSpec);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<SkuSpecQuotationVo> getSkuSpecQuotationList(SkuSpecQuotationDto dto) {
|
|
|
Assert.notNull(dto.getDepartmentId(), "事业部id不能为空");
|
|
|
Department department = departmentService.getById(dto.getDepartmentId());
|