|
|
@@ -156,14 +156,13 @@ public class ProductServiceImpl implements ProductService {
|
|
|
if (param.getUpdatetype().equals(UpdateType.BRANDUPDATE.getPhrase())) {
|
|
|
List<Product> products = new ArrayList<Product>();
|
|
|
if (param.getType().equals(UpdateType.sale)) {
|
|
|
- products = productDao.findByEnUUAndBrandAndIsSale(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- param.getOldvalue(), Constant.YES);
|
|
|
+ products = productDao.findByEnUUAndBrandAndIsSale(SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(),
|
|
|
+ Constant.YES);
|
|
|
} else if (param.getType().equals(UpdateType.purchase)) {
|
|
|
- products = productDao.findByEnUUAndBrandAndIsPurchase(
|
|
|
- SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(), Constant.YES);
|
|
|
+ products = productDao.findByEnUUAndBrandAndIsPurchase(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
+ param.getOldvalue(), Constant.YES);
|
|
|
} else {
|
|
|
- products = productDao.findByEnUUAndBrand(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- param.getOldvalue());
|
|
|
+ products = productDao.findByEnUUAndBrand(SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue());
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(products)) {
|
|
|
for (Product product : products) {
|
|
|
@@ -179,14 +178,13 @@ public class ProductServiceImpl implements ProductService {
|
|
|
} else if (param.getUpdatetype().equals(UpdateType.TITLEUPDATE.getPhrase())) {
|
|
|
List<Product> products = new ArrayList<Product>();
|
|
|
if (param.getType().equals(UpdateType.sale)) {
|
|
|
- products = productDao.findByEnUUAndTitleAndIsSale(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- param.getOldvalue(), Constant.YES);
|
|
|
+ products = productDao.findByEnUUAndTitleAndIsSale(SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(),
|
|
|
+ Constant.YES);
|
|
|
} else if (param.getType().equals(UpdateType.purchase)) {
|
|
|
- products = productDao.findByEnUUAndTitleAndIsPurchase(
|
|
|
- SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue(), Constant.YES);
|
|
|
+ products = productDao.findByEnUUAndTitleAndIsPurchase(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
+ param.getOldvalue(), Constant.YES);
|
|
|
} else {
|
|
|
- products = productDao.findByEnUUAndTitle(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- param.getOldvalue());
|
|
|
+ products = productDao.findByEnUUAndTitle(SystemSession.getUser().getEnterprise().getUu(), param.getOldvalue());
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(products)) {
|
|
|
map.put("size", products.size());
|
|
|
@@ -199,7 +197,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
size = prods.size();
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
map.put("success", param.getUpdatetype() + "修改成功,更新数量为" + size);
|
|
|
}
|
|
|
return map;
|
|
|
@@ -377,20 +375,14 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return results;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public ModelMap updateByEn() {
|
|
|
- ModelMap map = new ModelMap();
|
|
|
- List<Product> products = productDao.findByEnUUAndMatchstatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- Status.SUBMITTED.value());
|
|
|
- if (!CollectionUtils.isEmpty(products)) {
|
|
|
- for (Product porduct : products) {
|
|
|
- if (porduct.getMatchresults().size() == 1) {
|
|
|
- for (ProductMatchResult re : porduct.getMatchresults()) {
|
|
|
- map = refreshproduct(re.getId());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return map;
|
|
|
- }
|
|
|
+ /*
|
|
|
+ * @Override public ModelMap updateByEn() { ModelMap map = new ModelMap();
|
|
|
+ * List<Product> products =
|
|
|
+ * productDao.findByEnUUAndMatchstatus(SystemSession
|
|
|
+ * .getUser().getEnterprise().getUu(), Status.SUBMITTED.value()); if
|
|
|
+ * (!CollectionUtils.isEmpty(products)) { for (Product porduct : products) {
|
|
|
+ * if (porduct.getMatchresults().size() == 1) { for (ProductMatchResult re :
|
|
|
+ * porduct.getMatchresults()) { map = refreshproduct(re.getId()); } } } }
|
|
|
+ * return map; }
|
|
|
+ */
|
|
|
}
|