|
|
@@ -11,6 +11,7 @@ import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
|
|
|
import com.uas.platform.b2c.prod.commodity.model.Product;
|
|
|
import com.uas.platform.b2c.prod.commodity.model.ProductAttachSubmit;
|
|
|
import com.uas.platform.b2c.prod.commodity.service.ProductAttachService;
|
|
|
+import com.uas.platform.b2c.prod.commodity.service.ProductService;
|
|
|
import com.uas.platform.b2c.prod.product.brand.dao.BrandInfoDao;
|
|
|
import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
|
|
|
import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
|
|
|
@@ -47,9 +48,6 @@ import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* Created by wangyc on 2018/6/26.
|
|
|
*
|
|
|
@@ -76,9 +74,11 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
|
|
|
private final UserBaseInfoDao userBaseInfoDao;
|
|
|
|
|
|
+ private final ProductService productService;
|
|
|
+
|
|
|
@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, EnterpriseBaseInfoDao enterpriseBaseInfoDao, UserBaseInfoDao userBaseInfoDao, ProductService productService) {
|
|
|
this.productDao = productDao;
|
|
|
this.productAttachSubmitDao = productAttachSubmitDao;
|
|
|
this.componentDao = componentDao;
|
|
|
@@ -88,6 +88,7 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
this.kindDao = kindDao;
|
|
|
this.enterpriseBaseInfoDao = enterpriseBaseInfoDao;
|
|
|
this.userBaseInfoDao = userBaseInfoDao;
|
|
|
+ this.productService = productService;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -274,7 +275,6 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
// 标准物料无规格书,更新规格书
|
|
|
} else if (component.getAttach() == null){
|
|
|
component = addComponent(exsitedSubmit, component.getId());
|
|
|
- // TODO updateProduct
|
|
|
return ResultMap.success(auditSubmit(exsitedSubmit));
|
|
|
// 标准物料有规格书,返回两规格书
|
|
|
} else {
|
|
|
@@ -293,7 +293,6 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
return ResultMap.success(componentAttachNotNull(exsitedSubmit, component.getAttach()));
|
|
|
} else {
|
|
|
component = addComponent(exsitedSubmit, component.getId());
|
|
|
- // TODO updateProduct
|
|
|
return ResultMap.success(auditSubmit(exsitedSubmit));
|
|
|
}
|
|
|
} else {
|
|
|
@@ -301,7 +300,6 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
// 保存uuid
|
|
|
exsitedSubmit.setUuid(component.getUuid());
|
|
|
productAttachSubmitDao.save(exsitedSubmit);
|
|
|
- // TODO updateProduct
|
|
|
return ResultMap.success(auditSubmit(exsitedSubmit));
|
|
|
}
|
|
|
}
|
|
|
@@ -348,7 +346,10 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
submit.setAuditTime(new Date());
|
|
|
submit.setAuditUu(SystemSession.getUser().getUserUU());
|
|
|
submit.setAuditEnuu(SystemSession.getUser().getEnterprise().getUu());
|
|
|
- return productAttachSubmitDao.save(submit);
|
|
|
+ submit = productAttachSubmitDao.save(submit);
|
|
|
+ // 更新物料信息
|
|
|
+ productService.updateProductByComponent(submit.getProductId(), submit.getUuid());
|
|
|
+ return submit;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -403,7 +404,6 @@ public class ProductAttachServiceImpl implements ProductAttachService {
|
|
|
Component component = componentDao.findByUuid(exsitedSubmit.getUuid());
|
|
|
if (component != null) {
|
|
|
component = addComponent(exsitedSubmit, component.getId());
|
|
|
- // TODO updateProduct
|
|
|
return ResultMap.success(auditSubmit(exsitedSubmit));
|
|
|
} else {
|
|
|
return new ResultMap(CodeType.ERROR_STATE, "该物料匹配的标准器件不存在,请重新确认该物料信息");
|