1.审核产品不通过时移除产品信息

fencang
x_z 3 years ago
parent 5987bf561f
commit 6d7a7361f1

@ -83,6 +83,9 @@ public class ThrProductsAddController {
thrProductsAddEntity = thrProductsAddService.selectById(thrProductsAddEntity.getId() + ""); thrProductsAddEntity = thrProductsAddService.selectById(thrProductsAddEntity.getId() + "");
BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity); BeanUtils.copyProperties(thrProductsAddEntity, thrProductsEntity);
thrProductsService.insertThrProducts(thrProductsEntity); thrProductsService.insertThrProducts(thrProductsEntity);
} else if (thrProductsAddEntity.getCheckStatus().equals(3)) {
//不通过,删除第三方产品信息表中此产品数据
thrProductsService.delete(thrProductsAddEntity);
} }
return ResultVOUtils.success(ResultEnum.SUCCESS); return ResultVOUtils.success(ResultEnum.SUCCESS);
} }

@ -1,6 +1,7 @@
package com.glxp.sale.admin.service.thrsys; package com.glxp.sale.admin.service.thrsys;
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity; import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
@ -24,4 +25,12 @@ public interface ThrProductsService {
boolean deleteById(String id); boolean deleteById(String id);
boolean deleteAll(); boolean deleteAll();
/**
*
*
* @param thrProductsAddEntity
*/
void delete(ThrProductsAddEntity thrProductsAddEntity);
} }

@ -1,7 +1,11 @@
package com.glxp.sale.admin.service.thrsys.impl; package com.glxp.sale.admin.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.sale.admin.dao.thrsys.ThrProductsAddDao;
import com.glxp.sale.admin.dao.thrsys.ThrProductsDao; import com.glxp.sale.admin.dao.thrsys.ThrProductsDao;
import com.glxp.sale.admin.entity.thrsys.ThrProductsAddEntity;
import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity; import com.glxp.sale.admin.entity.thrsys.ThrProductsEntity;
import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest; import com.glxp.sale.admin.req.thrsys.FilterThrProductsRequest;
import com.glxp.sale.admin.service.thrsys.ThrProductsService; import com.glxp.sale.admin.service.thrsys.ThrProductsService;
@ -14,10 +18,10 @@ import java.util.List;
@Service @Service
public class ThrProductsServiceImpl implements ThrProductsService { public class ThrProductsServiceImpl implements ThrProductsService {
@Resource @Resource
ThrProductsDao thrProductsDao; private ThrProductsDao thrProductsDao;
@Resource
private ThrProductsAddDao thrProductsAddDao;
@Override @Override
public List<ThrProductsEntity> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest) { public List<ThrProductsEntity> filterThrProductsRequest(FilterThrProductsRequest filterThrProductsRequest) {
@ -74,4 +78,18 @@ public class ThrProductsServiceImpl implements ThrProductsService {
public boolean deleteAll() { public boolean deleteAll() {
return thrProductsDao.deleteAll(); return thrProductsDao.deleteAll();
} }
@Override
public void delete(ThrProductsAddEntity thrProductsAddEntity) {
//添加审核产品信息
thrProductsAddEntity = thrProductsAddDao.selectById(String.valueOf(thrProductsAddEntity.getId()));
//查询第三方产品信息
FilterThrProductsRequest filterThrProductsRequest = new FilterThrProductsRequest();
BeanUtil.copyProperties(thrProductsAddEntity, filterThrProductsRequest);
List<ThrProductsEntity> thrProductsEntities = thrProductsDao.selectThrProducts(filterThrProductsRequest);
if (CollUtil.isNotEmpty(thrProductsEntities)) {
ThrProductsEntity thrProductsEntity = thrProductsEntities.get(0);
thrProductsDao.deleteById(String.valueOf(thrProductsEntity.getId()));
}
}
} }

Loading…
Cancel
Save