|
@@ -2000,7 +2000,33 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
return reData;
|
|
return reData;
|
|
}
|
|
}
|
|
|
|
+ public static String convertToYMD(String input) {
|
|
|
|
+ if (input == null || input.isEmpty()) return "";
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
+ Date date;
|
|
|
|
+
|
|
|
|
+ // 尝试多种格式
|
|
|
|
+ if (input.matches("\\d{4}-\\d{2}-\\d{2}")) {
|
|
|
|
+ date = new SimpleDateFormat("yyyy-MM-dd").parse(input);
|
|
|
|
+ } else if (input.matches("\\d{4}/\\d{2}/\\d{2}")) {
|
|
|
|
+ date = new SimpleDateFormat("yyyy/MM/dd").parse(input);
|
|
|
|
+ } else if (input.matches("\\d{4}年\\d{1,2}月\\d{1,2}日")) {
|
|
|
|
+ date = new SimpleDateFormat("yyyy年MM月dd日").parse(input);
|
|
|
|
+ } else if (input.matches("\\d{8}")) {
|
|
|
|
+ date = new SimpleDateFormat("yyyyMMdd").parse(input);
|
|
|
|
+ } else if (input.contains("T") && input.contains(":")) {
|
|
|
|
+ date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").parse(input.replaceAll("Z$", "+0800"));
|
|
|
|
+ } else {
|
|
|
|
+ throw new IllegalArgumentException("Unsupported date format: " + input);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return new SimpleDateFormat("yyyy-MM-dd").format(date);
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
@Override
|
|
@Override
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
public R getBussPdfInfo(Long pkeyId) throws Exception {
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
@@ -2110,6 +2136,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ Boolean dateFlag=true;
|
|
|
|
+ String firstDate="";
|
|
|
|
+ List<String>dateKeyNames=new ArrayList<>();
|
|
//数据不为空
|
|
//数据不为空
|
|
if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
if (StringUtils.isNotEmpty(wbsTreeContract.getHtmlUrl())) {
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
InputStream inputStreamByUrl = FileUtils.getInputStreamByUrl(wbsTreeContract.getHtmlUrl());
|
|
@@ -2141,7 +2170,27 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
realFillRate = v.intValue();
|
|
realFillRate = v.intValue();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ Elements dateElements = doc.select("el-date-picker");
|
|
|
|
+ if(!dateElements.isEmpty()){
|
|
|
|
+ for (Element element : dateElements) {
|
|
|
|
+ String keyname = element.attr("keyname");
|
|
|
|
+ dateKeyNames.add(keyname);
|
|
|
|
+ if(!DataInfo.containsKey(keyname)||(StringUtils.isEmpty(DataInfo.get(keyname).toString()))){
|
|
|
|
+ dateFlag=false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(dateFlag){
|
|
|
|
+ if(!dateKeyNames.isEmpty()){
|
|
|
|
+ for (int i = 0; i < dateKeyNames.size(); i++) {
|
|
|
|
+ firstDate=DataInfo.get(dateKeyNames.get(i)).toString();
|
|
|
|
+ firstDate=convertToYMD(firstDate);
|
|
|
|
+ if(StringUtils.isNotEmpty(firstDate)){
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
Elements trs = table.select("tr");
|
|
Elements trs = table.select("tr");
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
if (ObjectUtil.isNotEmpty(DataInfo)) {
|
|
for (String val : DataInfo.keySet()) {
|
|
for (String val : DataInfo.keySet()) {
|
|
@@ -2150,7 +2199,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
if (datas.size() >= 1) {
|
|
if (datas.size() >= 1) {
|
|
data = datas.get(0);
|
|
data = datas.get(0);
|
|
}
|
|
}
|
|
-
|
|
|
|
if (data != null) {
|
|
if (data != null) {
|
|
if (data.hasAttr("x1") && data.hasAttr("y1")) {
|
|
if (data.hasAttr("x1") && data.hasAttr("y1")) {
|
|
int x1 = 0;
|
|
int x1 = 0;
|
|
@@ -2453,11 +2501,37 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
updateWrapper.set("pdf_url", fileUrl);
|
|
updateWrapper.set("pdf_url", fileUrl);
|
|
updateWrapper.set("real_fill_rate", realFillRate);
|
|
updateWrapper.set("real_fill_rate", realFillRate);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
wbsTreeContractService.update(updateWrapper);
|
|
|
|
+ //
|
|
|
|
+ String sql="SELECT parent.* FROM m_wbs_tree_contract child JOIN m_wbs_tree_contract parent ON child.p_id = parent.p_key_id WHERE child.p_key_id ="+pkeyId+" AND child.contract_id = parent.contract_id AND child.project_id = parent.project_id";
|
|
|
|
+ List<WbsTreeContract> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
|
|
|
|
+ if(!query.isEmpty()){
|
|
|
|
+ WbsTreeContract contract = query.get(0);
|
|
|
|
+ if(!dateFlag){
|
|
|
|
+ contract.setDateIsComplete(2);
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ contract.setDateIsComplete(1);
|
|
|
|
+ }
|
|
|
|
+ String ancestorsPId = contract.getAncestorsPId();
|
|
|
|
+ if (ancestorsPId.startsWith("0,")) {
|
|
|
|
+ ancestorsPId = ancestorsPId.substring(2);
|
|
|
|
+ }
|
|
|
|
+ UpdateWrapper<WbsTreeContract> updateWrapper1 = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper1.in("p_key_id", ancestorsPId);
|
|
|
|
+ updateWrapper1.set("date_is_complete",contract.getDateIsComplete());
|
|
|
|
+ wbsTreeContractService.update(updateWrapper1);
|
|
|
|
+
|
|
|
|
+ Integer classify =
|
|
|
|
+ Arrays.asList("1", "2", "3").contains(contract.getTableOwner()) ? 1 :
|
|
|
|
+ Arrays.asList("4", "5", "6").contains(contract.getTableOwner()) ? 2 : 1;
|
|
|
|
+ String updateQuery="update u_information_query set business_time= '"+firstDate+"' where wbs_id="+contract.getPKeyId()+" and classify="+classify;
|
|
|
|
+ jdbcTemplate.update(updateQuery);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//关闭流
|
|
//关闭流
|
|
IoUtil.closeQuietly(outputStream);
|
|
IoUtil.closeQuietly(outputStream);
|
|
IoUtil.closeQuietly(exceInp);
|
|
IoUtil.closeQuietly(exceInp);
|
|
-
|
|
|
|
return R.data(fileUrl);
|
|
return R.data(fileUrl);
|
|
}
|
|
}
|
|
|
|
|