|
@@ -667,6 +667,11 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
|
|
|
try {
|
|
try {
|
|
|
List<SeekPurchaseByBatch> seekPurchaseByBatches = bom.getSeekPurchaseByBatchs();
|
|
List<SeekPurchaseByBatch> seekPurchaseByBatches = bom.getSeekPurchaseByBatchs();
|
|
|
if (!CollectionUtils.isEmpty(seekPurchaseByBatches)) {
|
|
if (!CollectionUtils.isEmpty(seekPurchaseByBatches)) {
|
|
|
|
|
+ for (SeekPurchaseByBatch batch : seekPurchaseByBatches) {
|
|
|
|
|
+ if (null == batch.getAmount()) {
|
|
|
|
|
+ batch.setAmount(1d);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
seekPurchaseByBatchDao.save(seekPurchaseByBatches);
|
|
seekPurchaseByBatchDao.save(seekPurchaseByBatches);
|
|
|
}
|
|
}
|
|
|
seekPurchaseBomDao.save(bom);
|
|
seekPurchaseBomDao.save(bom);
|
|
@@ -724,7 +729,12 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
|
|
|
}
|
|
}
|
|
|
List<SeekPurchaseByBatch> batches = seekPurchaseByBatchDao.findAll(ids);
|
|
List<SeekPurchaseByBatch> batches = seekPurchaseByBatchDao.findAll(ids);
|
|
|
if (!CollectionUtils.isEmpty(batches)) {
|
|
if (!CollectionUtils.isEmpty(batches)) {
|
|
|
- seekPurchaseByBatchDao.delete(batches);
|
|
|
|
|
|
|
+ SeekPurchaseBom bom = seekPurchaseBomDao.findOne(batches.get(0).getBomId());
|
|
|
|
|
+ if (null != bom) {
|
|
|
|
|
+ bom.setAmount(bom.getAmount() - batches.size());
|
|
|
|
|
+ seekPurchaseByBatchDao.delete(batches);
|
|
|
|
|
+ seekPurchaseBomDao.save(bom);
|
|
|
|
|
+ }
|
|
|
map.put("success", true);
|
|
map.put("success", true);
|
|
|
} else {
|
|
} else {
|
|
|
map.put("success", false);
|
|
map.put("success", false);
|
|
@@ -801,7 +811,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
|
|
|
inquiryItem.setSource("MALL");
|
|
inquiryItem.setSource("MALL");
|
|
|
inquiryItem.setUserName(user.getUserName());
|
|
inquiryItem.setUserName(user.getUserName());
|
|
|
inquiryItem.setUserTel(user.getUserTel());
|
|
inquiryItem.setUserTel(user.getUserTel());
|
|
|
- inquiryItem.setNeedquantity(batch.getAmount() * count);
|
|
|
|
|
|
|
+ inquiryItem.setNeedquantity(null != batch.getAmount() ? batch.getAmount() * count : count);
|
|
|
inquiryItem.setInbrand(batch.getBrand());
|
|
inquiryItem.setInbrand(batch.getBrand());
|
|
|
inquiryItem.setCurrency(batch.getCurrency());
|
|
inquiryItem.setCurrency(batch.getCurrency());
|
|
|
inquiryItem.setCmpCode(batch.getCode().toUpperCase());
|
|
inquiryItem.setCmpCode(batch.getCode().toUpperCase());
|