| | |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.slf4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName AssetImportSmoImpl |
| | |
| | | public ResponseEntity<Object> exportExcelData(IPageData pd) throws Exception { |
| | | |
| | | ComponentValidateResult result = this.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | Map pdHeaders = pd.getHeaders(); |
| | | if (!StringUtil.isEmpty(result.getStoreId())) { |
| | | pdHeaders.remove("store-id"); |
| | | pdHeaders.put("store-id", result.getStoreId()); |
| | | } |
| | | if (!StringUtil.isEmpty(result.getLoginUserId())) { |
| | | pdHeaders.remove("user-id"); |
| | | pdHeaders.remove("user_id"); |
| | | pdHeaders.put("user-id", result.getUserId()); |
| | | pdHeaders.put("user_id", result.getUserId()); |
| | | pdHeaders.put("login-user-id",result.getLoginUserId()); |
| | | } |
| | | |
| | | Assert.hasKeyAndValue(JSONObject.parseObject(pd.getReqData()), "communityId", "请求中未包含小区"); |
| | | Assert.hasKeyAndValue(JSONObject.parseObject(pd.getReqData()), "pagePath", "请求中未包含页面"); |
| | | |
| | | Workbook workbook = null; //工作簿 |
| | | SXSSFWorkbook workbook = null; //工作簿 |
| | | String userId = ""; |
| | | //工作表 |
| | | workbook = new XSSFWorkbook(); |
| | | workbook = new SXSSFWorkbook(); |
| | | workbook.setCompressTempFiles(false); |
| | | JSONObject reqJson = JSONObject.parseObject(pd.getReqData()); |
| | | String pagePath = reqJson.getString("pagePath"); |
| | | |
| | |
| | | row.createCell(11).setCellValue("申请数量"); |
| | | row.createCell(12).setCellValue("采购/出库数量"); |
| | | row.createCell(13).setCellValue("采购价格"); |
| | | row.createCell(14).setCellValue("采购总价"); |
| | | row.createCell(14).setCellValue("总价"); |
| | | row.createCell(15).setCellValue("申请备注"); |
| | | row.createCell(16).setCellValue("状态"); |
| | | row.createCell(17).setCellValue("创建时间"); |
| | |
| | | row.createCell(11).setCellValue(dataObj.getString("quantity") + dataObj.getString("unitCodeName")); |
| | | row.createCell(12).setCellValue(dataObj.getString("purchaseQuantity") + dataObj.getString("unitCodeName")); |
| | | row.createCell(13).setCellValue(dataObj.getString("price")); |
| | | if (!StringUtil.isEmpty(dataObj.getString("resOrderType")) && dataObj.getString("resOrderType").equals("10000") && |
| | | !StringUtil.isEmpty(dataObj.getString("purchaseQuantity")) && !StringUtil.isEmpty(dataObj.getString("price"))) { //状态是入库 |
| | | //!StringUtil.isEmpty(dataObj.getString("resOrderType")) && dataObj.getString("resOrderType").equals("10000") && |
| | | if (!StringUtil.isEmpty(dataObj.getString("purchaseQuantity")) && !StringUtil.isEmpty(dataObj.getString("price"))) { //状态是入库 |
| | | //获取采购数量 |
| | | double purchaseQuantity = Double.parseDouble(dataObj.getString("purchaseQuantity")); |
| | | //获取采购单价 |
| | |
| | | JSONObject reqJson = JSONObject.parseObject(pd.getReqData()); |
| | | reqJson.put("page", 1); |
| | | reqJson.put("row", 10000); |
| | | apiUrl = "/reportFeeMonthStatistics/queryReportFeeSummary" + mapToUrlParam(reqJson); |
| | | apiUrl = "/reportFeeMonthStatistics.queryReportFeeSummary" + mapToUrlParam(reqJson); |
| | | responseEntity = this.callCenterService(restTemplate, pd, "", apiUrl, HttpMethod.GET); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { //跳过 保存单元信息 |
| | | return null; |