|
|
@@ -1,5 +1,6 @@
|
|
|
package com.uas.platform.b2c.prod.commodity.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2c.advertise.ad.service.RecommendProductService;
|
|
|
@@ -43,6 +44,7 @@ import com.uas.platform.b2c.trade.order.status.OrderStatus;
|
|
|
import com.uas.platform.b2c.trade.presale.dao.CartDao;
|
|
|
import com.uas.platform.b2c.trade.presale.dao.GoodsBrowsingHistoryDao;
|
|
|
import com.uas.platform.b2c.trade.presale.model.Cart;
|
|
|
+import com.uas.platform.b2c.trade.presale.model.Collection;
|
|
|
import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
|
|
|
import com.uas.platform.b2c.trade.presale.service.CartService;
|
|
|
import com.uas.platform.b2c.trade.support.CodeType;
|
|
|
@@ -266,6 +268,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
public Page<V_ProductPerson> getAllProductsByPerson(final PageInfo page, String keyword, String type) {
|
|
|
page.expression(PredicateUtils.eq("enUU", SystemSession.getUser().getEnterprise().getUu(), true));
|
|
|
page.expression(PredicateUtils.eq("ppUserUU", SystemSession.getUser().getUserUU(), true));
|
|
|
+ page.expression(PredicateUtils.isNotNull("pcmpcode"));
|
|
|
+ page.expression(PredicateUtils.isNotNull("pbranden"));
|
|
|
if (StringUtils.isEmpty(type)) {
|
|
|
type = "nStandard";
|
|
|
}
|
|
|
@@ -325,6 +329,31 @@ public class ProductServiceImpl implements ProductService {
|
|
|
return new PageImpl<V_ProductPerson>(productList, page, productPage.getTotalElements());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean setAllProductsByProductIds(String ids, Integer isAll, Integer isStardand) {
|
|
|
+ List<Long> prIds;
|
|
|
+ try {
|
|
|
+ prIds = JSON.parseArray(ids,Long.class);
|
|
|
+ } catch (RuntimeException e){prIds = new ArrayList<>();}
|
|
|
+ Long useruu = SystemSession.getUser().getUserUU();
|
|
|
+ if (isAll != null && isAll.equals(IntegerConstant.YES_SHORT)) {
|
|
|
+ prIds = productDao.findPridsByEnuuAndStardand(SystemSession.getUser().getEnterprise().getUu(), isStardand);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(prIds)) {
|
|
|
+ for (Long prId : prIds) {
|
|
|
+ List<ProductPerson> p = productPersonDao.findByProductIdAndUserUU(prId,useruu);
|
|
|
+ if (CollectionUtils.isEmpty(p)) {
|
|
|
+ ProductPerson productPerson = new ProductPerson();
|
|
|
+ productPerson.setUserUU(useruu);
|
|
|
+ productPerson.setProductId(prId);
|
|
|
+ productPerson.setTime(new Date(System.currentTimeMillis()));
|
|
|
+ productPersonDao.save(productPerson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<Goods> getProductsGoods(String type, String keyword) {
|
|
|
final PageInfo page = new PageInfo();
|
|
|
@@ -474,7 +503,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
} else {
|
|
|
standard = IntegerConstant.NO_SHORT;
|
|
|
}
|
|
|
- List<Product> products = productDao.findProductByEnuuAndStandard(uu, standard);
|
|
|
+ List<Product> products = productDao.findProductByEnuuAndStandardAndEnabled(uu, standard, IntegerConstant.YES_SHORT);
|
|
|
Set<String> uuids = new HashSet<>();
|
|
|
for (Product product : products) {
|
|
|
if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
|