|
|
@ -3,6 +3,9 @@ package com.yxt.supervise.dbcenter.zhj.crawl.biz.confBrandProportion; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrand; |
|
|
|
import com.yxt.supervise.dbcenter.zhj.crawl.biz.enpBrand.EnpBrandMapper; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
@ -14,6 +17,9 @@ import java.util.List; |
|
|
|
@Service |
|
|
|
public class ConfBrandProportionService extends ServiceImpl<ConfBrandProportionMapper, ConfBrandProportion> { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EnpBrandMapper enpBrandMapper; |
|
|
|
|
|
|
|
public ResultBean save(ConfBrandProportionDto dto){ |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
ConfBrandProportion proportion = new ConfBrandProportion(); |
|
|
@ -27,8 +33,16 @@ public class ConfBrandProportionService extends ServiceImpl<ConfBrandProportionM |
|
|
|
|
|
|
|
public ResultBean selectConfBrandProportion(){ |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
List<ConfBrandProportion> proportions = baseMapper.selectConfBrandProportionList(); |
|
|
|
return rb.success().setData(proportions); |
|
|
|
List<EnpBrand> enpBrands = enpBrandMapper.selectEnpBrandList(); |
|
|
|
for (EnpBrand enpBrand : enpBrands) { |
|
|
|
List<ConfBrandProportion> proportions = baseMapper.selectConfBrandProportionList(enpBrand.getSid()); |
|
|
|
if (proportions != null){ |
|
|
|
enpBrand.setConfBrandProportionList(proportions); |
|
|
|
}else { |
|
|
|
enpBrand.setConfBrandProportionList(null); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(enpBrands); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean deleteConfBrandProportion(Integer id){ |
|
|
|