Browse Source

feat: 一键删除及一些针对碧桂园的处理

upgrade
Zhenfei.Li 5 years ago
parent
commit
f4c9b19b3e
  1. BIN
      fr-plugin-hwExcelExport-1.8.3.zip
  2. 3
      src/main/java/com/fr/plugin/decision/core/ExcelDmlBean.java
  3. 4
      src/main/java/com/fr/plugin/decision/request/handler/CheckSizeHandler.java
  4. 22
      src/main/java/com/fr/plugin/decision/request/handler/UpgradeHandler.java
  5. 9
      src/main/resources/com/fr/plugin/hw/decision/js/pane/left.linklist.js
  6. 8
      src/main/resources/com/fr/plugin/hw/decision/js/pane/left.linklist.model.js
  7. 2
      src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js

BIN
fr-plugin-hwExcelExport-1.8.3.zip

Binary file not shown.

3
src/main/java/com/fr/plugin/decision/core/ExcelDmlBean.java

@ -34,7 +34,10 @@ public class ExcelDmlBean {
}
table = new Table(schema, tableName);
rowCount = 0;
if (tableValue.size() > 0 && tableColName.size() > 0) {
rowCount = tableValue.get(tableColName.get(0)).size();
};
}
public List<Boolean> getTablePrimaryKey() {

4
src/main/java/com/fr/plugin/decision/request/handler/CheckSizeHandler.java

@ -6,7 +6,7 @@ import com.finebi.common.impl.vo.table.FineExcelBusinessTable;
import com.finebi.dashboard.impl.service.helper.FineDashBoardTableHelper;
import com.finebi.direct.burger.api.service.FineUserInfoService;
import com.finebi.direct.common.api.cell.context.CellCreator;
import com.finebi.direct.common.api.cell.user.authority.UserAuthority;
import com.finebi.common.api.cell.user.authority.UserAuthority;
import com.finebi.direct.common.impl.engine.BurgerTableDataCellImpl;
import com.finebi.foundation.api.service.FineService;
import com.finebi.foundation.api.service.context.BaseContext;
@ -43,7 +43,7 @@ public class CheckSizeHandler extends HWAbstractHandler {
if (fineBusinessTable instanceof FineExcelBusinessTable) {
try {
UserAuthority authorityUser = getFineUserInfoService().getUserAuthority(req);
Optional<BIDetailResult> data = new BurgerTableDataCellImpl().getRealDataWithAuth(fineBusinessTable, new ConfLimitInfo(30000, new ConfPageInfo()), authorityUser);
Optional<BIDetailResult> data = new BurgerTableDataCellImpl().getRealDataWithAuth(fineBusinessTable, new ConfLimitInfo(500000, new ConfPageInfo()), authorityUser);
BIDetailResult detailResult = data.get();
JSONObject excel = JSONObject.create();

22
src/main/java/com/fr/plugin/decision/request/handler/UpgradeHandler.java

@ -11,7 +11,7 @@ import com.finebi.common.impl.vo.relation.FineBusinessRelation;
import com.finebi.common.impl.vo.table.FineDBBusinessTable;
import com.finebi.direct.burger.api.service.FineTableService;
import com.finebi.direct.burger.api.service.FineUserInfoService;
import com.finebi.direct.common.api.cell.user.authority.UserAuthority;
import com.finebi.common.api.cell.user.authority.UserAuthority;
import com.finebi.foundation.api.reponse.FineRespond;
import com.finebi.foundation.api.service.FineService;
import com.finebi.foundation.api.service.context.BaseContext;
@ -32,6 +32,7 @@ import com.fr.third.fasterxml.jackson.databind.JsonMappingException;
import com.fr.third.fasterxml.jackson.databind.ObjectMapper;
import com.fr.third.org.apache.poi.hssf.usermodel.HSSFSheet;
import com.fr.third.org.apache.poi.hssf.usermodel.HSSFWorkbook;
import com.fr.third.v2.org.apache.poi.xssf.streaming.SXSSFWorkbook;
import com.fr.third.v2.org.apache.poi.xssf.usermodel.XSSFSheet;
import com.fr.third.v2.org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.finebi.direct.common.api.cell.context.CellCreator;
@ -71,9 +72,8 @@ public class UpgradeHandler extends HWAbstractHandler {
JSONObject finalResult = JSONObject.create();
List<FineBusinessTable> allTables = CellCreator.getCellProvider().tableCell().getAllTableWithoutAuth();
allTables.forEach(fineBusinessTable -> {
allTables.stream().filter(fineBusinessTable -> fineBusinessTable instanceof FineExcelBusinessTable).limit(15).forEach(fineBusinessTable -> {
Map<String, List> values = new HashMap<String, List>();
if (fineBusinessTable instanceof FineExcelBusinessTable) {
JSONArray items = JSONArray.create();
FineAttachment sheetInfo = ((FineExcelBusinessTable) fineBusinessTable).getBaseAttach();
String attachId = sheetInfo.getId();
@ -82,17 +82,21 @@ public class UpgradeHandler extends HWAbstractHandler {
List<FineBusinessField> fields = ((FineExcelBusinessTable) fineBusinessTable).getExcelFields();
try {
if (fileName.endsWith(".xlsx")) {
XSSFWorkbook excelWork = HWUtils.getExcelWork(attachId);
if(excelWork != null){
XSSFSheet sheet = excelWork.getSheetAt(sheetNo);
SXSSFWorkbook swb = new SXSSFWorkbook(excelWork,100);
XSSFWorkbook xssfWorkbook = swb.getXSSFWorkbook();
XSSFSheet sheet = xssfWorkbook.getSheetAt(sheetNo);
JSONObject tableCol = JSONObject.create();
for(int i = 0; i < fields.size(); i++){
FineBusinessField field = fields.get(i);
tableCol.put(field.getName(), i);
JSONObject item = new JSONObject();
item.put("colLength", "255");
item.put("colLength", "8000");
item.put("colName", field.getName());
item.put("colType", this.getFieldSqlType(field.getType()));
item.put("excelCol", i);
@ -112,7 +116,7 @@ public class UpgradeHandler extends HWAbstractHandler {
tableCol.put(field.getName(), i);
JSONObject item = new JSONObject();
item.put("colLength", "255");
item.put("colLength", "8000");
item.put("colName", field.getName());
item.put("colType", this.getFieldSqlType(field.getType()));
item.put("excelCol", i);
@ -123,6 +127,9 @@ public class UpgradeHandler extends HWAbstractHandler {
values = HWUtils.get2003SheetContent(sheetAt,0, tableCol);
}
}
} catch (Exception e) {
e.printStackTrace();
}
String schema = "";
String tableName = fineBusinessTable.getName();
@ -177,9 +184,6 @@ public class UpgradeHandler extends HWAbstractHandler {
} catch(Exception e){
e.printStackTrace();
}
}
});
WebUtils.printAsJSON(res, finalResult.put("importDbResult", importDbResult).put("addDbResult", addDbResult));

9
src/main/resources/com/fr/plugin/hw/decision/js/pane/left.linklist.js

@ -45,6 +45,15 @@
self.linkListPane = _ref;
}
}, top: 10, left: 0, right: 0, bottom: 10
}, {
el: {
type: "bi.button",
text: "一键删除",
height: 24,
handler: function () {
self.store.deleteAllLink();
}
}, top: -34, left: 100, right: 50, bottom: -10
}]
};
},

8
src/main/resources/com/fr/plugin/hw/decision/js/pane/left.linklist.model.js

@ -89,6 +89,14 @@
BI.emptyFn)
},
//删除全部: 仅内部人员使用
deleteAllLink: function(){
var self = this;
BI.each(self.model.linklist, function (i, v) {
self.deleteLink(v.id);
});
},
setSelectedLink: function(v){
this.model.selectedLink = v;
}

2
src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js

@ -5,7 +5,7 @@
return {
items: [],
connection: "",
schema: "",
schema: "guest",
tableName: "",
excelItems: [],
infoId: o.infoId,

Loading…
Cancel
Save