| | |
| | | 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 = "update VoucherDetail set LastUpdatedDate = ''{1}'' where VoucherID = ''{0}''"; |
| | | sql = MessageFormat.format(sql, voucherID, DateUtils.convert(new Date())); |
| | | return erpSqlServer.update(sql) > 0; |
| | | } |
| | | |
| | | } |