|
|
@@ -107,7 +107,7 @@ public class BillSubmitServiceImpl implements BillSubmitService {
|
|
|
return billSubmitDao.save(billSubmits);
|
|
|
}
|
|
|
|
|
|
- // 初始化发票申请
|
|
|
+ // 初始化发票申请(用户发起用)
|
|
|
public BillSubmit createBillSubmit(Bill bill, List<Order> orders, Long buyerEnuu) {
|
|
|
Long buyeruu = SystemSession.getUser().getUserUU();
|
|
|
// 发票基本信息
|
|
|
@@ -156,6 +156,43 @@ public class BillSubmitServiceImpl implements BillSubmitService {
|
|
|
return billSubmit;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public BillSubmit saveByAdmin(Order order) {
|
|
|
+ Bill bill = billDao.findOne(order.getInvoiceid());
|
|
|
+ if (bill == null) {
|
|
|
+ throw new IllegalOperatorException("买家选择需要开票,但发票信息不存在,请重新确认");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 发票基本信息
|
|
|
+ BillSubmit billSubmit = new BillSubmit();
|
|
|
+ billSubmit.setInvoicetitle(bill.getHead());
|
|
|
+ billSubmit.setInvoiceid(bill.getId());
|
|
|
+ billSubmit.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
|
|
|
+ billSubmit.setInvoicetype(bill.getKind());
|
|
|
+ billSubmit.setCreateTime(new Date());
|
|
|
+ billSubmit.setReceiverName(bill.getName());
|
|
|
+ billSubmit.setRecTel(bill.getTelephone());
|
|
|
+ billSubmit.setStatus(Status.SUBMITTED.value());
|
|
|
+ billSubmit.setSubmituu(order.getBuyeruu());
|
|
|
+ if (order.getBuyerenuu() != null)
|
|
|
+ billSubmit.setSubmitEnuu(order.getBuyerenuu());
|
|
|
+
|
|
|
+ billSubmit.setSellername(order.getSellername());
|
|
|
+ billSubmit.setSellerenuu(order.getSellerenuu());
|
|
|
+
|
|
|
+ order.setInvoicetype(bill.getKind());
|
|
|
+ order.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
|
|
|
+ order.setInvoiceid(bill.getId());
|
|
|
+ order.setInvoicetitle(bill.getHead());
|
|
|
+ order.setVatBillStatus(Status.TOBEMAKE_BILL.value());
|
|
|
+ orderDao.save(order);
|
|
|
+
|
|
|
+ billSubmit.setPrice(order.getPrice());
|
|
|
+ billSubmit.setOrderids(order.getOrderid());
|
|
|
+
|
|
|
+ return billSubmitDao.save(billSubmit);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Page<BillSubmit> getAll(final PageInfo pageInfo, String keyword, String invoicetype , String status, String role) {
|
|
|
if (Type.BUYER.name().equals(role)) {
|