|
@@ -78,6 +78,7 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
private PmsProductVertifyRecordDao productVertifyRecordDao;
|
|
|
@Autowired
|
|
|
private CmsPrefrenceAreaService prefrenceAreaService;
|
|
|
+
|
|
|
@Override
|
|
|
public int create(PmsProductParam productParam) {
|
|
|
int count;
|
|
@@ -160,16 +161,18 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
updateInfo.setPrefrenceAreaProductRelationList(relationInputs);
|
|
|
return updateInfo;
|
|
|
}
|
|
|
- public void check(PmsProductParam productParam){
|
|
|
+
|
|
|
+ public void check(PmsProductParam productParam) {
|
|
|
long compId = CurrUserUtil.getCompId();
|
|
|
- if(StringUtils.isEmpty(compId)){
|
|
|
+ if (StringUtils.isEmpty(compId)) {
|
|
|
throw new RuntimeException("没有绑定供应商无法修改!");
|
|
|
}
|
|
|
- Long productcompId = productParam.getCompId();
|
|
|
- if(!productcompId.equals(compId)){
|
|
|
+ Long productcompId = productParam.getCompId();
|
|
|
+ if (!productcompId.equals(compId)) {
|
|
|
throw new RuntimeException("你不能修改别的供应商数据!");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public int update(Long id, PmsProductParam productParam) {
|
|
@@ -263,8 +266,12 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
PmsProductExample.Criteria criteria = productExample.createCriteria();
|
|
|
productExample.setOrderByClause("create_time desc");
|
|
|
criteria.andDeleteStatusEqualTo(0);
|
|
|
- if(!StringUtils.isEmpty(compId)){
|
|
|
+ if (!StringUtils.isEmpty(compId)) {
|
|
|
criteria.andCompIdEqualTo(compId);
|
|
|
+ } else {
|
|
|
+ if (!StringUtils.isEmpty(productQueryParam.getCompId())) {
|
|
|
+ criteria.andCompIdEqualTo(productQueryParam.getCompId());
|
|
|
+ }
|
|
|
}
|
|
|
if (productQueryParam.getPublishStatus() != null) {
|
|
|
criteria.andPublishStatusEqualTo(productQueryParam.getPublishStatus());
|
|
@@ -341,9 +348,9 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
|
|
|
@Override
|
|
|
public int updateDeleteStatus(List<Long> ids, Integer deleteStatus) {
|
|
|
- if(deleteStatus.intValue() == 1){
|
|
|
- long i = pmsProductDao.check(ids);
|
|
|
- if(i>0){
|
|
|
+ if (deleteStatus.intValue() == 1) {
|
|
|
+ long i = pmsProductDao.check(ids);
|
|
|
+ if (i > 0) {
|
|
|
throw new GlobalException("你删除的商品产生预购订单,无法删除!");
|
|
|
}
|
|
|
}
|
|
@@ -381,7 +388,6 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 建立和插入关系表操作
|
|
|
*
|
|
@@ -405,6 +411,7 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
throw new RuntimeException(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private PmsProductExcelDao productExcelDao;
|
|
|
|
|
@@ -413,12 +420,14 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
PageHelper.startPage(bigDataListParam.getPageNum(), bigDataListParam.getPageSize());
|
|
|
return productExcelDao.bigDataList(bigDataListParam);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public BigDataListInfoVo bigDatainfo(Long id){
|
|
|
+ public BigDataListInfoVo bigDatainfo(Long id) {
|
|
|
return productExcelDao.bigDatainfo(id);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public List<SelectVo> bigDataType(){
|
|
|
+ public List<SelectVo> bigDataType() {
|
|
|
return productExcelDao.bigDataType();
|
|
|
}
|
|
|
|
|
@@ -429,16 +438,16 @@ public class PmsProductServiceImpl implements PmsProductService {
|
|
|
|
|
|
@Override
|
|
|
public int verify(Long id) {
|
|
|
- int count = 0 ;
|
|
|
+ int count = 0;
|
|
|
PmsProduct pmsProduct = productMapper.selectByPrimaryKey(id);
|
|
|
- if(!StringUtils.isEmpty(pmsProduct)){
|
|
|
+ if (!StringUtils.isEmpty(pmsProduct)) {
|
|
|
PmsProduct product = new PmsProduct();
|
|
|
product.setVerifyStatus(1);
|
|
|
PmsProductExample example = new PmsProductExample();
|
|
|
example.createCriteria().andIdEqualTo(id);
|
|
|
List<PmsProductVertifyRecord> list = new ArrayList<>();
|
|
|
return count = productMapper.updateByExampleSelective(product, example);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
throw new GlobalException("商品不存在无法审核!");
|
|
|
}
|
|
|
}
|