|
@@ -1322,26 +1322,29 @@ public class TaskController extends BladeController {
|
|
throw new ServiceException(r.getMsg());
|
|
throw new ServiceException(r.getMsg());
|
|
}
|
|
}
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
WbsTreePrivate aPrivate = r.getData();
|
|
|
|
+ //获取所有的key
|
|
|
|
+ Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
|
|
+// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html");
|
|
|
|
+ if (map.size() == 0){
|
|
|
|
+ throw new ServiceException("未获取到html中的keyName");
|
|
|
|
+ }
|
|
//实体数据
|
|
//实体数据
|
|
-// String querySql = "select * from " + aPrivate.getInitTableName() + " where p_key_id=" + task.getId();
|
|
|
|
-// List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
|
|
|
|
Map<String, Object> dataInfo = getBussDataInfo(aPrivate, task.getId());
|
|
Map<String, Object> dataInfo = getBussDataInfo(aPrivate, task.getId());
|
|
//todo 目前直接把key写死在代码里面,后面有空再去动态获取key
|
|
//todo 目前直接把key写死在代码里面,后面有空再去动态获取key
|
|
Map<String, Object> tableData = new HashMap<>();
|
|
Map<String, Object> tableData = new HashMap<>();
|
|
if (dataInfo.size() == 0) {
|
|
if (dataInfo.size() == 0) {
|
|
- tableData.put("key_18__3_1", projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
|
|
- tableData.put("key_7__4_3", reportAllMoney);
|
|
|
|
- tableData.put("key_1__5_3", DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
|
|
- tableData.put("key_5__10_1", reportAllMoney);
|
|
|
|
|
|
+ tableData.put(map.get("项目名称:"), projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
|
|
+ tableData.put(map.get("要求付款额度"), reportAllMoney);
|
|
|
|
+ tableData.put(map.get("意见发出日期:"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_本期审核进度款(元)"), reportAllMoney);
|
|
//获取本期之前所有计量期金额
|
|
//获取本期之前所有计量期金额
|
|
BigDecimal beforeMoney = contractMeterPeriodMapper.getBeforeMoney(period);
|
|
BigDecimal beforeMoney = contractMeterPeriodMapper.getBeforeMoney(period);
|
|
if (beforeMoney != null){
|
|
if (beforeMoney != null){
|
|
- tableData.put("key_14__11_1",beforeMoney);
|
|
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)"),beforeMoney);
|
|
}
|
|
}
|
|
- tableData.put("key_10__11_3", beforeMoney == null ? reportAllMoney : beforeMoney.add(reportAllMoney));
|
|
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), beforeMoney == null ? reportAllMoney : beforeMoney.add(reportAllMoney));
|
|
} else {
|
|
} else {
|
|
tableData = dataInfo;
|
|
tableData = dataInfo;
|
|
- tableData.put("key_18__3_1", projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
|
|
}
|
|
}
|
|
vo.setTableData(tableData);
|
|
vo.setTableData(tableData);
|
|
} else {
|
|
} else {
|
|
@@ -2477,6 +2480,12 @@ public class TaskController extends BladeController {
|
|
throw new ServiceException(r.getMsg());
|
|
throw new ServiceException(r.getMsg());
|
|
}
|
|
}
|
|
WbsTreePrivate aPrivate = (WbsTreePrivate) r.getData();
|
|
WbsTreePrivate aPrivate = (WbsTreePrivate) r.getData();
|
|
|
|
+ //获取所有的key
|
|
|
|
+ Map<String, String> map = FileUtils.getHtmlAllKey(aPrivate.getHtmlUrl());
|
|
|
|
+// Map<String, String> map = FileUtils.getHtmlAllKey("C:\\Users\\泓创研发01\\Desktop\\fsdownload\\1789967486389583872.html");
|
|
|
|
+ if (map.size() == 0){
|
|
|
|
+ throw new ServiceException("未获取到html中的keyName");
|
|
|
|
+ }
|
|
if (isDefiniteFlow) {
|
|
if (isDefiniteFlow) {
|
|
Integer auditFlow2 = auditFlow;
|
|
Integer auditFlow2 = auditFlow;
|
|
flowIds = query.stream().filter(l -> l.getFixedFlowBranchSort() == auditFlow2)
|
|
flowIds = query.stream().filter(l -> l.getFixedFlowBranchSort() == auditFlow2)
|
|
@@ -2532,17 +2541,17 @@ public class TaskController extends BladeController {
|
|
Task updateTask = new Task();
|
|
Task updateTask = new Task();
|
|
updateTask.setId(task.getId());
|
|
updateTask.setId(task.getId());
|
|
Map<String, Object> tableData = dto.getTableData();
|
|
Map<String, Object> tableData = dto.getTableData();
|
|
- Object object = tableData.get("key_5__10_1");
|
|
|
|
|
|
+ Object object = tableData.get(map.get("造价机构现场咨询意见_本期审核进度款(元)"));
|
|
if (object != null) {
|
|
if (object != null) {
|
|
try {
|
|
try {
|
|
BigDecimal decimal = new BigDecimal(object.toString());
|
|
BigDecimal decimal = new BigDecimal(object.toString());
|
|
updateTask.setTaskCommonMoney(decimal);
|
|
updateTask.setTaskCommonMoney(decimal);
|
|
- Object object2 = tableData.get("key_14__11_1");
|
|
|
|
|
|
+ Object object2 = tableData.get(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)"));
|
|
if (object2 != null) {
|
|
if (object2 != null) {
|
|
BigDecimal decimal2 = new BigDecimal(object2.toString());
|
|
BigDecimal decimal2 = new BigDecimal(object2.toString());
|
|
- tableData.put("key_10__11_3", decimal.add(decimal2));
|
|
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal.add(decimal2));
|
|
} else {
|
|
} else {
|
|
- tableData.put("key_10__11_3", decimal);
|
|
|
|
|
|
+ tableData.put(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), decimal);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new ServiceException("本期审核进度款格式不对");
|
|
throw new ServiceException("本期审核进度款格式不对");
|
|
@@ -2551,24 +2560,24 @@ public class TaskController extends BladeController {
|
|
//如果为第一流程则判断是否当前流程已全部审批,已经全部审批则生成电签PDF,没有全部审批则只保存数据
|
|
//如果为第一流程则判断是否当前流程已全部审批,已经全部审批则生成电签PDF,没有全部审批则只保存数据
|
|
if (isAllApp) {
|
|
if (isAllApp) {
|
|
//要求付款额度
|
|
//要求付款额度
|
|
- this.addYuan("key_7__4_3", tableData);
|
|
|
|
|
|
+ this.addYuan(map.get("要求付款额度"), tableData);
|
|
//本期审核进度款
|
|
//本期审核进度款
|
|
- this.addYuan("key_5__10_1", tableData);
|
|
|
|
|
|
+ this.addYuan(map.get("造价机构现场咨询意见_本期审核进度款(元)"), tableData);
|
|
//截至上期累计进度款
|
|
//截至上期累计进度款
|
|
- this.addYuan("key_14__11_1", tableData);
|
|
|
|
|
|
+ this.addYuan(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)"), tableData);
|
|
//截至本期累计进度款
|
|
//截至本期累计进度款
|
|
- this.addYuan("key_10__11_3", tableData);
|
|
|
|
|
|
+ this.addYuan(map.get("造价机构现场咨询意见_截止上期已累计审批进度款(元)_截止本期已累计审核进度款(元)"), tableData);
|
|
if (flowIds.size() == 0) {
|
|
if (flowIds.size() == 0) {
|
|
throw new ServiceException("未找到流程人信息");
|
|
throw new ServiceException("未找到流程人信息");
|
|
}
|
|
}
|
|
- tableData.put("key_18__3_1", projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
|
|
|
|
+ tableData.put(map.get("项目名称:"), projectClient.getById(task.getProjectId()).getProjectName() + contractClient.getContractById(Long.valueOf(task.getContractId())).getContractName());
|
|
//申请进度时间
|
|
//申请进度时间
|
|
- tableData.put("key_17__7_3", DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
|
|
|
|
+ tableData.put(map.get("申请进度款摘录_摘录人_时间"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
//电签单位日期
|
|
//电签单位日期
|
|
- tableData.put("key_4__13_4", DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
|
|
|
|
+ tableData.put(map.get("建设单位签收_日期"), DateTimeFormatter.ofPattern("yyyy年MM月dd日").format(LocalDate.now()));
|
|
String pdfUrl = "";
|
|
String pdfUrl = "";
|
|
try {
|
|
try {
|
|
- pdfUrl = getEntrustPDFTrial(Long.valueOf(dto.getProjectId()), dto.getContractId(), aPrivate.getPKeyId(), tableData, flowIds);
|
|
|
|
|
|
+ pdfUrl = getEntrustPDFTrial(aPrivate, dto.getContractId(), tableData, flowIds);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new ServiceException("生成咨询意见时失败:" + e.getMessage());
|
|
throw new ServiceException("生成咨询意见时失败:" + e.getMessage());
|
|
}
|
|
}
|
|
@@ -3475,7 +3484,7 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
//校验是否被使用过
|
|
//校验是否被使用过
|
|
List<Task> tasks = jdbcTemplate
|
|
List<Task> tasks = jdbcTemplate
|
|
- .query("SELECT * FROM u_task WHERE contract_id = ? and is_deleted = 0 AND fixed_flow_id = ? ",
|
|
|
|
|
|
+ .query("SELECT * FROM u_task WHERE contract_id = ? and is_deleted = 0 and status != 3 AND fixed_flow_id = ? ",
|
|
new Object[]{dto.getContractId(),dto.getFixedFlowId()}, new BeanPropertyRowMapper<>(Task.class));
|
|
new Object[]{dto.getContractId(),dto.getFixedFlowId()}, new BeanPropertyRowMapper<>(Task.class));
|
|
if (tasks.size() > 0){
|
|
if (tasks.size() > 0){
|
|
return R.fail("当前流程已经使用,不能修改");
|
|
return R.fail("当前流程已经使用,不能修改");
|
|
@@ -3536,7 +3545,7 @@ public class TaskController extends BladeController {
|
|
@ApiOperation(value = "计量刪除预设流程", notes = "传入预设流程id")
|
|
@ApiOperation(value = "计量刪除预设流程", notes = "传入预设流程id")
|
|
public R<Object> deleteFixedFlow(@RequestParam String id) {
|
|
public R<Object> deleteFixedFlow(@RequestParam String id) {
|
|
List<Task> tasks = jdbcTemplate
|
|
List<Task> tasks = jdbcTemplate
|
|
- .query("SELECT * FROM u_task WHERE is_deleted = 0 AND fixed_flow_id = ? ",
|
|
|
|
|
|
+ .query("SELECT * FROM u_task WHERE is_deleted = 0 and status != 3 AND fixed_flow_id = ? ",
|
|
new Object[]{id}, new BeanPropertyRowMapper<>(Task.class));
|
|
new Object[]{id}, new BeanPropertyRowMapper<>(Task.class));
|
|
if (tasks.size() > 0){
|
|
if (tasks.size() > 0){
|
|
return R.fail("当前流程已经使用,不能删除");
|
|
return R.fail("当前流程已经使用,不能删除");
|
|
@@ -3566,7 +3575,7 @@ public class TaskController extends BladeController {
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|
|
- // 远程搜索配置
|
|
|
|
|
|
+ // 获取表单字符串返回
|
|
org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
|
|
org.jsoup.nodes.Document doc = Jsoup.parse(htmlString);
|
|
Element table = doc.select("table").first();
|
|
Element table = doc.select("table").first();
|
|
|
|
|
|
@@ -3576,17 +3585,12 @@ public class TaskController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public String getEntrustPDFTrial(Long projectId,String contractId,Long pkeyId,Map<String, Object> DataInfo, Map<Long,String> flowIds) throws Exception {
|
|
|
|
|
|
+ public String getEntrustPDFTrial( WbsTreePrivate aPrivate,String contractId,Map<String, Object> DataInfo, Map<Long,String> flowIds) throws Exception {
|
|
String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
- R r = wbsTreePrivateClient.getProjectOpinionNode(projectId);
|
|
|
|
- if (r.getCode() != 200){
|
|
|
|
- throw new ServiceException(r.getMsg());
|
|
|
|
- }
|
|
|
|
- WbsTreePrivate aPrivate = (WbsTreePrivate) r.getData();
|
|
|
|
-
|
|
|
|
- String pdfPath = file_path + "/pdf//" + pkeyId + ".pdf";
|
|
|
|
- String excelPath = file_path + "/pdf//" + pkeyId + ".xlsx";
|
|
|
|
|
|
+ Long pkeyId = aPrivate.getPKeyId();
|
|
|
|
+ String pdfPath = file_path + "archiveCheck/" + SnowFlakeUtil.getId() + ".pdf";
|
|
|
|
+ String excelPath = file_path + "archiveCheck/" + SnowFlakeUtil.getId() + ".xlsx";
|
|
|
|
|
|
File tabPdf = ResourceUtil.getFile(pdfPath);
|
|
File tabPdf = ResourceUtil.getFile(pdfPath);
|
|
if (tabPdf.exists()) {
|
|
if (tabPdf.exists()) {
|