|
@@ -199,31 +199,36 @@ public class BillSubmitServiceImpl implements BillSubmitService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public BillSubmit auditBillSubmit(Long id) {
|
|
|
|
|
- BillSubmit billSubmit = billSubmitDao.findOne(id);
|
|
|
|
|
-
|
|
|
|
|
- if (billSubmit == null)
|
|
|
|
|
- throw new IllegalOperatorException("此发票申请不存在");
|
|
|
|
|
- if (!SystemSession.getUser().getEnterprise().getUu().equals(billSubmit.getSellerenuu()))
|
|
|
|
|
- throw new IllegalOperatorException("此发票申请不属于当前企业");
|
|
|
|
|
- if (Status.SUBMITTED.value() != billSubmit.getStatus())
|
|
|
|
|
- throw new IllegalOperatorException("此发票申请不为待审核状态,不可审核");
|
|
|
|
|
-
|
|
|
|
|
- billSubmit.setStatus(Status.AUDITED.value());
|
|
|
|
|
- billSubmit.setHandleTime(new Date());
|
|
|
|
|
-
|
|
|
|
|
- String[] orderids = billSubmit.getOrderids().split(SplitChar.COMMA);
|
|
|
|
|
- for (String orderid : orderids) {
|
|
|
|
|
- Order order = orderDao.findOrderByOrderid(orderid);
|
|
|
|
|
- if (order == null)
|
|
|
|
|
- throw new IllegalOperatorException("订单: " + orderid + " 不存在,请与客服人员确认该订单");
|
|
|
|
|
- if (!SystemSession.getUser().getEnterprise().getUu().equals(order.getSellerenuu()))
|
|
|
|
|
- throw new IllegalOperatorException("订单: " + orderid + " 不属于当前企业,不可审核");
|
|
|
|
|
-
|
|
|
|
|
- order.setVatBillStatus(Status.TOBERECEIVE_BILL.value());
|
|
|
|
|
- orderDao.save(order);
|
|
|
|
|
|
|
+ public List<BillSubmit> auditBillSubmit(String ids) {
|
|
|
|
|
+ String[] idList = ids.split(SplitChar.COMMA);
|
|
|
|
|
+ List<BillSubmit> billSubmits = new ArrayList<BillSubmit>();
|
|
|
|
|
+ for (String id : idList) {
|
|
|
|
|
+ BillSubmit billSubmit = billSubmitDao.findOne(Long.parseLong(id));
|
|
|
|
|
+
|
|
|
|
|
+ if (billSubmit == null)
|
|
|
|
|
+ throw new IllegalOperatorException("此发票申请不存在");
|
|
|
|
|
+ if (!SystemSession.getUser().getEnterprise().getUu().equals(billSubmit.getSellerenuu()))
|
|
|
|
|
+ throw new IllegalOperatorException("此发票申请不属于当前企业");
|
|
|
|
|
+ if (Status.SUBMITTED.value() != billSubmit.getStatus())
|
|
|
|
|
+ throw new IllegalOperatorException("此发票申请不为待开票状态,不可开票");
|
|
|
|
|
+
|
|
|
|
|
+ billSubmit.setStatus(Status.AUDITED.value());
|
|
|
|
|
+ billSubmit.setHandleTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ String[] orderids = billSubmit.getOrderids().split(SplitChar.COMMA);
|
|
|
|
|
+ for (String orderid : orderids) {
|
|
|
|
|
+ Order order = orderDao.findOrderByOrderid(orderid);
|
|
|
|
|
+ if (order == null)
|
|
|
|
|
+ throw new IllegalOperatorException("订单: " + orderid + " 不存在,请与客服人员确认该订单");
|
|
|
|
|
+ if (!SystemSession.getUser().getEnterprise().getUu().equals(order.getSellerenuu()))
|
|
|
|
|
+ throw new IllegalOperatorException("订单: " + orderid + " 不属于当前企业,不可开票");
|
|
|
|
|
+
|
|
|
|
|
+ order.setVatBillStatus(Status.TOBERECEIVE_BILL.value());
|
|
|
|
|
+ orderDao.save(order);
|
|
|
|
|
+ }
|
|
|
|
|
+ billSubmits.add(billSubmit);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- return billSubmitDao.save(billSubmit);
|
|
|
|
|
|
|
+ billSubmitDao.save(billSubmits);
|
|
|
|
|
+ return billSubmits;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|