|
...
|
...
|
@@ -22,6 +22,7 @@ import org.jeecg.modules.erp.trade.entity.TblTradeBidMaterialDetails; |
|
|
|
import org.jeecg.modules.erp.trade.entity.TblTradeBidSub;
|
|
|
|
import org.jeecg.modules.erp.trade.service.ITblTradeBidMaterialDetailsService;
|
|
|
|
import org.jeecg.modules.erp.trade.service.ITblTradeBidSubService;
|
|
|
|
import org.jeecg.modules.erp.trade.vo.TblTradeTenderInfoVO;
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
...
|
...
|
@@ -241,43 +242,63 @@ public class TblTradePriceInquiryController { |
|
|
|
return Result.OK(page);
|
|
|
|
}
|
|
|
|
|
|
|
|
// /**
|
|
|
|
// * 导出excel
|
|
|
|
// *
|
|
|
|
// * @param request
|
|
|
|
// * @param tblTradePriceInquiry
|
|
|
|
// */
|
|
|
|
// @RequestMapping(value = "/exportXls")
|
|
|
|
// public ModelAndView exportXls(HttpServletRequest request, TblTradePriceInquiry tblTradePriceInquiry) {
|
|
|
|
// // Step.1 组装查询条件查询数据
|
|
|
|
// QueryWrapper<TblTradePriceInquiry> queryWrapper = QueryGenerator.initQueryWrapper(tblTradePriceInquiry, request.getParameterMap());
|
|
|
|
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
//
|
|
|
|
// //配置选中数据查询条件
|
|
|
|
// String selections = request.getParameter("selections");
|
|
|
|
// if (oConvertUtils.isNotEmpty(selections)) {
|
|
|
|
// List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
|
// queryWrapper.in("id", selectionList);
|
|
|
|
// }
|
|
|
|
// //Step.2 获取导出数据
|
|
|
|
// List<TblTradePriceInquiry> tblTradePriceInquiryList = tblTradePriceInquiryService.list(queryWrapper);
|
|
|
|
//
|
|
|
|
// // Step.3 组装pageList
|
|
|
|
// List<TblTradePriceInquiryPage> pageList = new ArrayList<TblTradePriceInquiryPage>();
|
|
|
|
// for (TblTradePriceInquiry main : tblTradePriceInquiryList) {
|
|
|
|
// TblTradePriceInquiryPage vo = new TblTradePriceInquiryPage();
|
|
|
|
// BeanUtils.copyProperties(main, vo);
|
|
|
|
// List<TblTradeTenderInfo> tblTradeTenderInfoList = tblTradeTenderInfoService.selectByMainId(main.getId());
|
|
|
|
// vo.setTblTradeTenderInfoList(tblTradeTenderInfoList);
|
|
|
|
// pageList.add(vo);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// // Step.4 AutoPoi 导出Excel
|
|
|
|
// ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
|
// mv.addObject(NormalExcelConstants.FILE_NAME, "询价表列表");
|
|
|
|
// mv.addObject(NormalExcelConstants.CLASS, TblTradePriceInquiryPage.class);
|
|
|
|
// mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("询价表数据", "导出人:" + sysUser.getRealname(), "询价表"));
|
|
|
|
// mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
|
|
// return mv;
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 导出excel
|
|
|
|
*
|
|
|
|
* 生成投标文件
|
|
|
|
* @param request
|
|
|
|
* @param tblTradePriceInquiry
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/exportXls")
|
|
|
|
public ModelAndView exportXls(HttpServletRequest request, TblTradePriceInquiry tblTradePriceInquiry) {
|
|
|
|
// Step.1 组装查询条件查询数据
|
|
|
|
QueryWrapper<TblTradePriceInquiry> queryWrapper = QueryGenerator.initQueryWrapper(tblTradePriceInquiry, request.getParameterMap());
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
// 获取导出数据
|
|
|
|
List<TblTradeTenderInfoVO> bidExcelData = tblTradePriceInquiryService.getBidExcelData(tblTradePriceInquiry.getXjbswjh());
|
|
|
|
|
|
|
|
//配置选中数据查询条件
|
|
|
|
String selections = request.getParameter("selections");
|
|
|
|
if (oConvertUtils.isNotEmpty(selections)) {
|
|
|
|
List<String> selectionList = Arrays.asList(selections.split(","));
|
|
|
|
queryWrapper.in("id", selectionList);
|
|
|
|
}
|
|
|
|
//Step.2 获取导出数据
|
|
|
|
List<TblTradePriceInquiry> tblTradePriceInquiryList = tblTradePriceInquiryService.list(queryWrapper);
|
|
|
|
|
|
|
|
// Step.3 组装pageList
|
|
|
|
List<TblTradePriceInquiryPage> pageList = new ArrayList<TblTradePriceInquiryPage>();
|
|
|
|
for (TblTradePriceInquiry main : tblTradePriceInquiryList) {
|
|
|
|
TblTradePriceInquiryPage vo = new TblTradePriceInquiryPage();
|
|
|
|
BeanUtils.copyProperties(main, vo);
|
|
|
|
List<TblTradeTenderInfo> tblTradeTenderInfoList = tblTradeTenderInfoService.selectByMainId(main.getId());
|
|
|
|
vo.setTblTradeTenderInfoList(tblTradeTenderInfoList);
|
|
|
|
pageList.add(vo);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Step.4 AutoPoi 导出Excel
|
|
|
|
// AutoPoi 导出Excel
|
|
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "询价表列表");
|
|
|
|
mv.addObject(NormalExcelConstants.CLASS, TblTradePriceInquiryPage.class);
|
|
|
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("询价表数据", "导出人:" + sysUser.getRealname(), "询价表"));
|
|
|
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
|
|
|
// mv.addObject(NormalExcelConstants.FILE_NAME, "询价表列表");
|
|
|
|
mv.addObject(NormalExcelConstants.CLASS, TblTradeTenderInfoVO.class);
|
|
|
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams(null, null, "投标表"));
|
|
|
|
mv.addObject(NormalExcelConstants.DATA_LIST, bidExcelData);
|
|
|
|
return mv;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|