|
@@ -24,6 +24,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
|
|
|
import org.jsoup.Jsoup;
|
|
|
import org.jsoup.nodes.Document;
|
|
|
import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.nodes.Node;
|
|
|
import org.jsoup.select.Elements;
|
|
|
import org.springblade.business.entity.ContractLog;
|
|
|
import org.springblade.business.entity.InformationQuery;
|
|
@@ -2408,11 +2409,35 @@ public class ExcelTabController extends BladeController {
|
|
|
pic.setHeight(Height);
|
|
|
sheet.getCellRange(y1, x1).getStyle().setShrinkToFit(true);
|
|
|
|
|
|
- } else if (myData.equals("1") && data.html().indexOf("hc-form-checkbox-group") >= 0) {
|
|
|
- CellRange cell = sheet.getCellRange(y1, x1);
|
|
|
- String exceVal = cell.getText().replaceAll(" ", "");
|
|
|
- cell.getCellStyle().getExcelFont().setFontName("EUDC");
|
|
|
- cell.setText(exceVal.replace("□", "\u2611"));
|
|
|
+ } else if (data.html().indexOf("hc-form-checkbox-group") >= 0) {
|
|
|
+ CellRange cellRange = sheet.getCellRange(y1, x1);
|
|
|
+ String exceVal = cellRange.getValue().replaceAll(" ", "");
|
|
|
+ //如果有□ 代表 自动生成 如果没有 代表后期添加 需要显示html 中的值
|
|
|
+ if (exceVal.indexOf("□") >= 0) {
|
|
|
+ if (myData.equals("1")) {
|
|
|
+ cellRange.setValue(exceVal.replace("□", "\u2611"));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<Node> nodes = data.childNodes();
|
|
|
+ Node node = nodes.get(nodes.size() -1);
|
|
|
+ String dataJson = node.attr(":objs");
|
|
|
+ if (StringUtils.isNotEmpty(dataJson)) {
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(dataJson);
|
|
|
+ List<Integer> idList = Func.toIntList(myData);
|
|
|
+ int indexx = 0;
|
|
|
+ if (idList.get(0) >= 1) {
|
|
|
+ indexx = idList.get(0) - 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ String dataInfo = jsonArray.getJSONObject(indexx).getString("name");
|
|
|
+ for (int inx = 1; inx < idList.size(); inx++) {
|
|
|
+ int valIndex = idList.get(inx) - 1;
|
|
|
+ dataInfo = dataInfo + "," + jsonArray.getJSONObject(valIndex).getString("name");
|
|
|
+ }
|
|
|
+ cellRange.setValue(dataInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
} else {
|
|
|
final CellRange cellRange = sheet.getCellRange(y1, x1);
|
|
|
cellRange.setText(myData);
|