| | |
| | | List<Voucher> voucherList = this.selectVoucher(state); |
| | | if (!Cools.isEmpty(voucherList)) { |
| | | for (Voucher voucher : voucherList) { |
| | | VoucherDto dto = new VoucherDto(); |
| | | dto.setVoucher(voucher); |
| | | List<VoucherDetail> voucherDetails = this.selectVoucherDetail(voucher.getVoucherID()); |
| | | if (!Cools.isEmpty(voucherDetails)) { |
| | | VoucherDto dto = new VoucherDto(); |
| | | list.add(dto); |
| | | dto.setVoucher(voucher); |
| | | dto.setDetails(voucherDetails); |
| | | } else { |
| | | log.error("{}单据找不到明细,请注意检查", voucher.getVoucherID()); |
| | | } |
| | | list.add(dto); |
| | | } |
| | | } |
| | | return list; |
| | |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | /** |
| | | * 新增 VoucherDetail 表 |
| | | */ |
| | | public boolean insertVoucherDetail(VoucherDetail voucherDetail){ |
| | | String sql = "insert [VoucherDetail] ([VoucherID], [Barcode], [PickID], [LastUpdatedDate]) values (''{0}'', ''{1}'', ''{2}'', ''{3}'');"; |
| | | sql = MessageFormat.format(sql |
| | | , voucherDetail.getVoucherID() |
| | | , voucherDetail.getBarcode() |
| | | , voucherDetail.getPickID() |
| | | , voucherDetail.getLastUpdatedDate()); |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | } |