|
|
@@ -82,7 +82,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
|
|
|
Long useruu = SystemSession.getUser().getUserUU();
|
|
|
List<ProductUsers> productUsers = productUsersDao.findByEnuuAndUseruuAndTitleAndSpecAndBrand(enuu, useruu, prodInfo.getTitle(), prodInfo.getSpec(), prodInfo.getBrand());
|
|
|
if(CollectionUtils.isEmpty(productUsers)) {// 如果不存在则进行其他操作,存在不处理
|
|
|
- List<Product> productList = productDao.findByTitleAndSpecAndBrandAndEnUU(prodInfo.getTitle(), prodInfo.getSpec(), prodInfo.getBrand(), SystemSession.getUser().getEnterprise().getUu());
|
|
|
+ List<Product> productList = productDao.findByTitleAndCmpCodeAndBrandAndEnUU(prodInfo.getTitle(), prodInfo.getCmpCode(), prodInfo.getBrand(), SystemSession.getUser().getEnterprise().getUu());
|
|
|
if(!CollectionUtils.isEmpty(productList)) { // 如果存在,找出其中一个进行绑定
|
|
|
ProductUsers prod = new ProductUsers();
|
|
|
prod.setDate(new Date());
|
|
|
@@ -176,7 +176,6 @@ public class ProductUsersServiceImpl implements ProductUsersService {
|
|
|
if (row.getCell(2) != null) {
|
|
|
row.getCell(2).setCellType(Cell.CELL_TYPE_STRING);
|
|
|
product.setCmpCode(row.getCell(2).getStringCellValue().trim());
|
|
|
- product.setSpec(row.getCell(2).getStringCellValue().trim());
|
|
|
}
|
|
|
|
|
|
// 品牌
|
|
|
@@ -242,8 +241,8 @@ public class ProductUsersServiceImpl implements ProductUsersService {
|
|
|
List<ProductUsers> existProds = productUsersDao.findByEnuuAndUseruuAndTitleAndSpecAndBrand
|
|
|
(enuu, useruu, product.getTitle(), product.getSpec(), product.getBrand());
|
|
|
if(CollectionUtils.isEmpty(existProds)) {
|
|
|
- List<Product> prods = productDao.findByTitleAndSpecAndBrandAndEnUU(
|
|
|
- product.getTitle(), product.getSpec(), product.getBrand(), enuu);
|
|
|
+ List<Product> prods = productDao.findByTitleAndCmpCodeAndBrandAndEnUU(
|
|
|
+ product.getTitle(), product.getCmpCode(), product.getBrand(), enuu);
|
|
|
if (CollectionUtils.isEmpty(prods)) {
|
|
|
// 如果物料不存在,先生成物料信息
|
|
|
product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
@@ -258,7 +257,7 @@ public class ProductUsersServiceImpl implements ProductUsersService {
|
|
|
for(Role role : roles) {
|
|
|
if(role.getName().equals("业务员") || role.getName().equals("销售经理")) {
|
|
|
product.setIsSale(Constant.YES);
|
|
|
- } else if(role.getName().equals("采购员")) {
|
|
|
+ } else if(role.getName().equals("采购员")) {
|
|
|
product.setIsPurchase(Constant.YES);
|
|
|
}
|
|
|
}
|