FinanceBankRemittance vo = lists.get(i);
if(vo.getReleseDate() != null && vo.getCreateDate() != null){
long interval = vo.getReleseDate().getTime() - vo.getCreateDate().getTime();
if(interval > 14*24*60*60*1000){//若票据的出票时间距今超出14天,不允许进行回头背书
vo.setBackPledgeFlag("0");//设为不允许回头背书
}
}
}
FinanceBankRemittance tempBody = body.getFinanceBankRemittance();
body.setFinanceBankRemittance(null);
body.setFinanceBankRemittanceList(lists);
body.setFinanceBankRemittance(tempBody);
return body;
}
public List getRemittanceList(BillInfo info) {
List remittacneList = new ArrayList();
List financeBankRemittanceList = (List) ibatisDao.getData("financeBankRemittance.getRemittanceListByMap",info);
remittacneList.addAll(financeBankRemittanceList);
List remittacneLists = (List) ibatisDao.getData("financeBankRemittance.getRemittanceListByBankMap",info);
remittacneList.addAll(remittacneLists);
return remittacneList;
}
public List getRemittanceBankList(BillInfo info) {
List remittacneList = new ArrayList();
remittacneList = (List) ibatisDao.getData("financeBankRemittance.getRemittanceListByBankMap",info);
return remittacneList;
}
/**
* 公共方法结束-----------------------------
*/
@Override
public void billDataDownLoad(Long billId, OutputStream os) throws Exception {
FinanceBankRemittance financeBankRemittance = new FinanceBankRemittance();
BillInfo info = new BillInfo();
info.setBillId(billId);
FinanceBankRemittance body = (FinanceBankRemittance)this.ibatisDao.getSingleRecord("FinanceBankRemittance.getWWBillInfoAndRemittanceByBillId", info);
if(body==null
body.getFinanceBankRemittanceList()==null
body.getFinanceBankRemittanceList().size()<=0){
throw new BizException(1, 0, "0001","下载票据信息失败,票据上传及审核未完成。");
}
String bankName = DictCache.getDictNameByKey(DictKey.BANK_ACCOUNT_TYPE, body.getBankAccountType());
financeBankRemittance.setBankAccount(body.getBankAccount());
financeBankRemittance.setBankAccountType(bankName);
financeBankRemittance.setBankName(body.getBankName());
financeBankRemittance.setBankRemittanceType(body.getBankRemittanceType());
financeBankRemittance.setMemberName(body.getMemberName());
financeBankRemittance.setRemittanceAmount(body.getRemittanceAmount());
financeBankRemittance.setRequestDate(body.getRequestDate());
//获取票据状态值
info.setBillType(FasesTypeEnum.REMITTANCE.getValue());
String statusName = billStatusService.getStatusNameByMap(info).getStatusName();
financeBankRemittance.setBillStatus(statusName);
List financeBankRemittanceList = new ArrayList();
financeBankRemittanceList.add(financeBankRemittance);
financeBankRemittanceList.addAll(body.getFinanceBankRemittanceList());
Workbook wb = new HSSFWorkbook();
Sheet sheet = wb.createSheet();
//获取表头
List head = this.getHead();
//设置表头样式
CellStyle titleStyle=wb.createCellStyle();
titleStyle.setAlignment(CellStyle.ALIGN_CENTER);
Font font = wb.createFont();
font.setFontName("宋体");
font.setFontHeightInPoints((short) 11);
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
titleStyle.setFont(font);
//设置第一行表头
Row row = sheet.createRow(0);
Cell cell;
sheet.createFreezePane( 0, 1, 0, 1 );
for (int i = 0; i < head.size(); i++) {
cell = row.createCell(i);
cell.setCellStyle(titleStyle);
cell.setCellValue(head.get(i));
sheet.setColumnWidth(i, 256*18);
}
//写入报表数据
CellStyle dataStyle=wb.createCellStyle();
dataStyle.setAlignment(CellStyle.ALIGN_CENTER);
Font datafont = wb.createFont();
datafont.setFontName("宋体");
datafont.setFontHeightInPoints((short) 10);
dataStyle.setFont(datafont);
for(int i = 0; i < financeBankRemittanceList.size(); i++){
FinanceBankRemittance remittance = financeBankRemittanceList.get(i);
row = sheet.createRow(i+1);
row.createCell(0).setCellValue(remittance.getBillId());
row.createCell(1).setCellValue(remittance.getTicketId());
row.createCell(2).setCellValue("专用汇票");
row.createCell(3).setCellValue("");
row.createCell(4).setCellValue(remittance.getBankName());
row.createCell(5).setCellValue("");
row.createCell(6).setCellValue("");
row.createCell(7).setCellValue("");
/*if (org.apache.commons.lang.StringUtils.equals("1", remittance.getIsBankEndorse())) {
//已背书
row.createCell(8).setCellValue("是");
}else{
row.createCell(8).setCellValue("否");
}*/
if("true".equals(remittance.getIsBankEndorse())){
row.createCell(8).setCellValue("是");
}else{
row.createCell(8).setCellValue("否");
}
row.createCell(9).setCellValue(remittance.getMemberName());
if (remittance.getValueDate() != null) {
row.createCell(10).setCellValue(remittance.getValueDate());
}else{
row.createCell(10).setCellValue("");
}
row.createCell(11).setCellValue(remittance.getRequestDate());
row.createCell(12).setCellValue(remittance.getRemittanceAmount());
row.createCell(13).setCellValue(remittance.getBillStatus());
row.createCell(14).setCellValue(remittance.getBankAccount());
row.createCell(15).setCellValue(remittance.getBankAccountType());
}
wb.write(os);
}
}
总结:以上是编辑:【雨停江南】整理及AI智能原创关于《票据是否允许回头背书
》优质内容解答希望能帮助到您。