|
@@ -39,6 +39,7 @@ import com.jeeplus.modules.workfullmanage.service.WorkFullManageService;
|
|
|
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
|
|
|
import com.jeeplus.modules.workprojectnotify.entity.WorkProjectNotify;
|
|
|
import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
|
|
|
+import com.jeeplus.modules.workreimbursement.entity.ReimbursementVATTax;
|
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkAccount;
|
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkReimbursement;
|
|
|
import com.jeeplus.modules.workreimbursement.entity.WorkReimbursementTypeInfo;
|
|
@@ -125,6 +126,8 @@ public class WorkReimbursementAllController extends BaseController {
|
|
|
private WorkReimbursementTypeService workReimbursementTypeService;
|
|
|
@Autowired
|
|
|
protected WorkProjectNotifyService workProjectNotifyService;
|
|
|
+ @Autowired
|
|
|
+ protected WorkReimbursementService workRService;
|
|
|
|
|
|
@ModelAttribute
|
|
|
public WorkReimbursement get(@RequestParam(required=false) String id) {
|
|
@@ -457,6 +460,29 @@ public class WorkReimbursementAllController extends BaseController {
|
|
|
}
|
|
|
return "redirect:"+Global.getAdminPath()+"/workreimbursement/workReimbursementAll/?repage";
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 导出电子发票报销excel文件
|
|
|
+ */
|
|
|
+ @RequiresPermissions("workreimbursement:workReimbursement:export")
|
|
|
+ @RequestMapping(value = "electronicInvoiceExport", method=RequestMethod.POST)
|
|
|
+ public String electronicInvoiceExportFile(WorkReimbursement workReimbursement, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
+ try {
|
|
|
+ String fileName = "报销电子发票明细表"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
+ Page<WorkReimbursement> page = workReimbursementService.findPage(new Page<WorkReimbursement>(request, response, -1), workReimbursement);
|
|
|
+ List<String> idList = Lists.newArrayList();
|
|
|
+ for (WorkReimbursement reimbursement : page.getList()) {
|
|
|
+ idList.add(reimbursement.getId());
|
|
|
+ }
|
|
|
+ List<ReimbursementVATTax> electronicInvoiceList = workRService.getElectronicInvoiceList(idList);
|
|
|
+ String agent = request.getHeader("USER-AGENT");
|
|
|
+ new ExportExcel("报销电子发票明细表", ReimbursementVATTax.class).setDataList(electronicInvoiceList).write(response, fileName,agent).dispose();
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "导出报销电子发票明细表失败!失败信息:"+e.getMessage());
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/workreimbursement/workReimbursementAll/?repage";
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 导入Excel数据
|