|
@@ -23,6 +23,8 @@ import com.google.gson.GsonBuilder;
|
|
|
//import org.apache.shiro.SecurityUtils;
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
+import org.apache.poi.ss.util.CellRangeAddressList;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
@@ -742,6 +744,9 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
sbu.append(disSplit[1]);
|
|
|
syPreList.get(index).setDistributionPointSlash(sbu.toString());
|
|
|
}
|
|
|
+
|
|
|
+ //配码规格
|
|
|
+ String splitpeima[] = syPreList.get(index).getCodingRules().split(",");
|
|
|
//}
|
|
|
workbook.setSheetName(index,syPreList.get(index).getSupplier()+"-"+syPreList.get(index).getDistributionPointSlash()+"-"+(index+1));
|
|
|
StringBuilder builder = new StringBuilder();
|
|
@@ -783,6 +788,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
String sunBox = "";
|
|
|
String pcspack = "";//件数/每包
|
|
|
|
|
|
+
|
|
|
Row row1 = sheet.createRow(0);
|
|
|
Row row2 = sheet.createRow(1);
|
|
|
|
|
@@ -872,8 +878,27 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
|
|
|
Cell cell1 = row2.createCell(x);
|
|
|
cell1.setCellFormula("SUM("+params2[8]+"2:"+params2[size]+"2)/"+pcspack+"2*SUM(F2-E2+1)");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
index++;
|
|
|
+
|
|
|
+ CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 1, params.length-13, params.length-13);
|
|
|
+ DataValidationHelper helper = sheet.getDataValidationHelper();
|
|
|
+
|
|
|
+ DataValidationConstraint constraint = helper.createExplicitListConstraint(splitpeima);
|
|
|
+ DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList);
|
|
|
+ //处理Excel兼容性问题
|
|
|
+ if (dataValidation instanceof XSSFDataValidation) {
|
|
|
+ dataValidation.setSuppressDropDownArrow(true);
|
|
|
+ dataValidation.setShowErrorBox(true);
|
|
|
+ } else {
|
|
|
+ dataValidation.setSuppressDropDownArrow(false);
|
|
|
+ }
|
|
|
+ dataValidation.setEmptyCellAllowed(true);
|
|
|
+ dataValidation.setShowPromptBox(true);
|
|
|
+ dataValidation.createPromptBox("提示", "只能选择下拉框里面的数据");
|
|
|
+ sheet.addValidationData(dataValidation);
|
|
|
}
|
|
|
req.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
req.setCharacterEncoding("utf-8");
|