|
|
@@ -3,25 +3,33 @@ package restcontroller.sale.cashbill;
|
|
|
import beans.clear.ClearData;
|
|
|
import beans.data.BatchDeleteErr;
|
|
|
import beans.datacontrllog.DataContrlLog;
|
|
|
+import beans.datateam.DataTeam;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.sun.xml.internal.xsom.impl.Ref;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
+import common.annotation.cm;
|
|
|
+import common.data.*;
|
|
|
import common.data.Row;
|
|
|
-import common.data.Rows;
|
|
|
-import common.data.RowsMap;
|
|
|
-import common.data.SQLFactory;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.poi.ss.usermodel.*;
|
|
|
+import org.apache.poi.xssf.usermodel.*;
|
|
|
import restcontroller.R;
|
|
|
+import restcontroller.system.attachment.Attachment;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import static restcontroller.webmanage.saletool.orderclue.orderclue.isBigDecimal;
|
|
|
+
|
|
|
public class cashbill extends Controller {
|
|
|
|
|
|
public cashbill(JSONObject arg0) throws YosException {
|
|
|
@@ -29,6 +37,251 @@ public class cashbill extends Controller {
|
|
|
// TODO Auto-generated constructor stub
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载凭证导入单模板
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @API(title = "下载凭证导入单模板", apiversion = R.ID20230506162603.v1.class)
|
|
|
+ public String downloadCashbillExcel() throws YosException {
|
|
|
+ ExcelFactory excelFactory = new ExcelFactory("ImportTemplateForCashbill");
|
|
|
+
|
|
|
+ XSSFSheet sheet = excelFactory.getXssfWorkbook().createSheet("Sheet1");
|
|
|
+ XSSFWorkbook xssfFWorkbook = excelFactory.getXssfWorkbook();
|
|
|
+ CellStyle style = xssfFWorkbook.createCellStyle();
|
|
|
+ // 设置为文本格式,防止身份证号变成科学计数法
|
|
|
+ DataFormat format = xssfFWorkbook.createDataFormat();
|
|
|
+ style.setDataFormat(format.getFormat("@"));
|
|
|
+ // 对单独某一列进行样式赋值,第一个参数为列数,第二个参数为样式
|
|
|
+ sheet.setDefaultColumnStyle(0, style);
|
|
|
+ sheet.setDefaultColumnStyle(1, style);
|
|
|
+ sheet.setDefaultColumnStyle(2, style);
|
|
|
+ if(content.getString("type").equals("收入")){
|
|
|
+ IncomeExportExcel.setBatchDetailSheetColumn1(sheet);// 设置工作薄列宽
|
|
|
+ XSSFCellStyle titleCellStyle1 = IncomeExportExcel.createTitleCellStyle1(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle2 = IncomeExportExcel.createTitleCellStyle2(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle3 = IncomeExportExcel.createBodyCellStyle(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle4 = IncomeExportExcel.createTitleCellStyle3(xssfFWorkbook);
|
|
|
+ IncomeExportExcel.batchDetail(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, titleCellStyle4,
|
|
|
+ xssfFWorkbook);// 写入标题
|
|
|
+
|
|
|
+ }else if(content.getString("type").equals("支出")){
|
|
|
+ PayExportExcel.setBatchDetailSheetColumn1(sheet);// 设置工作薄列宽
|
|
|
+ XSSFCellStyle titleCellStyle1 = PayExportExcel.createTitleCellStyle1(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle2 = PayExportExcel.createTitleCellStyle2(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle3 = PayExportExcel.createBodyCellStyle(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle4 = PayExportExcel.createTitleCellStyle3(xssfFWorkbook);
|
|
|
+ PayExportExcel.batchDetail(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, titleCellStyle4,
|
|
|
+ xssfFWorkbook);// 写入标题
|
|
|
+ }else{
|
|
|
+ return getErrReturnObject().setErrMsg("凭证类型不匹配,无法下载导入文件").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ Rows aa = uploadExcelToObs(excelFactory);
|
|
|
+ String url = "";
|
|
|
+ if (!aa.isEmpty()) {
|
|
|
+ url = aa.get(0).getString("url");
|
|
|
+ }
|
|
|
+ return getSucReturnObject().setData(url).toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导入凭证
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @API(title = "导入凭证", apiversion = R.ID20230506162703.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = cashbill.class)
|
|
|
+ public String uploadCashbillByExcel() throws YosException {
|
|
|
+
|
|
|
+ ExcelFactory e;
|
|
|
+ try {
|
|
|
+
|
|
|
+ // 华为云
|
|
|
+ //e = getPostExcelFactory(content.getLong("attachmentid"));
|
|
|
+ // 本地
|
|
|
+ e = getPostExcelFactory();
|
|
|
+
|
|
|
+ // Rows keyRow = dbConnect.runSqlQuery("select fagentnum,faddress from tagents
|
|
|
+ // where 1=2");
|
|
|
+ // Rows row1 = e.getSheetRows(1, keyRow, 1);
|
|
|
+ ArrayList<String> keys = new ArrayList<>();
|
|
|
+ ArrayList<String> sqllist = new ArrayList<>();
|
|
|
+ keys.add("agentnum");
|
|
|
+ keys.add("accountname");
|
|
|
+ keys.add("amount");
|
|
|
+ keys.add("type");
|
|
|
+ keys.add("typemx");
|
|
|
+ keys.add("remarks");
|
|
|
+ Rows accountclassRows = dbConnect.runSqlQuery("select sa_accountclassid,accountname from sa_accountclass where siteid='"+siteid+"' and isused=1");
|
|
|
+ RowsMap accountclassRowsMap = accountclassRows.toRowsMap("accountname");
|
|
|
+
|
|
|
+ Rows agentRows = dbConnect.runSqlQuery("select agentnum,sys_enterpriseid from sa_agents where siteid='"+siteid+"'");
|
|
|
+ RowsMap agentRowsMap = agentRows.toRowsMap("agentnum");
|
|
|
+ if (!(content.getString("type") + "凭证导入")
|
|
|
+ .equals(((String) getCellFormatValue(e.getSheet(0).getRow(0).getCell(0))).replace(" ", ""))) {
|
|
|
+ return getErrReturnObject().setErrMsg("导入失败,不符合" + content.getString("type") + "凭证导入要求").toString();
|
|
|
+ }
|
|
|
+ Rows rows = e.getSheetRows(0, keys, 3);
|
|
|
+ int a = 1;
|
|
|
+ int i = 0;
|
|
|
+ // String msg = "";
|
|
|
+ boolean iserr = false;
|
|
|
+ Rows rowserr = new Rows();
|
|
|
+ Rows rowssuc = new Rows();
|
|
|
+ for (Row row : rows) {
|
|
|
+ String msg = "";
|
|
|
+ if (StringUtils.isEmpty(row.getString("agentnum"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg =msg + "【经销商编码为空】";
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(row.getString("accountname"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg = msg +"【账户名称为空】";
|
|
|
+
|
|
|
+ }
|
|
|
+ if (!isBigDecimal(row.getString("amount"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg = msg + "【金额错误:" + row.getString("amount") + "】";
|
|
|
+
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(row.getString("type"))) {
|
|
|
+ iserr = true;
|
|
|
+ msg = msg +"【分类为空】";
|
|
|
+
|
|
|
+ }
|
|
|
+ if(!agentRowsMap.containsKey(row.getString("agentnum"))){
|
|
|
+ msg = msg +"【该经销商编码找不到匹配的经销商】";
|
|
|
+ }else{
|
|
|
+ if(agentRowsMap.get(row.getString("agentnum")).isEmpty()){
|
|
|
+ msg = msg +"【该经销商编码找不到匹配的经销商】";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!accountclassRowsMap.containsKey(row.getString("accountname"))){
|
|
|
+ msg = msg +"【该账户名称找不到匹配的账户】";
|
|
|
+ }else{
|
|
|
+ if(accountclassRowsMap.get(row.getString("accountname")).isEmpty()){
|
|
|
+ msg = msg +"【该账户名称找不到匹配的账户】";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (iserr) {
|
|
|
+ row.put("msg", "错误信息:" + msg);
|
|
|
+ rowserr.add(row);
|
|
|
+ } else {
|
|
|
+ rowssuc.add(row);
|
|
|
+ }
|
|
|
+
|
|
|
+// if (!msg.equals("111")) {
|
|
|
+// XSSFWorkbook xssfFWorkbook = e.getXssfWorkbook();
|
|
|
+// XSSFCellStyle cellStyle = xssfFWorkbook.createCellStyle();
|
|
|
+//
|
|
|
+// XSSFFont font = xssfFWorkbook.createFont();
|
|
|
+//
|
|
|
+// font.setColor((short) 0xa);
|
|
|
+// font.setFontHeightInPoints((short) 8);
|
|
|
+// font.setBold(true);
|
|
|
+// cellStyle.setFont(font);
|
|
|
+// datarow.createCell(8).setCellValue("错误信息:" + msg);
|
|
|
+// datarow.getCell(8).setCellStyle(cellStyle);
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+ }
|
|
|
+ long[] sa_cashbillid = createTableID("sa_cashbill",
|
|
|
+ rowssuc.size());
|
|
|
+ if (!rowssuc.isEmpty()) {
|
|
|
+ for (Row row : rowssuc) {
|
|
|
+ SQLFactory sqlFactoryupload = new SQLFactory(this, "收支凭证新增");
|
|
|
+ sqlFactoryupload.addParameter("sa_cashbillid", sa_cashbillid[i]);
|
|
|
+ sqlFactoryupload.addParameter("billno", createBillCode("cashbill"));
|
|
|
+ if(agentRowsMap.containsKey(row.getString("agentnum"))){
|
|
|
+ sqlFactoryupload.addParameter("sys_enterpriseid", agentRowsMap.get(row.getString("agentnum")).get(0).getLong("sys_enterpriseid"));
|
|
|
+ }else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(accountclassRowsMap.containsKey(row.getString("accountname"))){
|
|
|
+ sqlFactoryupload.addParameter("sa_accountclassid", accountclassRowsMap.get(row.getString("accountname")).get(0).getLong("sa_accountclassid"));
|
|
|
+ }else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(content.getString("type").equals("收入")){
|
|
|
+ sqlFactoryupload.addParameter("type", 1);
|
|
|
+ }else{
|
|
|
+ sqlFactoryupload.addParameter("type", 0);
|
|
|
+ }
|
|
|
+ sqlFactoryupload.addParameter("siteid", siteid);
|
|
|
+ sqlFactoryupload.addParameter("remarks", row.getString("remarks"));
|
|
|
+ sqlFactoryupload.addParameter("amount", row.getString("amount"));
|
|
|
+ sqlFactoryupload.addParameter("subclass", row.getString("typemx"));
|
|
|
+ sqlFactoryupload.addParameter("class", row.getString("type"));
|
|
|
+ sqlFactoryupload.addParameter("userid", userid);
|
|
|
+ sqlFactoryupload.addParameter("username", username);
|
|
|
+ sqlFactoryupload.addParameter("ownertable", "");
|
|
|
+ sqlFactoryupload.addParameter("ownerid", 0);
|
|
|
+ sqlFactoryupload.addParameter("source", "");
|
|
|
+ sqlFactoryupload.addParameter("sourcenote", "");
|
|
|
+ sqllist.add(sqlFactoryupload.getSQL());
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (iserr) {
|
|
|
+ ExcelFactory excelFactory = new ExcelFactory("sa_cashbillerr");
|
|
|
+ HashMap<String, String> map = new HashMap<String, String>();
|
|
|
+ map.put("agentnum", "经销商编码");
|
|
|
+ map.put("accountname", "账户名称");
|
|
|
+ map.put("amount", "金额");
|
|
|
+ map.put("type", "分类");
|
|
|
+ map.put("typemx", "分类明细");
|
|
|
+ map.put("remarks", "备注");
|
|
|
+ map.put("msg", "错误信息");
|
|
|
+ ArrayList<String> colNameList = new ArrayList<String>();
|
|
|
+ HashMap<String, Class> keytypemap = new HashMap<String, Class>();
|
|
|
+ colNameList.add("agentnum");
|
|
|
+ colNameList.add("accountname");
|
|
|
+ colNameList.add("amount");
|
|
|
+ colNameList.add("type");
|
|
|
+ colNameList.add("typemx");
|
|
|
+ colNameList.add("remarks");
|
|
|
+ colNameList.add("msg");
|
|
|
+ keytypemap.put("agentnum", String.class);
|
|
|
+ keytypemap.put("accountname", String.class);
|
|
|
+ keytypemap.put("amount", String.class);
|
|
|
+ keytypemap.put("type", String.class);
|
|
|
+ keytypemap.put("typemx", String.class);
|
|
|
+ keytypemap.put("remarks", String.class);
|
|
|
+ keytypemap.put("msg", String.class);
|
|
|
+ rowserr.setFieldList(colNameList);
|
|
|
+ rowserr.setFieldTypeMap(keytypemap);
|
|
|
+ if(content.getString("type").equals("收入")){
|
|
|
+ addSheetIncome(excelFactory, "Sheet1", rowserr, map);
|
|
|
+ }else {
|
|
|
+ addSheetPay(excelFactory, "Sheet1", rowserr, map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Rows aa = uploadExcelToObs(excelFactory);
|
|
|
+ String url = "";
|
|
|
+ if (!aa.isEmpty()) {
|
|
|
+ url = aa.get(0).getString("url");
|
|
|
+ }
|
|
|
+ return getSucReturnObject().setData(url).toString();
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception e1) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e1.printStackTrace();
|
|
|
+ return getErrReturnObject().setErrMsg(e1.getMessage()).toString();
|
|
|
+ }
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@API(title = "收支凭证新建更新", apiversion = R.ID20221009102803.v1.class)
|
|
|
@CACHEING_CLEAN(apiversions = {R.ID20221009102903.v1.class, R.ID20221010102903.v1.class, R.ID20221009103003.v1.class, R.ID20230111103403.v1.class})
|
|
|
public String insertormodify_creditbill() throws YosException {
|
|
|
@@ -545,4 +798,135 @@ public class cashbill extends Controller {
|
|
|
content.put("sa_cashbillid", offsettingCashbillid);
|
|
|
return queryCashbillMain();
|
|
|
}
|
|
|
+
|
|
|
+ public Object getCellFormatValue(Cell cell) {
|
|
|
+ Object cellValue = null;
|
|
|
+ if (cell != null) {
|
|
|
+ // 判断cell类型
|
|
|
+ CellType cellType = cell.getCellType();
|
|
|
+ switch (cellType) {
|
|
|
+ case NUMERIC: {
|
|
|
+ if (DateUtil.isCellDateFormatted(cell)) {
|
|
|
+ short num = cell.getCellStyle().getDataFormat();
|
|
|
+ String format = "YYYY-mm-dd";
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat(format);
|
|
|
+ cellValue = df.format(cell.getDateCellValue());
|
|
|
+ } else {
|
|
|
+ cell.setCellType(CellType.STRING); // 将数值型cell设置为string型
|
|
|
+ cellValue = cell.getStringCellValue();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case FORMULA: {
|
|
|
+ // 判断cell是否为日期格式
|
|
|
+ if (DateUtil.isCellDateFormatted(cell)) {
|
|
|
+ // 转换为日期格式YYYY-mm-dd
|
|
|
+ cellValue = cell.getDateCellValue();
|
|
|
+ } else {
|
|
|
+ // 数字
|
|
|
+ cellValue = String.valueOf(cell.getNumericCellValue());
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case STRING: {
|
|
|
+ cellValue = cell.getRichStringCellValue().getString();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ cellValue = cell.getRichStringCellValue().getString();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ cellValue = "";
|
|
|
+ }
|
|
|
+ return cellValue;
|
|
|
+ }
|
|
|
+
|
|
|
+ public XSSFSheet addSheetIncome(ExcelFactory excelFactory, String sheetname, Rows datarows,
|
|
|
+ HashMap<String, String> titlemap) {
|
|
|
+ ArrayList<String> keylist = datarows.getFieldList();
|
|
|
+ XSSFSheet sheet = excelFactory.getXssfWorkbook().createSheet(sheetname);
|
|
|
+ XSSFWorkbook xssfFWorkbook = excelFactory.getXssfWorkbook();
|
|
|
+
|
|
|
+ XSSFCellStyle xssfCellStyle1 = xssfFWorkbook.createCellStyle();
|
|
|
+ XSSFFont font = xssfFWorkbook.createFont();
|
|
|
+
|
|
|
+ font.setColor((short) 0xa);
|
|
|
+ font.setFontHeightInPoints((short) 12);
|
|
|
+ font.setBold(true);
|
|
|
+ xssfCellStyle1.setFont(font);
|
|
|
+
|
|
|
+ IncomeExportExcel.setBatchDetailSheetColumn2(sheet);// 设置工作薄列宽
|
|
|
+ XSSFCellStyle titleCellStyle1 = IncomeExportExcel.createTitleCellStyle1(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle2 = IncomeExportExcel.createTitleCellStyle2(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle3 = IncomeExportExcel.createTitleCellStyle3(xssfFWorkbook);
|
|
|
+ IncomeExportExcel.batchDetailErr(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, xssfFWorkbook);// 写入标题
|
|
|
+
|
|
|
+ for (int n = 0; n < datarows.size(); n++) {
|
|
|
+ Row row = datarows.get(n);
|
|
|
+ XSSFRow datarow = sheet.createRow(n + 3);
|
|
|
+ for (int i1 = 0; i1 < keylist.size(); i1++) {
|
|
|
+ Class fieldclazztype = datarows.getFieldMeta(keylist.get(i1)).getFieldtype();
|
|
|
+ if (fieldclazztype == Integer.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getInteger((String) keylist.get(i1)).intValue());
|
|
|
+ } else if (fieldclazztype == Long.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getLong((String) keylist.get(i1)));
|
|
|
+ } else if (fieldclazztype == Float.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getFloat((String) keylist.get(i1)));
|
|
|
+ } else if (fieldclazztype == Double.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getDouble((String) keylist.get(i1)));
|
|
|
+ } else {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
|
+ }
|
|
|
+ if (i1 == 6) {
|
|
|
+ datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sheet;
|
|
|
+ }
|
|
|
+
|
|
|
+ public XSSFSheet addSheetPay(ExcelFactory excelFactory, String sheetname, Rows datarows,
|
|
|
+ HashMap<String, String> titlemap) {
|
|
|
+ ArrayList<String> keylist = datarows.getFieldList();
|
|
|
+ XSSFSheet sheet = excelFactory.getXssfWorkbook().createSheet(sheetname);
|
|
|
+ XSSFWorkbook xssfFWorkbook = excelFactory.getXssfWorkbook();
|
|
|
+
|
|
|
+ XSSFCellStyle xssfCellStyle1 = xssfFWorkbook.createCellStyle();
|
|
|
+ XSSFFont font = xssfFWorkbook.createFont();
|
|
|
+
|
|
|
+ font.setColor((short) 0xa);
|
|
|
+ font.setFontHeightInPoints((short) 12);
|
|
|
+ font.setBold(true);
|
|
|
+ xssfCellStyle1.setFont(font);
|
|
|
+
|
|
|
+ PayExportExcel.setBatchDetailSheetColumn2(sheet);// 设置工作薄列宽
|
|
|
+ XSSFCellStyle titleCellStyle1 = PayExportExcel.createTitleCellStyle1(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle2 = PayExportExcel.createTitleCellStyle2(xssfFWorkbook);
|
|
|
+ XSSFCellStyle titleCellStyle3 = PayExportExcel.createTitleCellStyle3(xssfFWorkbook);
|
|
|
+ PayExportExcel.batchDetailErr(sheet, titleCellStyle1, titleCellStyle2, titleCellStyle3, xssfFWorkbook);// 写入标题
|
|
|
+
|
|
|
+ for (int n = 0; n < datarows.size(); n++) {
|
|
|
+ Row row = datarows.get(n);
|
|
|
+ XSSFRow datarow = sheet.createRow(n + 3);
|
|
|
+ for (int i1 = 0; i1 < keylist.size(); i1++) {
|
|
|
+ Class fieldclazztype = datarows.getFieldMeta(keylist.get(i1)).getFieldtype();
|
|
|
+ if (fieldclazztype == Integer.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getInteger((String) keylist.get(i1)).intValue());
|
|
|
+ } else if (fieldclazztype == Long.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getLong((String) keylist.get(i1)));
|
|
|
+ } else if (fieldclazztype == Float.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getFloat((String) keylist.get(i1)));
|
|
|
+ } else if (fieldclazztype == Double.class) {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getDouble((String) keylist.get(i1)));
|
|
|
+ } else {
|
|
|
+ datarow.createCell(i1).setCellValue(row.getString((String) keylist.get(i1)));
|
|
|
+ }
|
|
|
+ if (i1 == 6) {
|
|
|
+ datarow.getCell(i1).setCellStyle(xssfCellStyle1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return sheet;
|
|
|
+ }
|
|
|
}
|