|
|
@@ -112,6 +112,7 @@ import org.apache.commons.beanutils.ConvertUtils;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.log4j.Logger;
|
|
|
+import org.bson.types.Code;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -481,7 +482,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
//查找物料信息
|
|
|
User user = SystemSession.getUser();
|
|
|
if (IntegerConstant.YES_SHORT.equals(isAll)) {
|
|
|
- prIds = productDao.findPridsByEnuuAndStardand(user.getEnterprise().getUu(), isStardand);
|
|
|
+ prIds = v_productPrivateDao.findPridsByEnUU(user.getEnterprise().getUu());
|
|
|
}
|
|
|
|
|
|
//筛选已经存在个人物料库的信息
|
|
|
@@ -703,13 +704,21 @@ public class ProductServiceImpl implements ProductService {
|
|
|
ResultMap resultMap = deletePersonalProductByBatch(type);
|
|
|
return resultMap;
|
|
|
}
|
|
|
- Integer standard = ProductConstant.STANDARD.equals(type) ? IntegerConstant.YES_SHORT : IntegerConstant.NO_SHORT;
|
|
|
+ Long uu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
+ List<Long> products = null;
|
|
|
+ if (ProductConstant.ALL.equals(type)) {
|
|
|
+ products = v_productPrivateDao.findPridsByEnUU(uu);
|
|
|
+ } else {
|
|
|
+ Integer standard = ProductConstant.STANDARD.equals(type)? IntegerConstant.YES_SHORT : IntegerConstant.NO_SHORT;
|
|
|
+ products = v_productPrivateDao.findPridsByEnUUAndStandard(standard, uu);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(products)) {
|
|
|
+ return new ResultMap(CodeType.OK, "沒有需要刪除的数据");
|
|
|
+ }
|
|
|
List<ProductPerson> personList;
|
|
|
Integer fail = 0;
|
|
|
Integer success = 0;
|
|
|
Integer isHave = 0;
|
|
|
- Long uu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
- List<Long> products = v_productPrivateDao.findPridsByEnUUAndStandard(standard, uu);
|
|
|
for (Long prid : products) {
|
|
|
try {
|
|
|
personList = productPersonDao.findByProductId(prid);
|