|
@@ -383,16 +383,14 @@ public class ExcelTabController extends BladeController {
|
|
String ancestors = parent.getAlias() + StringPool.COMMA + excelTab.getParentId();
|
|
String ancestors = parent.getAlias() + StringPool.COMMA + excelTab.getParentId();
|
|
excelTab.setAlias(ancestors);
|
|
excelTab.setAlias(ancestors);
|
|
}
|
|
}
|
|
- excelTabService.saveOrUpdate(excelTab);
|
|
|
|
// 关联清表信息计算
|
|
// 关联清表信息计算
|
|
-
|
|
|
|
List<ExcelTabWbsTypeVO> linkDataInfo = wbsExclTabParmVO.getLinkDataInfo();
|
|
List<ExcelTabWbsTypeVO> linkDataInfo = wbsExclTabParmVO.getLinkDataInfo();
|
|
-
|
|
|
|
if (linkDataInfo != null && linkDataInfo.size() >= 1) {
|
|
if (linkDataInfo != null && linkDataInfo.size() >= 1) {
|
|
// 判断是否上传excle
|
|
// 判断是否上传excle
|
|
if ((excelTab.getFileUrl() != null || excelTab.getFileUrl() != "") && excelTab.getFileType() != 3) {
|
|
if ((excelTab.getFileUrl() != null || excelTab.getFileUrl() != "") && excelTab.getFileType() != 3) {
|
|
return R.fail("请上传清表!");
|
|
return R.fail("请上传清表!");
|
|
}
|
|
}
|
|
|
|
+ excelTabService.saveOrUpdate(excelTab);
|
|
for (ExcelTabWbsTypeVO info : linkDataInfo) {
|
|
for (ExcelTabWbsTypeVO info : linkDataInfo) {
|
|
String[] pk_id = info.getLinkIds().split(",");
|
|
String[] pk_id = info.getLinkIds().split(",");
|
|
for (String pkInfo : pk_id) {
|
|
for (String pkInfo : pk_id) {
|
|
@@ -407,10 +405,11 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
updateWrapper.set("is_link_table", Integer.parseInt(pk_type[1]));
|
|
updateWrapper.set("is_link_table", Integer.parseInt(pk_type[1]));
|
|
updateWrapper.set("excel_id", excelTab.getId());
|
|
updateWrapper.set("excel_id", excelTab.getId());
|
|
-
|
|
|
|
wbsTreePrivateService.update(updateWrapper);
|
|
wbsTreePrivateService.update(updateWrapper);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ excelTabService.saveOrUpdate(excelTab);
|
|
}
|
|
}
|
|
|
|
|
|
return R.success("添加成功!");
|
|
return R.success("添加成功!");
|
|
@@ -456,7 +455,6 @@ public class ExcelTabController extends BladeController {
|
|
updateWrapper.set("excel_id", exceTabId);
|
|
updateWrapper.set("excel_id", exceTabId);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
// 复制模版htmlURL
|
|
// 复制模版htmlURL
|
|
File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
|
|
File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
@@ -585,33 +583,59 @@ public class ExcelTabController extends BladeController {
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 解析 style
|
|
|
|
|
|
+ // 远程搜索配置
|
|
Document doc = Jsoup.parse(htmlString);
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
|
+ int maxCol = doc.select("Col").size();
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
Elements hc = doc.select("hc-form-select-search");
|
|
Elements hc = doc.select("hc-form-select-search");
|
|
- if(hc.size()>=1){
|
|
|
|
- for(int i =0;i<hc.size();i++){
|
|
|
|
- Element datax = hc.get(i);
|
|
|
|
- datax.removeAttr("pkeyId");
|
|
|
|
- datax.removeAttr("contractId");
|
|
|
|
- datax.attr("pkeyId",pkeyId+"");
|
|
|
|
- datax.attr("contractId",wbsTreeContract.getContractId());
|
|
|
|
- }
|
|
|
|
|
|
+ if (hc.size() >= 1) {
|
|
|
|
+ for (int i = 0; i < hc.size(); i++) {
|
|
|
|
+ Element datax = hc.get(i);
|
|
|
|
+ datax.removeAttr("pkeyId");
|
|
|
|
+ datax.removeAttr("contractId");
|
|
|
|
+ datax.attr("pkeyId", pkeyId + "");
|
|
|
|
+ datax.attr("contractId", wbsTreeContract.getContractId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
|
|
|
|
+ // 标题解决
|
|
|
|
+ ProjectInfo projectInfo = projectInfoService.getById(wbsTreeContract.getProjectId());
|
|
// 添加标题显示
|
|
// 添加标题显示
|
|
- Elements dwtitle = doc.getElementsByAttributeValueMatching("style","18.0pt");
|
|
|
|
- if(dwtitle.size()==1){
|
|
|
|
-
|
|
|
|
- }else if(dwtitle.size()>=2){
|
|
|
|
- for (int i = 0;i<dwtitle.size();i++){
|
|
|
|
- Element dw = dwtitle.get(i);
|
|
|
|
- if(StringUtils.isEmpty(dw.text())){
|
|
|
|
- dw.text(projectInfo.getProjectName());
|
|
|
|
- };
|
|
|
|
|
|
+ // Elements dwtitle = doc.getElementsByAttributeValueMatching("style", "18.0pt");
|
|
|
|
+ Elements trs = table.select("tr");
|
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
|
+ Element tr = trs.get(i);
|
|
|
|
+ Elements tds = tr.select("td");
|
|
|
|
+ for (int j = 0; j < tds.size(); j++) {
|
|
|
|
+ Element data = tds.get(j);
|
|
|
|
+ int colspan = data.attr("COLSPAN").equals("") ? 0 : Integer.parseInt(data.attr("COLSPAN"));
|
|
|
|
+ String style = data.attr("style");
|
|
|
|
+ if(style.indexOf("font-size")>=0){
|
|
|
|
+ int fontsize = Integer.parseInt(style.substring(style.indexOf("font-size:")+10,style.indexOf(".0pt")));
|
|
|
|
+ if (StringUtils.isNotEmpty(data.text()) && fontsize>=12) {
|
|
|
|
+ trs.get(i-1).select("td").get(0).text(projectInfo.getProjectName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取公式颜色
|
|
|
|
+
|
|
|
|
+ String tabName = wbsTreeContract.getInitTableName();
|
|
|
|
+ // 字段查询 获取公式字段
|
|
|
|
+ String colkeys = "SELECT e_key from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id in(SELECT element_id from m_formula c where c.is_deleted=0) ";
|
|
|
|
+ List<Map<String, Object>> maps = jdbcTemplate.queryForList(colkeys);
|
|
|
|
+
|
|
|
|
+ if (maps != null) {
|
|
|
|
+ for (Map<String, Object> keys : maps) {
|
|
|
|
+ String key = keys.get("e_key") + "__";
|
|
|
|
+ Elements gscolor = doc.select("el-input[keyname~=^" + key + "]");
|
|
|
|
+ for (Element element : gscolor) {
|
|
|
|
+ System.out.println(element.parent());
|
|
|
|
+ element.parent().attr("gscolor", "11");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
doc.select("Col").remove();
|
|
doc.select("Col").remove();
|
|
@@ -652,46 +676,6 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
- * 首件表单获取 html页面
|
|
|
|
- */
|
|
|
|
- @GetMapping("/get-first-excel-html")
|
|
|
|
- @ApiOperationSupport(order = 15)
|
|
|
|
- @ApiOperation(value = "首件表单获取html页面", notes = "首件表单获取html页面")
|
|
|
|
- @ApiImplicitParams(value = {
|
|
|
|
- @ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
|
|
- })
|
|
|
|
- public R getFirstExcelHtml(Long projectId) throws IOException, InterruptedException {
|
|
|
|
-
|
|
|
|
- WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
|
- .eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getTableType, "111"));
|
|
|
|
- if (wbsTreeContract == null) {
|
|
|
|
- return R.fail("该数据下无此节点!");
|
|
|
|
- }
|
|
|
|
- if (wbsTreeContract.getHtmlUrl() == null) {
|
|
|
|
- return R.fail("请上传清表!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- File file1 = ResourceUtil.getFile(wbsTreeContract.getHtmlUrl());
|
|
|
|
- FileInputStream fileInputStream = new FileInputStream(file1);
|
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
|
- // 解析 style
|
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
|
- Element table = doc.select("table").first();
|
|
|
|
- doc.select("Col").remove();
|
|
|
|
- fileInputStream.close();
|
|
|
|
- JSONObject reData = new JSONObject();
|
|
|
|
- reData.put("id", wbsTreeContract.getPKeyId());
|
|
|
|
- reData.put("data", table);
|
|
|
|
- return R.data(table + "");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 上传解析 html
|
|
// 上传解析 html
|
|
public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
|
|
public void expailHtmlInfo(String thmlUrl, Long excelId) throws FileNotFoundException {
|
|
|
|
|
|
@@ -1255,7 +1239,7 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParams(value = {
|
|
@ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
|
|
@ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
|
|
})
|
|
})
|
|
- public R copeBussTab(Long pkeyId) throws FileNotFoundException {
|
|
|
|
|
|
+ public R copeBussTab(Long pkeyId){
|
|
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));
|
|
|
|
|
|
@@ -1290,37 +1274,40 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// 字段查询 并去掉公式字段
|
|
// 字段查询 并去掉公式字段
|
|
|
|
|
|
- String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '"+tabName+"' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
|
|
|
|
|
|
+ String colkeys = "SELECT GROUP_CONCAT(e_key) as colkeys from m_wbs_tree a ,m_wbs_form_element b WHERE a.init_table_name = '" + tabName + "' and a.id=b.f_id and b.id not in(SELECT element_id from m_formula c where c.is_deleted=0) ";
|
|
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
|
|
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(colkeys);
|
|
- colkeys = stringObjectMap.get("colkeys")+"";
|
|
|
|
|
|
+ colkeys = stringObjectMap.get("colkeys") + "";
|
|
// 复制表数据
|
|
// 复制表数据
|
|
- String querySql = "select "+colkeys+" from " + tabName + " where p_key_id=" + pkeyId;
|
|
|
|
- Map<String, Object> dataMap2 = jdbcTemplate.queryForMap(querySql);
|
|
|
|
|
|
+ String querySql = "select " + colkeys + " from " + tabName + " where p_key_id=" + pkeyId;
|
|
|
|
+ List<Map<String, Object>> dataList = jdbcTemplate.queryForList(querySql);
|
|
|
|
+ if (dataList != null && dataList.size()>=1) {
|
|
|
|
+ Map<String, Object> dataMap2 = dataList.get(0);
|
|
|
|
|
|
- dataMap2.remove("p_key_id");
|
|
|
|
- dataMap2.remove("id");
|
|
|
|
|
|
+ dataMap2.remove("p_key_id");
|
|
|
|
+ dataMap2.remove("id");
|
|
|
|
|
|
- // sql 组装
|
|
|
|
- String sqlInfo = "";
|
|
|
|
|
|
+ // sql 组装
|
|
|
|
+ String sqlInfo = "";
|
|
|
|
|
|
- sqlInfo = "INSERT INTO " + tabName + " ( ";
|
|
|
|
|
|
+ sqlInfo = "INSERT INTO " + tabName + " ( ";
|
|
|
|
|
|
- String keyStr = "id,p_key_id,";
|
|
|
|
- String valStr = SnowFlakeUtil.getId() + "," + wbsTreeContract.getPKeyId() + ",";
|
|
|
|
|
|
+ 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) + "',";
|
|
|
|
|
|
+ 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(","));
|
|
|
|
|
|
+ keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
|
|
|
|
+ valStr = valStr.substring(0, valStr.lastIndexOf(","));
|
|
|
|
|
|
- sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
|
|
|
|
+ sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
|
|
|
|
|
|
- //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
|
- jdbcTemplate.execute(sqlInfo);
|
|
|
|
|
|
+ //huangjn 保存成功后调用生成资料查询列表数据
|
|
|
|
+ jdbcTemplate.execute(sqlInfo);
|
|
|
|
+ }
|
|
wbsTreeContractService.save(wbsTreeContract);
|
|
wbsTreeContractService.save(wbsTreeContract);
|
|
return R.data("成功");
|
|
return R.data("成功");
|
|
}
|
|
}
|
|
@@ -1344,7 +1331,7 @@ public class ExcelTabController extends BladeController {
|
|
@ApiImplicitParam(name = "classify", value = "classify", required = true),
|
|
@ApiImplicitParam(name = "classify", value = "classify", required = true),
|
|
@ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
@ApiImplicitParam(name = "projectId", value = "projectId", required = true)
|
|
})
|
|
})
|
|
- public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId,String nodeId, String contractId,String projectId,String classify) {
|
|
|
|
|
|
+ public R addBussFile(@RequestParam("file") MultipartFile file, Long pkeyId, String nodeId, String contractId, String projectId, String classify) {
|
|
|
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
|
|
|
@@ -1390,7 +1377,7 @@ public class ExcelTabController extends BladeController {
|
|
wbsTreeContractService.update(updateWrapper);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
// 合并后
|
|
// 合并后
|
|
|
|
|
|
- excelTabService.getBussPdfs(nodeId,classify,contractId,projectId);
|
|
|
|
|
|
+ excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
|
|
|
|
|
|
return R.data(tableFile.getId());
|
|
return R.data(tableFile.getId());
|
|
}
|
|
}
|
|
@@ -1425,7 +1412,7 @@ public class ExcelTabController extends BladeController {
|
|
String sql = "select pdf_url, e_visa_pdf_url from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
String sql = "select pdf_url, e_visa_pdf_url from u_information_query where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
|
|
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
|
|
Object pdfUrl = stringObjectMap.get("pdf_url");
|
|
Object pdfUrl = stringObjectMap.get("pdf_url");
|
|
- if(stringObjectMap.get("e_visa_pdf_url") != null){
|
|
|
|
|
|
+ if (stringObjectMap.get("e_visa_pdf_url") != null) {
|
|
//优先使用电签的PDF
|
|
//优先使用电签的PDF
|
|
pdfUrl = stringObjectMap.get("e_visa_pdf_url");
|
|
pdfUrl = stringObjectMap.get("e_visa_pdf_url");
|
|
}
|
|
}
|
|
@@ -1465,7 +1452,7 @@ public class ExcelTabController extends BladeController {
|
|
String classify = tableInfo1.getString("classify");
|
|
String classify = tableInfo1.getString("classify");
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
try {
|
|
try {
|
|
- this.excelTabService.formulaFillData(tableInfoList,Long.parseLong(nodeid));
|
|
|
|
|
|
+ this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeid));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -1767,6 +1754,13 @@ public class ExcelTabController extends BladeController {
|
|
//数据结果
|
|
//数据结果
|
|
Map<String, Object> reData = new HashMap<>();
|
|
Map<String, Object> reData = new HashMap<>();
|
|
|
|
|
|
|
|
+ String id = mysqlData.get("id")+"" ;
|
|
|
|
+ String querySqlx = "SELECT tree_primary_key_id as primaryKeyId,title as path from u_contract_log_wbs where business_id ='"+id+"'";
|
|
|
|
+ List<Map<String, Object>> businessDat = this.jdbcTemplate.queryForList(querySqlx);
|
|
|
|
+ if(businessDat!=null){
|
|
|
|
+ reData.put("linkTabIds",businessDat);
|
|
|
|
+ }
|
|
|
|
+
|
|
for (String key : mysqlData.keySet()) {
|
|
for (String key : mysqlData.keySet()) {
|
|
String tabVal = mysqlData.get(key) + "";
|
|
String tabVal = mysqlData.get(key) + "";
|
|
// 时间段处理
|
|
// 时间段处理
|
|
@@ -1809,13 +1803,11 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 移除Id 和 p_key_id
|
|
// 移除Id 和 p_key_id
|
|
-// reData.remove("id");
|
|
|
|
reData.remove("p_key_id");
|
|
reData.remove("p_key_id");
|
|
reData.remove("classify");
|
|
reData.remove("classify");
|
|
reData.remove("contractId");
|
|
reData.remove("contractId");
|
|
reData.remove("pkeyId");
|
|
reData.remove("pkeyId");
|
|
reData.remove("projectId");
|
|
reData.remove("projectId");
|
|
-
|
|
|
|
resultMapList.add(reData);
|
|
resultMapList.add(reData);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1861,7 +1853,7 @@ public class ExcelTabController extends BladeController {
|
|
return R.fail("目标日期下未找到当前用户填报的数据,请重新选择");
|
|
return R.fail("目标日期下未找到当前用户填报的数据,请重新选择");
|
|
}
|
|
}
|
|
|
|
|
|
- for(JSONObject targetJson : targetJsonList){
|
|
|
|
|
|
+ for (JSONObject targetJson : targetJsonList) {
|
|
|
|
|
|
//获取目标数据所在数据表
|
|
//获取目标数据所在数据表
|
|
WbsTreePrivate table = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, targetJson.getString("tableId")));
|
|
WbsTreePrivate table = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, targetJson.getString("tableId")));
|
|
@@ -1883,14 +1875,14 @@ public class ExcelTabController extends BladeController {
|
|
List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
|
|
List<JSONObject> wbsJsonList = this.contractLogClient.queryContractLogWbsByBusinessId(value.toString());
|
|
//重置业务ID
|
|
//重置业务ID
|
|
value = SnowFlakeUtil.getId();
|
|
value = SnowFlakeUtil.getId();
|
|
- if(wbsJsonList != null && wbsJsonList.size() > 0){
|
|
|
|
- if(oneGroupLogWbsList.size() == 0){
|
|
|
|
|
|
+ if (wbsJsonList != null && wbsJsonList.size() > 0) {
|
|
|
|
+ if (oneGroupLogWbsList.size() == 0) {
|
|
oneGroupLogWbsList.addAll(wbsJsonList);
|
|
oneGroupLogWbsList.addAll(wbsJsonList);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
|
|
wbsJsonList = new ArrayList<>(oneGroupLogWbsList);
|
|
}
|
|
}
|
|
- for(JSONObject json : wbsJsonList){
|
|
|
|
|
|
+ for (JSONObject json : wbsJsonList) {
|
|
json.put("businessId", value);
|
|
json.put("businessId", value);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2234,14 +2226,14 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
|
|
try {
|
|
try {
|
|
- this.excelTabService.formulaFillData(tableInfoList,null);
|
|
|
|
|
|
+ this.excelTabService.formulaFillData(tableInfoList, null);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
// 保存数据到数据库
|
|
// 保存数据到数据库
|
|
String isFirst = tableInfoList.get(0).getIsFirst();
|
|
String isFirst = tableInfoList.get(0).getIsFirst();
|
|
- if(StringUtils.isNotEmpty(isFirst)){
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(isFirst)) {
|
|
//保存首件
|
|
//保存首件
|
|
return R.data(this.excelTabService.saveOrUpdateFirst(tableInfoList));
|
|
return R.data(this.excelTabService.saveOrUpdateFirst(tableInfoList));
|
|
} else {
|
|
} else {
|
|
@@ -2258,7 +2250,7 @@ public class ExcelTabController extends BladeController {
|
|
@ApiOperationSupport(order = 31)
|
|
@ApiOperationSupport(order = 31)
|
|
@ApiOperation(value = "下载excel数据")
|
|
@ApiOperation(value = "下载excel数据")
|
|
@ApiImplicitParam(name = "fileId", value = "fileId")
|
|
@ApiImplicitParam(name = "fileId", value = "fileId")
|
|
- public void downExcelFile(HttpServletResponse response,String fileId) throws Exception {
|
|
|
|
|
|
+ public void downExcelFile(HttpServletResponse response, String fileId) throws Exception {
|
|
ExcelTab excelTab = excelTabService.getById(fileId);
|
|
ExcelTab excelTab = excelTabService.getById(fileId);
|
|
|
|
|
|
String fileName = URLEncoder.encode(excelTab.getName(), Charsets.UTF_8.name());
|
|
String fileName = URLEncoder.encode(excelTab.getName(), Charsets.UTF_8.name());
|
|
@@ -2285,13 +2277,13 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
public R getFirstExcelHtml() throws Exception {
|
|
public R getFirstExcelHtml() throws Exception {
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
- String sql ="SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201') and is_deleted=0 and file_type=3 ";
|
|
|
|
|
|
+ String sql = "SELECT * from m_excel_tab x where x.alias like '%1579401528622919682%' and parent_id in ('1582212216210829314','1582211923960115201') and is_deleted=0 and file_type=3 ";
|
|
List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> dataInof = jdbcTemplate.queryForList(sql);
|
|
System.out.println(dataInof.size());
|
|
System.out.println(dataInof.size());
|
|
for (int i = 0; i < dataInof.size(); i++) {
|
|
for (int i = 0; i < dataInof.size(); i++) {
|
|
String file_url = dataInof.get(i).get("file_url") + "";
|
|
String file_url = dataInof.get(i).get("file_url") + "";
|
|
Long p_key_id = Long.parseLong(dataInof.get(i).get("id") + "");
|
|
Long p_key_id = Long.parseLong(dataInof.get(i).get("id") + "");
|
|
- String html_url = dataInof.get(i).get("html_url")+"";
|
|
|
|
|
|
+ String html_url = dataInof.get(i).get("html_url") + "";
|
|
|
|
|
|
ExcelTab detail = excelTabService.getById(p_key_id);
|
|
ExcelTab detail = excelTabService.getById(p_key_id);
|
|
// 解析excel
|
|
// 解析excel
|
|
@@ -2305,9 +2297,9 @@ public class ExcelTabController extends BladeController {
|
|
Thread.sleep(100);
|
|
Thread.sleep(100);
|
|
sheet.saveToHtml(html_url, options);
|
|
sheet.saveToHtml(html_url, options);
|
|
Thread.sleep(100);
|
|
Thread.sleep(100);
|
|
- this.expailHtmlInfo(html_url,p_key_id);
|
|
|
|
|
|
+ this.expailHtmlInfo(html_url, p_key_id);
|
|
Thread.sleep(100);
|
|
Thread.sleep(100);
|
|
- EexpaileInfo(html_url,p_key_id);
|
|
|
|
|
|
+ EexpaileInfo(html_url, p_key_id);
|
|
System.out.println(i);
|
|
System.out.println(i);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2315,7 +2307,7 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 水利水电
|
|
// 水利水电
|
|
- public void EexpaileInfo(String htmlUrl,long pk_id) throws FileNotFoundException {
|
|
|
|
|
|
+ public void EexpaileInfo(String htmlUrl, long pk_id) throws FileNotFoundException {
|
|
// String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
|
|
// String html_url = "/Users/hongchuangyanfa/Desktop/1582973587797573632.html";
|
|
String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
|
|
String htmlString = IoUtil.readToString(new FileInputStream(htmlUrl));
|
|
// 样式集合
|
|
// 样式集合
|
|
@@ -2352,7 +2344,7 @@ public class ExcelTabController extends BladeController {
|
|
String trTitleName = "";
|
|
String trTitleName = "";
|
|
Element element = tds.get(j);
|
|
Element element = tds.get(j);
|
|
|
|
|
|
- first +=element.text();
|
|
|
|
|
|
+ first += element.text();
|
|
|
|
|
|
// 中间计算方式
|
|
// 中间计算方式
|
|
if (element.html().indexOf("el-input") >= 0) {
|
|
if (element.html().indexOf("el-input") >= 0) {
|
|
@@ -2364,28 +2356,28 @@ public class ExcelTabController extends BladeController {
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setTextElementType(99);
|
|
exctabCell.setTextElementType(99);
|
|
|
|
|
|
- for(int k=i ;k<sgY ; k++){
|
|
|
|
|
|
+ for (int k = i; k < sgY; k++) {
|
|
Element atr = trs.get(k);
|
|
Element atr = trs.get(k);
|
|
Elements atds = atr.select("td");
|
|
Elements atds = atr.select("td");
|
|
int m = 0;
|
|
int m = 0;
|
|
- if(k==i){
|
|
|
|
- m=j+1;
|
|
|
|
- }else{
|
|
|
|
|
|
+ if (k == i) {
|
|
|
|
+ m = j + 1;
|
|
|
|
+ } else {
|
|
m = 0;
|
|
m = 0;
|
|
}
|
|
}
|
|
- for(int l=m;l<atds.size();l++){
|
|
|
|
|
|
+ for (int l = m; l < atds.size(); l++) {
|
|
Element element1 = atds.get(l);
|
|
Element element1 = atds.get(l);
|
|
- if(element1.html().indexOf("el-input")>=0){
|
|
|
|
|
|
+ if (element1.html().indexOf("el-input") >= 0) {
|
|
break;
|
|
break;
|
|
- }else{
|
|
|
|
- end = end+element1.text();
|
|
|
|
|
|
+ } else {
|
|
|
|
+ end = end + element1.text();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- tdStr = first+end;
|
|
|
|
|
|
+ tdStr = first + end;
|
|
|
|
|
|
- if ( first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
|
|
|
|
|
|
+ if (first.indexOf("检验点") >= 0 && first.indexOf("合格率均不小于") >= 0 && end.indexOf("%") >= 0) {
|
|
trTitleName = titt + "_合格率";
|
|
trTitleName = titt + "_合格率";
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2394,35 +2386,35 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
if (first.indexOf("各项报验资料") >= 0 && end.indexOf("的要求") >= 0 && end.indexOf("SL") >= 0) {
|
|
if (first.indexOf("各项报验资料") >= 0 && end.indexOf("的要求") >= 0 && end.indexOf("SL") >= 0) {
|
|
- if(end.indexOf("。")>=0){
|
|
|
|
- end= end.substring(0,end.indexOf("。"));
|
|
|
|
|
|
+ if (end.indexOf("。") >= 0) {
|
|
|
|
+ end = end.substring(0, end.indexOf("。"));
|
|
}
|
|
}
|
|
trTitleName = titt + "_报验资料是否满足" + end;
|
|
trTitleName = titt + "_报验资料是否满足" + end;
|
|
}
|
|
}
|
|
|
|
|
|
if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
|
|
if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
|
|
- if(first.indexOf("。")>=0){
|
|
|
|
- first= first.substring(first.indexOf("。")+1,first.length());
|
|
|
|
|
|
+ if (first.indexOf("。") >= 0) {
|
|
|
|
+ first = first.substring(first.indexOf("。") + 1, first.length());
|
|
}
|
|
}
|
|
trTitleName = titt + "_" + first.substring(0, first.length() - 2);
|
|
trTitleName = titt + "_" + first.substring(0, first.length() - 2);
|
|
}
|
|
}
|
|
// 2
|
|
// 2
|
|
- if (first.indexOf("合格")>=0 &&first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
|
|
|
|
- trTitleName = titt + "_"+first.substring(first.indexOf("其中优良")+2,first.indexOf("占")+1)+"比";
|
|
|
|
|
|
+ if (first.indexOf("合格") >= 0 && first.indexOf("其中优良") >= 0 && end.indexOf("%") >= 0) {
|
|
|
|
+ trTitleName = titt + "_" + first.substring(first.indexOf("其中优良") + 2, first.indexOf("占") + 1) + "比";
|
|
}
|
|
}
|
|
if (first.indexOf("主要工序达到") >= 0 && end.indexOf("等级") >= 0) {
|
|
if (first.indexOf("主要工序达到") >= 0 && end.indexOf("等级") >= 0) {
|
|
trTitleName = titt + "工序等级";
|
|
trTitleName = titt + "工序等级";
|
|
}
|
|
}
|
|
// 3
|
|
// 3
|
|
- if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 && first.indexOf("符合") >= 0) {
|
|
|
|
|
|
+ if (first.indexOf("单元工程") >= 0 && end.indexOf("要求") >= 0 && first.indexOf("符合") >= 0) {
|
|
trTitleName = titt + "_设计要求";
|
|
trTitleName = titt + "_设计要求";
|
|
}
|
|
}
|
|
- if (end.indexOf("100%合格") >= 0 ) {
|
|
|
|
|
|
+ if (end.indexOf("100%合格") >= 0) {
|
|
trTitleName = titt + "_合格数量";
|
|
trTitleName = titt + "_合格数量";
|
|
}
|
|
}
|
|
|
|
|
|
- System.out.println(i+","+j+"="+trTitleName);
|
|
|
|
- first="";
|
|
|
|
|
|
+ System.out.println(i + "," + j + "=" + trTitleName);
|
|
|
|
+ first = "";
|
|
end = "";
|
|
end = "";
|
|
exctabCell.setTextInfo(trTitleName);
|
|
exctabCell.setTextInfo(trTitleName);
|
|
exctabCell.setXys(i + "_" + j);
|
|
exctabCell.setXys(i + "_" + j);
|
|
@@ -2445,11 +2437,11 @@ public class ExcelTabController extends BladeController {
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setTextElementType(99);
|
|
exctabCell.setTextElementType(99);
|
|
tds.get(0).removeAttr("title");
|
|
tds.get(0).removeAttr("title");
|
|
- if(titt.indexOf("施工")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("施工") >= 0) {
|
|
exctabCell.setTextInfo("施工单位合同章");
|
|
exctabCell.setTextInfo("施工单位合同章");
|
|
tds.get(0).attr("title", "施工单位合同章");
|
|
tds.get(0).attr("title", "施工单位合同章");
|
|
}
|
|
}
|
|
- if(titt.indexOf("监理")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("监理") >= 0) {
|
|
exctabCell.setTextInfo("监理单位合同章");
|
|
exctabCell.setTextInfo("监理单位合同章");
|
|
tds.get(0).attr("title", "监理单位合同章");
|
|
tds.get(0).attr("title", "监理单位合同章");
|
|
}
|
|
}
|
|
@@ -2465,11 +2457,11 @@ public class ExcelTabController extends BladeController {
|
|
exctabCell.setTextElementType(99);
|
|
exctabCell.setTextElementType(99);
|
|
tds.get(1).removeAttr("title");
|
|
tds.get(1).removeAttr("title");
|
|
|
|
|
|
- if(titt.indexOf("施工")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("施工") >= 0) {
|
|
tds.get(1).attr("title", "施工单位个人签字");
|
|
tds.get(1).attr("title", "施工单位个人签字");
|
|
exctabCell.setTextInfo("施工单位个人签字");
|
|
exctabCell.setTextInfo("施工单位个人签字");
|
|
}
|
|
}
|
|
- if(titt.indexOf("监理")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("监理") >= 0) {
|
|
tds.get(1).attr("title", "监理单位个人签字");
|
|
tds.get(1).attr("title", "监理单位个人签字");
|
|
exctabCell.setTextInfo("监理单位个人签字");
|
|
exctabCell.setTextInfo("监理单位个人签字");
|
|
}
|
|
}
|
|
@@ -2484,11 +2476,11 @@ public class ExcelTabController extends BladeController {
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setCreateTime(new Date());
|
|
exctabCell.setTextElementType(99);
|
|
exctabCell.setTextElementType(99);
|
|
tds.get(2).removeAttr("title");
|
|
tds.get(2).removeAttr("title");
|
|
- if(titt.indexOf("施工")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("施工") >= 0) {
|
|
tds.get(2).attr("title", "日期施工单位");
|
|
tds.get(2).attr("title", "日期施工单位");
|
|
exctabCell.setTextInfo("日期施工单位");
|
|
exctabCell.setTextInfo("日期施工单位");
|
|
}
|
|
}
|
|
- if(titt.indexOf("监理")>=0){
|
|
|
|
|
|
+ if (titt.indexOf("监理") >= 0) {
|
|
tds.get(2).attr("title", "日期监理单位");
|
|
tds.get(2).attr("title", "日期监理单位");
|
|
exctabCell.setTextInfo("日期监理单位");
|
|
exctabCell.setTextInfo("日期监理单位");
|
|
}
|
|
}
|
|
@@ -2501,17 +2493,15 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- File writefile = new File(htmlUrl);
|
|
|
|
- FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
|
|
|
+ File writefile = new File(htmlUrl);
|
|
|
|
+ FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
|
|
System.out.println("完成");
|
|
System.out.println("完成");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 表单填写 图片添加 并压缩
|
|
* 表单填写 图片添加 并压缩
|
|
|
|
+ *
|
|
* @param file
|
|
* @param file
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -2521,15 +2511,15 @@ public class ExcelTabController extends BladeController {
|
|
@ApiOperation(value = "表单填写图片上传", notes = "表单填写图片上传")
|
|
@ApiOperation(value = "表单填写图片上传", notes = "表单填写图片上传")
|
|
public R addBussFile(@RequestParam MultipartFile file) {
|
|
public R addBussFile(@RequestParam MultipartFile file) {
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
- BladeFile bladeFile=new BladeFile();
|
|
|
|
- if(file.getSize()>=1024){
|
|
|
|
|
|
+ BladeFile bladeFile = new BladeFile();
|
|
|
|
+ if (file.getSize() >= 1024) {
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
String filecode = SnowFlakeUtil.getId() + "";
|
|
- String imgUrl = file_path+"/pdf/"+ filecode+".jpg";
|
|
|
|
- FileUtils.CompressImage(imgUrl,file.getInputStream());
|
|
|
|
- bladeFile= this.newIOSSClient.uploadFile(file.getOriginalFilename(),imgUrl);
|
|
|
|
|
|
+ String imgUrl = file_path + "/pdf/" + filecode + ".jpg";
|
|
|
|
+ FileUtils.CompressImage(imgUrl, file.getInputStream());
|
|
|
|
+ bladeFile = this.newIOSSClient.uploadFile(file.getOriginalFilename(), imgUrl);
|
|
File imgFile = ResourceUtil.getFile(imgUrl);
|
|
File imgFile = ResourceUtil.getFile(imgUrl);
|
|
imgFile.delete();
|
|
imgFile.delete();
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
bladeFile = this.newIOSSClient.uploadFileByInputStream(file);
|
|
bladeFile = this.newIOSSClient.uploadFileByInputStream(file);
|
|
}
|
|
}
|
|
return R.data(bladeFile);
|
|
return R.data(bladeFile);
|