|
|
@@ -83,7 +83,6 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
@Override
|
|
|
public void save(List<Product> products) throws Exception {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.update(products);
|
|
|
}
|
|
|
|
|
|
@@ -108,12 +107,10 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
@Override
|
|
|
public void unlock(Long id) {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
try {
|
|
|
Product prod = productDao.findOne(id);
|
|
|
prod.setIsSale(Constant.YES);
|
|
|
ProductUtils.switchProduct(id, "sale", Constant.YES);
|
|
|
-// productDao.save(prod);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -122,12 +119,10 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
@Override
|
|
|
public void lock(Long id) {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
try {
|
|
|
Product prod = productDao.findOne(id);
|
|
|
prod.setIsSale(Constant.YES);
|
|
|
ProductUtils.switchProduct(id, "sale", Constant.NO);
|
|
|
-// productDao.save(prod);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -135,12 +130,10 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
@Override
|
|
|
public void unlockPurc(Long id) {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
try {
|
|
|
Product prod = productDao.findOne(id);
|
|
|
prod.setIsPurchase(Constant.YES);
|
|
|
ProductUtils.switchProduct(id, "purc", Constant.YES);
|
|
|
-// productDao.save(prod);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -148,12 +141,10 @@ public class ProductServiceImpl implements ProductService {
|
|
|
|
|
|
@Override
|
|
|
public void lockPurc(Long id) {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
try {
|
|
|
Product prod = productDao.findOne(id);
|
|
|
prod.setIsPurchase(Constant.NO);
|
|
|
ProductUtils.switchProduct(id, "purc", Constant.NO);
|
|
|
-// productDao.save(prod);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -166,21 +157,15 @@ public class ProductServiceImpl implements ProductService {
|
|
|
for (Product prod : products) {
|
|
|
if (updatetype.equals(UpdateType.BRANDUPDATE.getPhrase())) {
|
|
|
prod.setBrand(keyword);
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.updateOne(prod);
|
|
|
-// productDao.save(prod);
|
|
|
} else if (updatetype.equals(UpdateType.PRODSPECUPDATE.getPhrase())
|
|
|
|| updatetype.equals(UpdateType.MATERSPECUPDATE.getPhrase())) {
|
|
|
prod.setSpec(keyword);
|
|
|
prod.setCmpCode(keyword);
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.updateOne(prod);
|
|
|
-// productDao.save(prod);
|
|
|
} else if (updatetype.equals(UpdateType.TITLEUPDATE.getPhrase())) {
|
|
|
prod.setTitle(keyword);
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.updateOne(prod);
|
|
|
-// productDao.save(prod);
|
|
|
}
|
|
|
}
|
|
|
map.put("success", updatetype + "修改成功");
|
|
|
@@ -345,9 +330,9 @@ public class ProductServiceImpl implements ProductService {
|
|
|
productStatus.setB2bDisabled(Constant.NO);
|
|
|
}
|
|
|
try {
|
|
|
- ProductUtils.updateOne(prod);
|
|
|
// 保存物料禁用状态信息
|
|
|
productStatusDao.save(productStatus);
|
|
|
+ ProductUtils.updateOne(prod);
|
|
|
} catch (Exception e) {
|
|
|
map.put("error", "更新失败");
|
|
|
e.printStackTrace();
|
|
|
@@ -410,9 +395,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
Product product = productDao.findOne(Long.parseLong(id));
|
|
|
if (product != null) {
|
|
|
product.setDownloadstatus(Status.DOWNLOADED.value());
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.updateOne(product);
|
|
|
-// productDao.save(product);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -605,7 +588,6 @@ public class ProductServiceImpl implements ProductService {
|
|
|
for (ProductSaler productSaler : productSalers) {
|
|
|
ProductUsers prod = productUsersDao.findByEnuuAndUseruuAndErpid(enuu, productSaler.getEm_uu(), productSaler.getPs_id());
|
|
|
if (null != prod) {
|
|
|
- // TODO 因为这里要求数据即存即用,从公共库同步过来可能会有延迟,暂时两边都存;之后要修改为只调用公共服务方法
|
|
|
ProductUtils.deleteProductUser(prod.getId());
|
|
|
// productUsersDao.delete(prod);
|
|
|
erpLogger.log("ERP删除个人物料信息同步", "关联物料id: " + prod.getPrid(), 1);
|