|
|
@@ -1,8 +1,8 @@
|
|
|
package com.uas.platform.b2c.prod.commodity.service.impl;
|
|
|
|
|
|
-import com.uas.platform.b2c.b2b.dao.EnterpriseBaseInfoDao;
|
|
|
-import com.uas.platform.b2c.b2b.model.EnterpriseBaseInfo;
|
|
|
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
|
|
|
import com.uas.platform.b2c.common.account.dao.UserBaseInfoDao;
|
|
|
+import com.uas.platform.b2c.common.account.model.Enterprise;
|
|
|
import com.uas.platform.b2c.common.account.model.UserBaseInfo;
|
|
|
import com.uas.platform.b2c.core.constant.Status;
|
|
|
import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
@@ -44,10 +44,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
|
import javax.persistence.criteria.Predicate;
|
|
|
import javax.persistence.criteria.Root;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by wangyc on 2018/6/26.
|
|
|
@@ -71,7 +68,7 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
|
|
|
private final KindDao kindDao;
|
|
|
|
|
|
- private final EnterpriseBaseInfoDao enterpriseBaseInfoDao;
|
|
|
+ private final EnterpriseDao enterpriseDao;
|
|
|
|
|
|
private final UserBaseInfoDao userBaseInfoDao;
|
|
|
|
|
|
@@ -80,7 +77,7 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
|
|
|
@Autowired
|
|
|
public ProductAttachServiceImpl(ProductDao productDao, ProductAttachSubmitDao productAttachSubmitDao,
|
|
|
- ComponentDao componentDao, BrandInfoDao brandInfoDao, KindInfoDao kindInfoDao, ComponentService componentService, KindDao kindDao, EnterpriseBaseInfoDao enterpriseBaseInfoDao, UserBaseInfoDao userBaseInfoDao) {
|
|
|
+ ComponentDao componentDao, BrandInfoDao brandInfoDao, KindInfoDao kindInfoDao, ComponentService componentService, KindDao kindDao, EnterpriseDao enterpriseDao, UserBaseInfoDao userBaseInfoDao) {
|
|
|
this.productDao = productDao;
|
|
|
this.productAttachSubmitDao = productAttachSubmitDao;
|
|
|
this.componentDao = componentDao;
|
|
|
@@ -88,7 +85,7 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
this.kindInfoDao = kindInfoDao;
|
|
|
this.componentService = componentService;
|
|
|
this.kindDao = kindDao;
|
|
|
- this.enterpriseBaseInfoDao = enterpriseBaseInfoDao;
|
|
|
+ this.enterpriseDao = enterpriseDao;
|
|
|
this.userBaseInfoDao = userBaseInfoDao;
|
|
|
}
|
|
|
|
|
|
@@ -156,9 +153,9 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
*/
|
|
|
private ProductAttachSubmit completeReturnSubmit(ProductAttachSubmit submit) {
|
|
|
if (submit.getAuditEnuu() != null) {
|
|
|
- EnterpriseBaseInfo enterpriseBaseInfo = enterpriseBaseInfoDao.findOne(submit.getAuditEnuu());
|
|
|
- if (enterpriseBaseInfo != null) {
|
|
|
- submit.setAuditEn(enterpriseBaseInfo);
|
|
|
+ Enterprise enterprise = enterpriseDao.findOne(submit.getAuditEnuu());
|
|
|
+ if (enterprise != null) {
|
|
|
+ submit.setAuditEn(enterprise);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -241,6 +238,8 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
Component component = componentDao.findByUuid(product.getCmpUuId());
|
|
|
if (component != null) {
|
|
|
submit.setUuid(product.getCmpUuId());
|
|
|
+ submit.setKindId(component.getKindid());
|
|
|
+ submit.setBrandId(component.getBrandid());
|
|
|
}
|
|
|
}
|
|
|
return submit;
|
|
|
@@ -255,7 +254,11 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<ProductAttachSubmit> findByProductidsAndStatus(List<Long> productids, Integer status) {
|
|
|
- return productAttachSubmitDao.findByProductIdsAndStatus(productids, status);
|
|
|
+ if (CollectionUtils.isNotEmpty(productids) || status == null) {
|
|
|
+ return productAttachSubmitDao.findByProductIdsAndStatus(productids, status);
|
|
|
+ } else {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|