|
@@ -440,6 +440,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
List<ProductPerson> personList = new ArrayList<>();
|
|
List<ProductPerson> personList = new ArrayList<>();
|
|
|
Integer fail = 0;
|
|
Integer fail = 0;
|
|
|
Integer success = 0;
|
|
Integer success = 0;
|
|
|
|
|
+ Integer isHave = 0;
|
|
|
Long uu = SystemSession.getUser().getEnterprise().getUu();
|
|
Long uu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
if(ProductConstant.STANDARD.equals(type)) {
|
|
if(ProductConstant.STANDARD.equals(type)) {
|
|
|
standard = IntegerConstant.YES_SHORT;
|
|
standard = IntegerConstant.YES_SHORT;
|
|
@@ -492,12 +493,17 @@ public class ProductServiceImpl implements ProductService {
|
|
|
goodsService.deleteGoods(goodses);
|
|
goodsService.deleteGoods(goodses);
|
|
|
//productDao.delete(product.getId());
|
|
//productDao.delete(product.getId());
|
|
|
ProductPrivate productPrivate = productPrivateDao.findByPrId(product.getId());
|
|
ProductPrivate productPrivate = productPrivateDao.findByPrId(product.getId());
|
|
|
|
|
+ if (productPrivate.getB2cEnabled().equals(IntegerConstant.NO_SHORT)) {
|
|
|
|
|
+ fail++;
|
|
|
|
|
+ isHave++;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ success++;
|
|
|
|
|
+ }
|
|
|
productPrivate.setB2cEnabled(IntegerConstant.NO_SHORT);
|
|
productPrivate.setB2cEnabled(IntegerConstant.NO_SHORT);
|
|
|
productPrivateDao.save(productPrivate);
|
|
productPrivateDao.save(productPrivate);
|
|
|
if (!StringUtils.isEmpty(product.getCmpUuId())) {
|
|
if (!StringUtils.isEmpty(product.getCmpUuId())) {
|
|
|
uuids.add(product.getCmpUuId());
|
|
uuids.add(product.getCmpUuId());
|
|
|
}
|
|
}
|
|
|
- success++;
|
|
|
|
|
}else {
|
|
}else {
|
|
|
fail++;
|
|
fail++;
|
|
|
}
|
|
}
|
|
@@ -515,7 +521,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if(success != 0) {
|
|
if(success != 0) {
|
|
|
message += ",";
|
|
message += ",";
|
|
|
}
|
|
}
|
|
|
- message += "删除失败" + fail + "条,原因:该产品可能已经被其他单据引用,无法删除";
|
|
|
|
|
|
|
+ message += "删除失败" + (fail-isHave) + "条,原因:该产品可能已经被其他单据或个人物料库引用,无法删除";
|
|
|
}
|
|
}
|
|
|
//如果是全部都不能删除,才能设置失败的状态码
|
|
//如果是全部都不能删除,才能设置失败的状态码
|
|
|
if((products.size() != 0) && (products.size() == fail.intValue())) {
|
|
if((products.size() != 0) && (products.size() == fail.intValue())) {
|