|
|
@@ -323,8 +323,15 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
public DocBaseDTO close(Long id) {
|
|
|
DocBaseDTO docBaseDTO = null;
|
|
|
if(id != null && id > 0){
|
|
|
+ Product product = getMapper().selectByPrimaryKey(id);
|
|
|
+ if (product == null) {
|
|
|
+ throw new BizException(BizExceptionCode.NO_DATA);
|
|
|
+ }
|
|
|
+ if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
|
|
|
+ throw new BizException(BizExceptionCode.BIZ_BANNED);
|
|
|
+ }
|
|
|
String code = getMapper().getCodeById(id);
|
|
|
- Product product = new Product();
|
|
|
+ product = new Product();
|
|
|
product.setId(id);
|
|
|
product.setPr_status(Status.BANNED.getDisplay());
|
|
|
product.setPr_statuscode(Status.BANNED.name());
|
|
|
@@ -349,7 +356,7 @@ public class ProductServiceImpl extends CommonBaseServiceImpl<ProductMapper, Pro
|
|
|
if (product == null) {
|
|
|
throw new BizException(BizExceptionCode.NO_DATA);
|
|
|
}
|
|
|
- if (!Status.ENABLE.getDisplay().equals(product.getPr_status())){
|
|
|
+ if (!Status.BANNED.getDisplay().equals(product.getPr_status())){
|
|
|
throw new BizException(BizExceptionCode.BIZ_ENABLE);
|
|
|
}else{
|
|
|
product.setId(id);
|