dev
parent
5ee74e8b9b
commit
7b6c06f02f
|
|
@ -120,4 +120,22 @@ public class InvoiceReceiveController extends Controller {
|
|||
InvoiceReceive model = getModel(InvoiceReceive.class, "", true); // 忽略不在model中的字段
|
||||
renderJson(InvoiceReceiveService.me.findByPk(model));
|
||||
}
|
||||
|
||||
public void nextInvoice() {
|
||||
Integer supermarket_id = getInt("supermarket_id", 0);
|
||||
|
||||
InvoiceReceive receive = InvoiceReceiveService.me.foremostReceive(supermarket_id);
|
||||
if (receive == null) {
|
||||
renderJson(Result.failed("没有有效的领用记录"));
|
||||
return;
|
||||
}
|
||||
|
||||
String next_invoice_code = InvoiceReceiveService.me.nextInvoice(receive);
|
||||
if (next_invoice_code == null) {
|
||||
renderJson(Result.failed("没有可用发票"));
|
||||
return;
|
||||
}
|
||||
|
||||
renderJson(Result.success(next_invoice_code));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue