|
@@ -8,14 +8,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.itextpdf.html2pdf.ConverterProperties;
|
|
import com.itextpdf.html2pdf.ConverterProperties;
|
|
-import com.itextpdf.html2pdf.HtmlConverter;
|
|
|
|
import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
|
|
import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
|
|
import com.itextpdf.io.font.FontProgram;
|
|
import com.itextpdf.io.font.FontProgram;
|
|
import com.itextpdf.io.font.FontProgramFactory;
|
|
import com.itextpdf.io.font.FontProgramFactory;
|
|
-import com.itextpdf.kernel.geom.PageSize;
|
|
|
|
-import com.itextpdf.kernel.pdf.PdfDocument;
|
|
|
|
-import com.itextpdf.kernel.pdf.PdfPage;
|
|
|
|
-import com.itextpdf.kernel.pdf.PdfWriter;
|
|
|
|
import com.itextpdf.layout.font.FontProvider;
|
|
import com.itextpdf.layout.font.FontProvider;
|
|
import com.spire.xls.Workbook;
|
|
import com.spire.xls.Workbook;
|
|
import com.spire.xls.Worksheet;
|
|
import com.spire.xls.Worksheet;
|
|
@@ -44,7 +39,6 @@ import org.springblade.manager.mapper.WbsTreePrivateMapper;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.service.*;
|
|
import org.springblade.manager.unit.FileUtils;
|
|
import org.springblade.manager.unit.FileUtils;
|
|
import org.springblade.manager.unit.HtmlToPdf;
|
|
import org.springblade.manager.unit.HtmlToPdf;
|
|
-import org.springblade.manager.unit.PdfConvertA4Utils;
|
|
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.vo.*;
|
|
import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
import org.springblade.manager.wrapper.ExcelTabWrapper;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
import org.springblade.resource.feign.CommonFileClient;
|
|
@@ -186,6 +180,9 @@ public class ExcelTabController extends BladeController {
|
|
@ApiOperationSupport(order = 5)
|
|
@ApiOperationSupport(order = 5)
|
|
@ApiOperation(value = "修改", notes = "传入excelTab")
|
|
@ApiOperation(value = "修改", notes = "传入excelTab")
|
|
public R update(@Valid @RequestBody ExcelTab excelTab) {
|
|
public R update(@Valid @RequestBody ExcelTab excelTab) {
|
|
|
|
+ if(excelTab.getFileUrl().equals("")||excelTab.getFileUrl().equals("null")){
|
|
|
|
+ excelTab.setFileType(2);
|
|
|
|
+ }
|
|
return R.status(excelTabService.updateById(excelTab));
|
|
return R.status(excelTabService.updateById(excelTab));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -643,7 +640,7 @@ public class ExcelTabController extends BladeController {
|
|
dataMap2.put(k,lastStr);
|
|
dataMap2.put(k,lastStr);
|
|
}else{
|
|
}else{
|
|
if(!(dataInfo2.getString(dataMap.get(k))).equals("")) {
|
|
if(!(dataInfo2.getString(dataMap.get(k))).equals("")) {
|
|
- dataMap2.put(k, dataInfo2.getString(dataMap.get(k)));
|
|
|
|
|
|
+ dataMap2.put(k, dataInfo2.getString(dataMap.get(k))+"__"+dataMap.get(k).split("__")[1]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -678,12 +675,6 @@ public class ExcelTabController extends BladeController {
|
|
WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
.eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId,contractId));
|
|
.eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId,contractId));
|
|
|
|
|
|
-
|
|
|
|
- UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
|
- updateWrapper.in("p_key_id",pkeyId);
|
|
|
|
- updateWrapper.set("is_tab_pdf",2);
|
|
|
|
- wbsTreeContractService.update(updateWrapper);
|
|
|
|
-
|
|
|
|
//huangjn 保存成功后调用生成资料查询列表数据
|
|
//huangjn 保存成功后调用生成资料查询列表数据
|
|
this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "文件名称(后面再完善)", Integer.parseInt(classify), 2);
|
|
this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId()+"", "文件名称(后面再完善)", Integer.parseInt(classify), 2);
|
|
}else{ //更新
|
|
}else{ //更新
|
|
@@ -695,6 +686,11 @@ public class ExcelTabController extends BladeController {
|
|
sqlInfo = sqlInfo + " where p_key_id="+pkeyId;
|
|
sqlInfo = sqlInfo + " where p_key_id="+pkeyId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.in("p_key_id",pkeyId);
|
|
|
|
+ updateWrapper.set("is_tab_pdf",2);
|
|
|
|
+ wbsTreeContractService.update(updateWrapper);
|
|
|
|
+
|
|
jdbcTemplate.execute(sqlInfo);
|
|
jdbcTemplate.execute(sqlInfo);
|
|
this.getBussPdfInfo(Long.parseLong(pkeyId));
|
|
this.getBussPdfInfo(Long.parseLong(pkeyId));
|
|
}
|
|
}
|
|
@@ -1111,7 +1107,7 @@ public class ExcelTabController extends BladeController {
|
|
})
|
|
})
|
|
public R getBussDataInfo(Long pkeyId) throws FileNotFoundException {
|
|
public R getBussDataInfo(Long pkeyId) throws FileNotFoundException {
|
|
|
|
|
|
- Map<String, String> reData = new HashMap<>();
|
|
|
|
|
|
+ Map<String, Object> reData = new HashMap<>();
|
|
|
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
@@ -1159,7 +1155,7 @@ public class ExcelTabController extends BladeController {
|
|
String myData = mysqlData.get(key[0])+"";
|
|
String myData = mysqlData.get(key[0])+"";
|
|
System.out.println(myData);
|
|
System.out.println(myData);
|
|
if(StringUtils.isNotEmpty(myData)&& !myData.equals("null")){
|
|
if(StringUtils.isNotEmpty(myData)&& !myData.equals("null")){
|
|
- if(myData.indexOf(",")>=0){
|
|
|
|
|
|
+ if(myData.indexOf(",")>=0 && data.html().indexOf("el-date-picker")<0){
|
|
String [] dataVal = myData.split(",");
|
|
String [] dataVal = myData.split(",");
|
|
for(String val:dataVal){
|
|
for(String val:dataVal){
|
|
if(key[1].equals(val.split("__")[1])){
|
|
if(key[1].equals(val.split("__")[1])){
|
|
@@ -1167,7 +1163,15 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- reData.put(keyData,myData);
|
|
|
|
|
|
+ if(key[1].equals(myData.split("__")[1])) {
|
|
|
|
+ if(data.html().indexOf("el-date-picker")>=0 && reData.containsKey("pickerKey")){
|
|
|
|
+ String pickerKey = reData.get("pickerKey")+","+keyData;
|
|
|
|
+ reData.put("pickerKey",pickerKey);
|
|
|
|
+ }else{
|
|
|
|
+ reData.put("pickerKey",keyData);
|
|
|
|
+ }
|
|
|
|
+ reData.put(keyData, myData.split("__")[0]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1228,7 +1232,7 @@ public class ExcelTabController extends BladeController {
|
|
String myData = mysqlData.get(key[0])+"";
|
|
String myData = mysqlData.get(key[0])+"";
|
|
System.out.println(myData);
|
|
System.out.println(myData);
|
|
if(StringUtils.isNotEmpty(myData)&& !myData.equals("null")){
|
|
if(StringUtils.isNotEmpty(myData)&& !myData.equals("null")){
|
|
- if(myData.indexOf(",")>=0){
|
|
|
|
|
|
+ if(myData.indexOf(",")>=0&&data.html().indexOf("el-date-picker")<0){
|
|
String [] dataVal = myData.split(",");
|
|
String [] dataVal = myData.split(",");
|
|
for(String val:dataVal){
|
|
for(String val:dataVal){
|
|
if(key[1].equals(val.split("__")[1])){
|
|
if(key[1].equals(val.split("__")[1])){
|
|
@@ -1236,7 +1240,15 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- data.empty().append(myData);
|
|
|
|
|
|
+ if(key[1].equals(myData.split("__")[1])) {
|
|
|
|
+ if(myData.indexOf(".000Z")>=0&&myData.indexOf("T")>=0){
|
|
|
|
+ String dataStr[] = myData.split("T")[0].split("-");
|
|
|
|
+ String dataVal = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2])+1});
|
|
|
|
+ data.empty().append(dataVal);
|
|
|
|
+ }else{
|
|
|
|
+ data.empty().append(myData.split("__")[0]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1282,7 +1294,7 @@ public class ExcelTabController extends BladeController {
|
|
tableFileService.saveOrUpdate(tableFile);
|
|
tableFileService.saveOrUpdate(tableFile);
|
|
}
|
|
}
|
|
|
|
|
|
- List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId));
|
|
|
|
|
|
+ List<TableFile> tableFileList = tableFileService.getBaseMapper().selectList(Wrappers.<TableFile>query().lambda().eq(TableFile::getTabId, pkeyId).eq(TableFile::getIsDeleted,0));
|
|
tableFileList.sort(Comparator.comparing(TableFile::getType));
|
|
tableFileList.sort(Comparator.comparing(TableFile::getType));
|
|
|
|
|
|
//
|
|
//
|
|
@@ -1313,6 +1325,7 @@ public class ExcelTabController extends BladeController {
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
.eq(WbsTreeContract::getPKeyId, pkeyId));
|
|
List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getId,wbsTreeContract.getId()).eq(WbsTreeContract::getContractId,wbsTreeContract.getContractId()));
|
|
List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getId,wbsTreeContract.getId()).eq(WbsTreeContract::getContractId,wbsTreeContract.getContractId()));
|
|
|
|
+
|
|
long newPkId = SnowFlakeUtil.getId();
|
|
long newPkId = SnowFlakeUtil.getId();
|
|
Long id = wbsTreeContract.getId();
|
|
Long id = wbsTreeContract.getId();
|
|
wbsTreeContract.setPKeyId(newPkId);
|
|
wbsTreeContract.setPKeyId(newPkId);
|
|
@@ -1326,13 +1339,41 @@ public class ExcelTabController extends BladeController {
|
|
wbsTreeContract.setDeptName(deptName);
|
|
wbsTreeContract.setDeptName(deptName);
|
|
wbsTreeContract.setIsCopeTab(2);
|
|
wbsTreeContract.setIsCopeTab(2);
|
|
wbsTreeContract.setIsTabPdf(1); // pdf 不能预览
|
|
wbsTreeContract.setIsTabPdf(1); // pdf 不能预览
|
|
- wbsTreeContract.setIsBussShow("1"); // 是否隐藏表
|
|
|
|
|
|
+ wbsTreeContract.setIsBussShow(1); // 是否隐藏表
|
|
wbsTreeContract.setTabFileType(1);//没有上传附件
|
|
wbsTreeContract.setTabFileType(1);//没有上传附件
|
|
- wbsTreeContractService.save(wbsTreeContract);
|
|
|
|
|
|
+ wbsTreeContract.setPdfUrl("");
|
|
|
|
+
|
|
|
|
|
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
// 复制表数据
|
|
// 复制表数据
|
|
|
|
+ String querySql = "select * from "+tabName+" where p_key_id="+pkeyId ;
|
|
|
|
+ Map<String, Object> dataMap2 = jdbcTemplate.queryForMap(querySql);
|
|
|
|
|
|
|
|
+ dataMap2.remove("p_key_id");
|
|
|
|
+ dataMap2.remove("id");
|
|
|
|
|
|
|
|
+ // sql 组装
|
|
|
|
+ String sqlInfo="";
|
|
|
|
+
|
|
|
|
+ sqlInfo = "INSERT INTO "+tabName+" ( ";
|
|
|
|
+
|
|
|
|
+ String keyStr = "id,p_key_id,";
|
|
|
|
+ String valStr = SnowFlakeUtil.getId() + ","+wbsTreeContract.getPKeyId() + ",";
|
|
|
|
+
|
|
|
|
+ for (String keys : dataMap2.keySet()){
|
|
|
|
+ if(!(dataMap2.get(keys)+"").equals("null")){
|
|
|
|
+ keyStr += keys+",";
|
|
|
|
+ valStr += "'"+dataMap2.get(keys)+"',";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ keyStr=keyStr.substring(0,keyStr.lastIndexOf(","));
|
|
|
|
+ valStr=valStr.substring(0,valStr.lastIndexOf(","));
|
|
|
|
+
|
|
|
|
+ sqlInfo = sqlInfo + keyStr+") VALUES (" +valStr +")";
|
|
|
|
+
|
|
|
|
+ //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
|
+ jdbcTemplate.execute(sqlInfo);
|
|
|
|
+ wbsTreeContractService.save(wbsTreeContract);
|
|
return R.data("成功");
|
|
return R.data("成功");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1368,20 +1409,20 @@ public class ExcelTabController extends BladeController {
|
|
NewBladeFile newBladeFile = new NewBladeFile();
|
|
NewBladeFile newBladeFile = new NewBladeFile();
|
|
if(fileExtension.contains("xlsx")){
|
|
if(fileExtension.contains("xlsx")){
|
|
newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
-
|
|
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
} else if(fileExtension.contains("xls")){
|
|
} else if(fileExtension.contains("xls")){
|
|
newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
newBladeFile = this.commonFileClient.excelToPdf(file);
|
|
-
|
|
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
} else if(fileExtension.contains("docx")){
|
|
} else if(fileExtension.contains("docx")){
|
|
newBladeFile = this.commonFileClient.wordToPdf(file);
|
|
newBladeFile = this.commonFileClient.wordToPdf(file);
|
|
-
|
|
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
} else if(fileExtension.contains("png") || file.getOriginalFilename().contains("jpg")){
|
|
} else if(fileExtension.contains("png") || file.getOriginalFilename().contains("jpg")){
|
|
newBladeFile = this.commonFileClient.pngOrJpgToPdf(file);
|
|
newBladeFile = this.commonFileClient.pngOrJpgToPdf(file);
|
|
-
|
|
|
|
|
|
+ tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
} else if(fileExtension.contains("pdf")){
|
|
} else if(fileExtension.contains("pdf")){
|
|
tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
tableFile.setDomainPdfUrl(bladeFile1.getLink());
|
|
}
|
|
}
|
|
- tableFile.setDomainPdfUrl(newBladeFile.getPdfUrl());
|
|
|
|
|
|
+
|
|
tableFile.setStatus("finished");
|
|
tableFile.setStatus("finished");
|
|
tableFileService.save(tableFile);
|
|
tableFileService.save(tableFile);
|
|
|
|
|