|
|
@@ -690,16 +690,16 @@ public class ProductServiceImpl implements ProductService {
|
|
|
Integer success = 0;
|
|
|
Integer isHave = 0;
|
|
|
Long uu = SystemSession.getUser().getEnterprise().getUu();
|
|
|
- List<Product> products = productDao.findProductByEnuuAndStandardAndEnabled(uu, standard, IntegerConstant.YES_SHORT);
|
|
|
- for (Product product : products) {
|
|
|
+ List<Long> products = v_productPrivateDao.findPridsByEnUUAndStandard(standard, uu);
|
|
|
+ for (Long prid : products) {
|
|
|
try {
|
|
|
- personList = productPersonDao.findByProductId(product.getId());
|
|
|
+ personList = productPersonDao.findByProductId(prid);
|
|
|
if (CollectionUtils.isNotEmpty(personList)) {
|
|
|
fail++;
|
|
|
continue;
|
|
|
}
|
|
|
//查看是否存在正常未取消的订单
|
|
|
- List<Goods> goodses = goodsDao.findByProductId(product.getId());
|
|
|
+ List<Goods> goodses = goodsDao.findByProductId(prid);
|
|
|
Boolean isExistOrder = false;
|
|
|
String codes = OrderStatus.UNAVAILABLE.getCodes() + "-" + Status.TOBECONFIRMED.value();
|
|
|
for (Goods goods : goodses) {
|
|
|
@@ -722,13 +722,11 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
if (!isExistOrder) {
|
|
|
// 删除外键关联的匹配结果列表,不然删除product失败
|
|
|
- Set<ProductMatchResult> productMatchResultSet = product.getMatchresults();
|
|
|
- productMatchResultDao.delete(productMatchResultSet);
|
|
|
+ productMatchResultDao.deleteByProductid(prid);
|
|
|
goodsService.deleteGoods(goodses);
|
|
|
- ProductPrivate productPrivate = productPrivateService.findByPrId(product.getId());
|
|
|
+ ProductPrivate productPrivate = productPrivateService.findByPrId(prid);
|
|
|
if (null == productPrivate) {
|
|
|
- productPrivate = new ProductPrivate();
|
|
|
- productPrivate.setPrId(product.getId());
|
|
|
+ productPrivate = new ProductPrivate(prid);
|
|
|
} else {
|
|
|
if (productPrivate.getB2cEnabled().equals(IntegerConstant.NO_SHORT)) {
|
|
|
fail++;
|
|
|
@@ -1528,11 +1526,11 @@ public class ProductServiceImpl implements ProductService {
|
|
|
Map<String, Integer> resultMap = new HashMap<>();
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
Long userUU = SystemSession.getUser().getUserUU();
|
|
|
- if (enUU == null){
|
|
|
+ if (enUU == null) {
|
|
|
throw new IllegalOperatorException("店铺信息丢失,请刷新后重试");
|
|
|
}
|
|
|
int standard,nStandard;
|
|
|
- if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()){
|
|
|
+ if (IntegerConstant.YES_SHORT.equals(isPerson)){
|
|
|
standard = v_productPersonDao.getCountByEnuuAndUserUUAndStatusAndEnabled(enUU, userUU, ShortConstant.YES_SHORT, IntegerConstant.YES_SHORT);
|
|
|
nStandard = v_productPersonDao.getCountByEnuuAndUserUUAndStatusAndEnabled(enUU, userUU, ShortConstant.NO_SHORT, IntegerConstant.YES_SHORT);
|
|
|
} else {
|