Commit 27215469 by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents 965f7ce0 e4526a9d
......@@ -432,11 +432,19 @@ public class CollectUtil {
public static SoilExperimentCollectDataVO getDataVO(String name,String value,String gcbh,String siteNo,String expName){
SoilExperimentCollectDataVO collectData = new SoilExperimentCollectDataVO();
collectData.setName(name);
if (value.contains("%")){
value = value.replace("%","");
collectData.setUnit("%");
}
collectData.setTestValue(value);
collectData.setEntrustCode(gcbh);
collectData.setSiteNo(siteNo);
collectData.setExpName(expName);
return collectData;
}
......@@ -545,6 +553,8 @@ public class CollectUtil {
content = content.replace("灵 敏 度","灵敏度");
content = content.replace("粘 聚 力","凝聚力");
content = content.replace("粘聚力","凝聚力");
content = content.replace("原 状qu","原状Qu");
content = content.replace("重 塑qu'","重塑Qu");
content = content.replace("原 状Qu","原状Qu");
content = content.replace("重 塑Qu","重塑Qu");
content = content.replace("固结系数(t90):","固结系数(t90)");
......
......@@ -950,7 +950,7 @@ public class SoilEntrustServiceImpl extends BaseServiceImpl<SoilEntrustMapper, S
map.put("#{boreholeName}",StringHandleUtils.getString(entrust.getBoreholeName()));
map.put("#{client}",StringHandleUtils.getString(entrust.getClient()));
map.put("#{projectNo}",StringHandleUtils.getString(entrust.getProjectNo()));
map.put("#{entrustCode}","报告编号:"+StringHandleUtils.getString(entrust.getEntrustCode()));
map.put("#{entrustCode}",StringHandleUtils.getString(entrust.getEntrustCode()));
map.put("#{waterDepth}",null == entrust.getWaterDepth()?"":entrust.getWaterDepth().toString());
List<SoilPrepare> soilPrepares = soilPrepareService.list(Condition.create().setSqlSelect("prepare_date").in("sample_id",sampleIdsList).isNotNull("prepare_date"));
......
......@@ -165,7 +165,7 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
Map<String, String> mapReplace = new HashMap<>();
mapReplace.put("#{projectName}",StringHandleUtils.getString(entrust.getProjectName()));
mapReplace.put("#{reportCode}","报告编号:"+entrust.getEntrustCode());
mapReplace.put("#{reportCode}",entrust.getEntrustCode());
mapReplace.put("#{client}",StringHandleUtils.getString(entrust.getClient()));
mapReplace.put("#{boreholeName}",StringHandleUtils.getString(entrust.getBoreholeName()));
mapReplace.put("#{projectNo}",StringHandleUtils.getString(entrust.getProjectNo()));
......@@ -337,6 +337,9 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
}
List<Workbook> bookList = new ArrayList<>();
if (!AsposeUtil.getLicense()) { // 验证License 若不验证则转化出的PDP文档会有水印产生
logger.error("Aspose 认证失败");
}
Workbook workbook =null;
if (null !=xssfWorkbook){
......@@ -653,9 +656,9 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
logger.error("List<Workbook> bookList = new ArrayList<>();-----");
// if (!AsposeUtil.getLicense()) { // 验证License 若不验证则转化出的PDP文档会有水印产生
// logger.error("Aspose 认证失败");
// }
if (!AsposeUtil.getLicense()) { // 验证License 若不验证则转化出的PDP文档会有水印产生
logger.error("Aspose 认证失败");
}
Workbook workbook =null;
logger.error("7-----------------");
......@@ -875,8 +878,26 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
if (StringHandleUtils.is_alpha(dataAttribute)){
cell.setCellValue(StringHandleUtils.getFieldIfNummReturnBlankValueByFieldName(dataAttribute,vo));
}else{
if (dataAttribute.contains("固结-")){
String expName ="固结";
String itemName = dataAttribute.replace("固结-","");
if (CollectionUtils.isNotEmpty(experimentVOList)){
for (SoilExperimentVO experiment:experimentVOList) {
if (vo.getSampleCode().equals(experiment.getSampleCode())&&expName.equals(experiment.getName())){
if (dataAttribute.contains("-")){
List<SoilItem> itemList = experiment.getItemList();
if (CollectionUtils.isNotEmpty(itemList)){
for (SoilItem item:itemList) {
if (itemName.equals(item.getName())){
cell.setCellValue(item.getTestValue());
break;
}
}
}
}
}
}
} else if (dataAttribute.contains("-")){
String [] attrArrray = dataAttribute.split("-");
if (attrArrray.length < 2){
return;
......@@ -896,9 +917,7 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
if (CollectionUtils.isNotEmpty(experimentVOList)){
for (SoilExperimentVO experiment:experimentVOList) {
if (expName.equals("三轴压缩CD/CU")|| expName.equals("三轴CD/CU")){
for (int i = 0; i < 2; i++) {
if (vo.getSampleCode().equals(experiment.getSampleCode())&&"三轴压缩-CD".equals(experiment.getName())){
......@@ -927,6 +946,38 @@ public class SoilExpReportServiceImpl extends BaseServiceImpl<SoilExpReportMappe
}
}
}else if (expName.equals("颗粒分析")){
if (vo.getSampleCode().equals(experiment.getSampleCode())&&"颗粒分析-Hyd".equals(experiment.getName())){
List<SoilItem> itemList = experiment.getItemList();
if (CollectionUtils.isNotEmpty(itemList)){
for (SoilItem item:itemList) {
if (itemName.equals(item.getName())){
cell.setCellValue(item.getTestValue());
break;
}
}
}
}else if (vo.getSampleCode().equals(experiment.getSampleCode())&&"颗粒分析-Sieve".equals(experiment.getName())){
List<SoilItem> itemList = experiment.getItemList();
if (CollectionUtils.isNotEmpty(itemList)){
for (SoilItem item:itemList) {
if (itemName.equals(item.getName())){
cell.setCellValue(item.getTestValue());
break;
}
}
}
}else if (vo.getSampleCode().equals(experiment.getSampleCode())&&"颗粒分析-200".equals(experiment.getName())){
List<SoilItem> itemList = experiment.getItemList();
if (CollectionUtils.isNotEmpty(itemList)){
for (SoilItem item:itemList) {
if (itemName.equals(item.getName())){
cell.setCellValue(item.getTestValue());
break;
}
}
}
}
}else{
if (vo.getSampleCode().equals(experiment.getSampleCode())&&expName.equals(experiment.getName())){
......
......@@ -389,7 +389,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
List<SoilOriginalTemplateConfig> configList = soilOriginalTemplateConfigService.list(Condition.create().eq("template_id",templateId));
boolean attachJIeXianWater = "界限含水率 (碟式液限仪多点法)试验记录表".equals(template.getName());
boolean attachJIeXianWater = "界限含水率 (碟式液限仪多点法)试验记录表1212".equals(template.getName());
......@@ -449,7 +449,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
continue;
}
cell.setCellValue(getFieldValue(config.getDataAttribute(),vo,soilItemVOList));
cell.setCellValue(getFieldValue(config.getDataAttribute(),vo,soilItemVOS));
......@@ -671,7 +671,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int insertCount = voList.size()-templateSampleNum;
for (int m = 0 ; m<insertCount ;m++) {
for (int i = 0; i < sampleMergerNum; i++) {
sheetOne.shiftRows(insertRow, sheetOne.getLastRowNum(), 1,true,false);
XSSFRow row = sheetOne.createRow(insertRow);
row.setHeight(zeroRow.getHeight());
for (int j = 0; j < lastCellNum; j++) {
......@@ -686,11 +685,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
int sn = 1;
int xBegin1 = 9;
int xBegin2 = 10;
int xBegin3 = 11;
int xStep = 5;
Map<String,String> siteNoSampleCodeMap = new HashMap<>();
for (SoilExperimentVO vo:voList){
siteNoSampleCodeMap.put(vo.getSiteNo(),vo.getSampleCode());
......@@ -733,133 +727,12 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
if ("sn".equals(config.getDataAttribute())){
cell.setCellValue(sn);
}else{
//cell.setCellValue(StringHandleUtils.getFieldIfNummReturnBlankValueByFieldName(config.getDataAttribute(),vo));
cell.setCellValue(getFieldValue(config.getDataAttribute(),vo,soilItemVOS));
}
}
beginRow+=sampleMergerNum;
sn++;
if (attachJIeXianWater){
XSSFSheet sheet = xssfWorkbook.createSheet("附录"+vo.getSampleCode());
XSSFCellStyle style = xssfWorkbook.createCellStyle();
style.setBorderBottom(BorderStyle.THIN);
style.setBorderLeft(BorderStyle.THIN);
style.setBorderRight(BorderStyle.THIN);
style.setBorderTop(BorderStyle.THIN);
for (int i = 0; i < 5; i++) {
XSSFRow row = sheet.createRow(i);
for (int j = 0; j < 2; j++) {
XSSFCell cell = row.createCell(j);
cell.setCellStyle(style);
}
}
int row2Num = 6;
for (int i = 0; i < 3; i++) {
XSSFRow row = sheet.createRow(row2Num+i);
for (int j = 0; j < 2; j++) {
XSSFCell cell = row.createCell(j);
cell.setCellStyle(style);
}
}
int row3Num = 10;
for (int i = 0; i < 2; i++) {
XSSFRow row = sheet.createRow(row3Num+i);
for (int j = 0; j < 2; j++) {
XSSFCell cell = row.createCell(j);
cell.setCellStyle(style);
}
}
XSSFCell cell00 = sheet.getRow(0).getCell(0);
XSSFFont font = new XSSFFont();
font.setFontName("黑体");
style.setFont(font);
cell00.setCellStyle(style);
cell00.setCellValue("样品编号:");
XSSFCell cell01 = sheet.getRow(0).getCell(1);
cell01.setCellValue(vo.getSampleCode());
XSSFCell cell10 = sheet.getRow(1).getCell(0);
cell10.setCellStyle(style);
cell10.setCellValue("对数x轴");
XSSFCell cell11 = sheet.getRow(1).getCell(1);
cell11.setCellStyle(style);
cell11.setCellValue("对数");
XSSFCell cell20 = sheet.getRow(2).getCell(0);
cell20.setCellFormula("'界限含水率 (碟式液限仪多点法)'!D"+xBegin1+"");
XSSFCell cell30 = sheet.getRow(3).getCell(0);
cell30.setCellFormula("'界限含水率 (碟式液限仪多点法)'!D"+xBegin2+"");
XSSFCell cell40 = sheet.getRow(4).getCell(0);
cell40.setCellFormula("'界限含水率 (碟式液限仪多点法)'!D"+xBegin3+"");
XSSFCell cell21 = sheet.getRow(2).getCell(1);
cell21.setCellFormula("'界限含水率 (碟式液限仪多点法)'!J"+xBegin1+"");
XSSFCell cell31 = sheet.getRow(3).getCell(1);
cell31.setCellFormula("'界限含水率 (碟式液限仪多点法)'!J"+xBegin2+"");
XSSFCell cell41 = sheet.getRow(4).getCell(1);
cell41.setCellFormula("'界限含水率 (碟式液限仪多点法)'!J"+xBegin3+"");
XSSFCell cell60 = sheet.getRow(6).getCell(0);
cell60.setCellValue("备注:y=kx+b");
XSSFCell cell70 = sheet.getRow(7).getCell(0);
cell70.setCellValue("k:");
XSSFCell cell80 = sheet.getRow(8).getCell(0);
cell80.setCellValue("b:");
XSSFCell cell71 = sheet.getRow(7).getCell(1);
cell71.setCellFormula("INDEX(LINEST(B3:B5,A3:A5,1,0),1,1)");
XSSFCell cell81 = sheet.getRow(8).getCell(1);
cell81.setCellFormula("INDEX(LINEST(B3:B5,A3:A5,1,0),1,2)");
XSSFCell cell100 = sheet.getRow(10).getCell(0);
cell100.setCellValue("液限(%) Liquid Limit");
XSSFCell cell101 = sheet.getRow(10).getCell(1);
cell101.setCellFormula("(B8*LOG10(25)+B9)");
GenerateChart(sheet,"'界限含水率 (碟式液限仪多点法)'!$D$"+xBegin1+":"+"$D$"+xBegin3,"'界限含水率 (碟式液限仪多点法)'!$J$"+xBegin1+":$J$"+xBegin3);
xBegin1+=xStep;
xBegin2+=xStep;
xBegin3+=xStep;
}
}
for (SoilOriginalTemplateConfig config:configList) {
if (null==config.getMergeRowNum()){
......@@ -977,9 +850,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}else{
teshuCell.setCellFormula("'附录"+code+"'!B11");
}
}
}
sampleBgMum=sampleBgMum+3;
}else{
......@@ -996,28 +867,11 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}
indexJishu++;
}
}
}
}
}
logger.error("----------------------15");
if (attachJIeXianWater){
int begin = 8;
int step = 5;
for (int i = 0; i < templateSampleNum; i++) {
XSSFCell xssfCell = sheetOne.getRow(begin).getCell(10);
xssfCell.setCellFormula("'附录"+voList.get(i).getSampleCode()+"'!B11");
begin+=step;
}
}
}
}
}else{
......@@ -1125,7 +979,6 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
}else{
mapReplace.put("#{密度9.81}","");
}
// HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,sheet);
nextSample++;
HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,sheet);
}
......@@ -1177,22 +1030,13 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
mapReplace.put("#{密度9.81}","");
}
HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,xssfSheet);
// int numSheet = xssfWorkbook.getNumberOfSheets();
// for (int i = 0; i < numSheet; i++) {
// HSSFWorkbookUtil.replaceModel(mapReplace,xssfWorkbook,xssfWorkbook.getSheetAt(i));
// }
int length = voList.size();
// for (int i = 0; i < length; i++) {
//
//
// }
}else{
List<List<SoilExperimentVO>> relList= ListUtils.partition(voList,templateSampleNum);
int templateSheetMum = xssfWorkbook.getNumberOfSheets();
XSSFSheet sheetMy = xssfWorkbook.getSheetAt(0);
PrintSetup printSetup= sheetMy.getPrintSetup();
boolean printRound= printSetup.getLandscape();
boolean first = true;
List<SoilExperimentVO> firstList = null;
......@@ -1206,6 +1050,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
continue;
}else{
sheet = xssfWorkbook.cloneSheet(0,sheetMy.getSheetName()+(templateSheetMum));
sheet.getPrintSetup().setLandscape(printRound);
}
Map<String,String> mapReplaceMy = new HashMap<>();
mapReplaceMy.put("#{reportCode}",entrust.getEntrustCode());
......@@ -1852,7 +1697,7 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
XSSFSheet sheetOne = xssfWorkbook.getSheetAt(0);
Map<String, String> mapReplace = new HashMap<>();
mapReplace.put("#{projectName}",entrust.getProjectName());
mapReplace.put("#{reportCode}","报告编号:"+entrust.getEntrustCode());
mapReplace.put("#{reportCode}",entrust.getEntrustCode());
mapReplace.put("#{client}",entrust.getClient());
mapReplace.put("#{boreholeName}",entrust.getBoreholeName());
mapReplace.put("#{projectNo}",entrust.getProjectNo());
......@@ -2632,7 +2477,8 @@ public class SoilExperimentServiceImpl extends BaseServiceImpl<SoilExperimentMap
mapReplace.put("#{boreholeName}",StringHandleUtils.getString(entrust.getBoreholeName()));
mapReplace.put("#{client}",StringHandleUtils.getString(entrust.getClient()));
mapReplace.put("#{projectNo}",StringHandleUtils.getString(entrust.getProjectNo()));
mapReplace.put("#{entrustCode}","报告编号:"+StringHandleUtils.getString(entrust.getEntrustCode()));
mapReplace.put("#{projectName}",StringHandleUtils.getString(entrust.getProjectName()));
mapReplace.put("#{entrustCode}",StringHandleUtils.getString(entrust.getEntrustCode()));
mapReplace.put("#{waterDepth}",null == entrust.getWaterDepth()?"":entrust.getWaterDepth().toString());
List<SoilPrepare> soilPrepares = soilPrepareService.list(Condition.create().setSqlSelect("prepare_date").in("sample_id",sampleIdsList).isNotNull("prepare_date"));
......
......@@ -404,8 +404,11 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
for (int i = sampleBeginRow;i<lastRowNum;i+=sampleMergerNum) {
for (int i = sampleBeginRow;i<=lastRowNum;i+=sampleMergerNum) {
XSSFRow xssfRow = sheet.getRow(i);
if (null == xssfRow){
continue;
}
XSSFCell sampleCodeCell = xssfRow.getCell(sampleCol);
String sampleCode = HSSFWorkbookUtil.getJavaValue(sampleCodeCell).toString();
String sampleOfStatus ="";
......@@ -423,11 +426,6 @@ public class SoilOriginalTemplateServiceImpl extends BaseServiceImpl<SoilOrigina
shortNames = HSSFWorkbookUtil.getJavaValue(shortNameCell).toString();
}
for (ItemCollectEntity collectEntity:collectEntitiesList) {
if (null!=collectEntity.getSingleElse()){
XSSFRow row = sheet.getRow(collectEntity.getItemMegerRow());
......
<License>
<Data>
<Data>
<LicensedTo>南京中普安信</LicensedTo>
<EmailTo>zhangmengqi@qd-partner.com</EmailTo>
<LicenseType>Developer Small Business</LicenseType>
<LicenseNote>1 Developer And 1 Deployment Location</LicenseNote>
<OrderID>210401015312</OrderID>
<UserID>879938</UserID>
<OEM>This is not a redistributable license</OEM>
<Products>
<Product>Aspose.Total for Java</Product>
<Product>Aspose.Words for Java</Product>
<Product>Aspose.Cells Product Family</Product>
</Products>
<EditionType>Enterprise</EditionType>
<SubscriptionExpiry>20991231</SubscriptionExpiry>
<LicenseExpiry>20991231</LicenseExpiry>
<SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>
</Data>
<Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>
<EditionType>Professional</EditionType>
<SerialNumber>511eb1f9-57ff-4254-bbeb-b9ee82f390cb</SerialNumber>
<SubscriptionExpiry>20220401</SubscriptionExpiry>
<LicenseExpiry>20210501</LicenseExpiry>
<ExpiryNote>This is a temporary license for non-commercial use only and it will expire on 2021-05-01</ExpiryNote>
<LicenseVersion>3.0</LicenseVersion>
<LicenseInstructions>https://purchase.aspose.com/policies/use-license</LicenseInstructions>
</Data>
<Signature>gvk7I3r/lKw/n0K5FhxBBvoAgyYZ/HwbguDGsOCzMFvhbYAabwxly9RVncRENZLSMiZ570I+lG/NK9cfq9IRxyS/2mvuM0IKfIX7QVtnzUZof4/bU55/dj1+obPI6j7T8E+oCqo8O1ec/BdAGw05tJ+GlWvvhcaBfJw9C5b4CRU=</Signature>
</License>
\ No newline at end of file
......@@ -11,24 +11,23 @@ import java.math.BigDecimal;
public class Test {
public static void main(String[] args) {
try {
Workbook workbook1 = new Workbook("D://excel//封面.xlsx");
Workbook workbook2 = new Workbook("D://excel//检测报告(力学试验)三轴.xlsx");
Workbook workbook3 = new Workbook("D://excel//检测报告(力学试验)手动十字板.xlsx");
Workbook workbook4 = new Workbook("D://excel//检测报告(力学试验)休止角.xlsx");
Workbook workbook5 = new Workbook("D://excel//检测报告(力学试验)袖珍贯入仪.xlsx");
Workbook workbook6 = new Workbook("D://excel//检测报告(力学试验)直剪.xlsx");
Workbook workbook7 = new Workbook("D://excel//附件.xlsx");
workbook1.combine(workbook2);
workbook1.combine(workbook3);
workbook1.combine(workbook4);
workbook1.combine(workbook5);
workbook1.combine(workbook6);
workbook1.combine(workbook7);
XSSFWorkbook workbook2 = new XSSFWorkbook(new File("D://颗粒分析实验(甲种)2.xlsx"));
XSSFWorkbook workbook3 = new XSSFWorkbook(new File("D://颗粒分析实验(甲种)3.xlsx"));
int num = workbook3.getNumberOfSheets();
for (int i = 0; i < num; i++) {
//workbook2.cloneSheet()
}
FileOutputStream fileOut=null;
String allFileName = "d:/excel/0.xlsx";
fileOut = new FileOutputStream(allFileName);
workbook1.save(fileOut, SaveFormat.XLSX);
File file = new File(allFileName);
XSSFWorkbook workbook = new XSSFWorkbook(file);
......
INSERT INTO "public"."sys_resource"("id", "system_id", "pid", "name", "type", "code", "uri", "icon", "remark", "status", "sort", "ctime", "ename") VALUES (1377104732162490370, 1304006677087891457, 1304299839215878145, '按项目录入-物性上传图片', 1, 'do-test-sample-item-right-file-physical', '/', NULL, NULL, 1, 1, '2021-03-31 11:45:28.173', NULL);
INSERT INTO "public"."sys_resource"("id", "system_id", "pid", "name", "type", "code", "uri", "icon", "remark", "status", "sort", "ctime", "ename") VALUES (1377104732162490370, 1304006677087891457, 1304299839215878145, '按项目录入-物性上传图片', 1, 'do-test-sample-item-right-file-physical', '/', NULL, NULL, 1, 1, '2021-03-31 11:45:28.173', NULL);
INSERT INTO "public"."sys_resource"("id", "system_id", "pid", "name", "type", "code", "uri", "icon", "remark", "status", "sort", "ctime", "ename") VALUES (1377104795962048514, 1304006677087891457, 1304299839215878145, '按项目录入-界限含水率上传采集', 1, 'do-test-sample-item-right-file-moisture', '/', NULL, NULL, 1, 1, '2021-03-31 11:45:43.384', NULL);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment