|  | @@ -19,6 +19,7 @@ import com.hwrj.cloud.admin.dto.PmsProductResult;
 | 
											
												
													
														|  |  import com.hwrj.cloud.admin.mapper.*;
 |  |  import com.hwrj.cloud.admin.mapper.*;
 | 
											
												
													
														|  |  import com.hwrj.cloud.admin.model.*;
 |  |  import com.hwrj.cloud.admin.model.*;
 | 
											
												
													
														|  |  import com.hwrj.cloud.admin.service.PmsProductService;
 |  |  import com.hwrj.cloud.admin.service.PmsProductService;
 | 
											
												
													
														|  | 
 |  | +import com.hwrj.cloud.admin.util.CurrUserUtil;
 | 
											
												
													
														|  |  import org.slf4j.Logger;
 |  |  import org.slf4j.Logger;
 | 
											
												
													
														|  |  import org.slf4j.LoggerFactory;
 |  |  import org.slf4j.LoggerFactory;
 | 
											
												
													
														|  |  import org.springframework.beans.BeanUtils;
 |  |  import org.springframework.beans.BeanUtils;
 | 
											
										
											
												
													
														|  | @@ -82,6 +83,11 @@ public class PmsProductServiceImpl implements PmsProductService {
 | 
											
												
													
														|  |          //创建商品
 |  |          //创建商品
 | 
											
												
													
														|  |          PmsProduct product = productParam;
 |  |          PmsProduct product = productParam;
 | 
											
												
													
														|  |          product.setId(null);
 |  |          product.setId(null);
 | 
											
												
													
														|  | 
 |  | +        long compId = CurrUserUtil.getCompId();
 | 
											
												
													
														|  | 
 |  | +        if(StringUtils.isEmpty(compId)){
 | 
											
												
													
														|  | 
 |  | +            throw new RuntimeException("没有绑定供应商无法新增!");
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        productParam.setCompId(compId);
 | 
											
												
													
														|  |          productMapper.insertSelective(product);
 |  |          productMapper.insertSelective(product);
 | 
											
												
													
														|  |          //根据促销类型设置价格:会员价格、阶梯价格、满减价格
 |  |          //根据促销类型设置价格:会员价格、阶梯价格、满减价格
 | 
											
												
													
														|  |          Long productId = product.getId();
 |  |          Long productId = product.getId();
 | 
											
										
											
												
													
														|  | @@ -150,14 +156,26 @@ public class PmsProductServiceImpl implements PmsProductService {
 | 
											
												
													
														|  |          updateInfo.setPrefrenceAreaProductRelationList(relationInputs);
 |  |          updateInfo.setPrefrenceAreaProductRelationList(relationInputs);
 | 
											
												
													
														|  |          return updateInfo;
 |  |          return updateInfo;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public void check(PmsProductParam productParam){
 | 
											
												
													
														|  | 
 |  | +        long compId = CurrUserUtil.getCompId();
 | 
											
												
													
														|  | 
 |  | +        if(StringUtils.isEmpty(compId)){
 | 
											
												
													
														|  | 
 |  | +            throw new RuntimeException("没有绑定供应商无法修改!");
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        Long  productcompId = productParam.getCompId();
 | 
											
												
													
														|  | 
 |  | +        if(!productcompId.equals(compId)){
 | 
											
												
													
														|  | 
 |  | +            throw new RuntimeException("你不能修改别的供应商数据!");
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      @Transactional
 |  |      @Transactional
 | 
											
												
													
														|  |      public int update(Long id, PmsProductParam productParam) {
 |  |      public int update(Long id, PmsProductParam productParam) {
 | 
											
												
													
														|  | 
 |  | +        //检验供应商
 | 
											
												
													
														|  | 
 |  | +        check(productParam);
 | 
											
												
													
														|  |          int count;
 |  |          int count;
 | 
											
												
													
														|  |          //更新商品信息
 |  |          //更新商品信息
 | 
											
												
													
														|  |          PmsProduct product = productParam;
 |  |          PmsProduct product = productParam;
 | 
											
												
													
														|  |          product.setId(id);
 |  |          product.setId(id);
 | 
											
												
													
														|  | 
 |  | +        product.setCompId(CurrUserUtil.getCompId());
 | 
											
												
													
														|  |          productMapper.updateByPrimaryKeySelective(product);
 |  |          productMapper.updateByPrimaryKeySelective(product);
 | 
											
												
													
														|  |          //会员价格
 |  |          //会员价格
 | 
											
												
													
														|  |          PmsMemberPriceExample pmsMemberPriceExample = new PmsMemberPriceExample();
 |  |          PmsMemberPriceExample pmsMemberPriceExample = new PmsMemberPriceExample();
 | 
											
										
											
												
													
														|  | @@ -234,10 +252,15 @@ public class PmsProductServiceImpl implements PmsProductService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public List<PmsProduct> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) {
 |  |      public List<PmsProduct> list(PmsProductQueryParam productQueryParam, Integer pageSize, Integer pageNum) {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        long compId = CurrUserUtil.getCompId();
 | 
											
												
													
														|  |          PageHelper.startPage(pageNum, pageSize);
 |  |          PageHelper.startPage(pageNum, pageSize);
 | 
											
												
													
														|  |          PmsProductExample productExample = new PmsProductExample();
 |  |          PmsProductExample productExample = new PmsProductExample();
 | 
											
												
													
														|  |          PmsProductExample.Criteria criteria = productExample.createCriteria();
 |  |          PmsProductExample.Criteria criteria = productExample.createCriteria();
 | 
											
												
													
														|  |          criteria.andDeleteStatusEqualTo(0);
 |  |          criteria.andDeleteStatusEqualTo(0);
 | 
											
												
													
														|  | 
 |  | +        if(!StringUtils.isEmpty(compId)){
 | 
											
												
													
														|  | 
 |  | +            criteria.andCompIdEqualTo(compId);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |          if (productQueryParam.getPublishStatus() != null) {
 |  |          if (productQueryParam.getPublishStatus() != null) {
 | 
											
												
													
														|  |              criteria.andPublishStatusEqualTo(productQueryParam.getPublishStatus());
 |  |              criteria.andPublishStatusEqualTo(productQueryParam.getPublishStatus());
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -310,6 +333,7 @@ public class PmsProductServiceImpl implements PmsProductService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
 |  |      public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          PmsProduct record = new PmsProduct();
 |  |          PmsProduct record = new PmsProduct();
 | 
											
												
													
														|  |          record.setDeleteStatus(deleteStatus);
 |  |          record.setDeleteStatus(deleteStatus);
 | 
											
												
													
														|  |          PmsProductExample example = new PmsProductExample();
 |  |          PmsProductExample example = new PmsProductExample();
 | 
											
										
											
												
													
														|  | @@ -372,7 +396,7 @@ public class PmsProductServiceImpl implements PmsProductService {
 | 
											
												
													
														|  |      private PmsProductExcelDao productExcelDao;
 |  |      private PmsProductExcelDao productExcelDao;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<BigDataListVo> bigDataList(BigDataListParam bigDataListParam) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<BigDataListInfoVo> bigDataList(BigDataListParam bigDataListParam) {
 | 
											
												
													
														|  |          PageHelper.startPage(bigDataListParam.getPageNum(), bigDataListParam.getPageSize());
 |  |          PageHelper.startPage(bigDataListParam.getPageNum(), bigDataListParam.getPageSize());
 | 
											
												
													
														|  |          return productExcelDao.bigDataList(bigDataListParam);
 |  |          return productExcelDao.bigDataList(bigDataListParam);
 | 
											
												
													
														|  |      }
 |  |      }
 |