|
|
@@ -89,8 +89,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
if (item.getReplyQty() > item.getQty())
|
|
|
throw new IllegalOperatorException("回复的数量合计超过了订单数量");
|
|
|
// 该行回复状态
|
|
|
- item.setStatus((short) (Double.compare(item.getReplyQty(), item.getQty()) == 0 ? Status.REPLIED.value()
|
|
|
- : Status.NOT_REPLY.value()));
|
|
|
+ item.setStatus((short) (Double.compare(item.getReplyQty(), item.getQty()) == 0 ? Status.REPLIED.value() : Status.NOT_REPLY.value()));
|
|
|
purchaseOrderReplyDao.save(reply);
|
|
|
purchaseOrderItemDao.save(item);
|
|
|
// 订单主记录状态
|
|
|
@@ -103,8 +102,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
|
@Override
|
|
|
public PurchaseOrderAll findByCode(String code) {
|
|
|
- List<PurchaseOrderAll> purchaseOrderAlls = purchaseOrderAllDao.findByVendUUAndCode(SystemSession.getUser()
|
|
|
- .getEnterprise().getUu(), code);
|
|
|
+ List<PurchaseOrderAll> purchaseOrderAlls = purchaseOrderAllDao.findByVendUUAndCode(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
+ code);
|
|
|
if (purchaseOrderAlls.size() == 0)
|
|
|
throw new NotFoundException(code);
|
|
|
return purchaseOrderAlls.get(0);
|
|
|
@@ -142,8 +141,19 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|
|
|
|
|
@Override
|
|
|
public List<PurchaseOrderReply> findNotUploadReply() {
|
|
|
- return purchaseOrderReplyDao.findByEnUUAndStatus(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
- (short) Status.NOT_UPLOAD.value());
|
|
|
+ return purchaseOrderReplyDao
|
|
|
+ .findByEnUUAndStatus(SystemSession.getUser().getEnterprise().getUu(), (short) Status.NOT_UPLOAD.value());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onReplyUploadSuccess(String[] idArray) {
|
|
|
+ for (String id : idArray) {
|
|
|
+ PurchaseOrderReply reply = purchaseOrderReplyDao.findOne(Long.parseLong(id));
|
|
|
+ if (reply != null) {
|
|
|
+ reply.setStatus((short) Status.REPLIED.value());
|
|
|
+ purchaseOrderReplyDao.save(reply);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|