|
@@ -34,9 +34,12 @@ import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
import org.springblade.core.redis.cache.BladeRedis;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.IoUtil;
|
|
|
import org.springblade.core.tool.utils.ResourceUtil;
|
|
|
+import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.manager.entity.WbsTreePrivate;
|
|
|
+import org.springblade.manager.feign.WbsTreePrivateClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@@ -289,11 +292,27 @@ public class TrialNumberRuleServiceImpl extends BaseServiceImpl<TrialNumberRuleM
|
|
|
|
|
|
@Override
|
|
|
public Map<String, String> getEntrustNumber(Long pkeyId,Long contractId) throws FileNotFoundException {
|
|
|
+ // 合同段信息
|
|
|
+ String sql="select * from m_contract_info where id="+contractId;
|
|
|
+ ContractInfo contractInfo =jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
+ String sql1="select * from m_wbs_tree_private where p_key_id="+pkeyId;
|
|
|
+ // 节点数
|
|
|
+ WbsTreePrivate treePrivate = jdbcTemplate.queryForObject(sql1,new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
+ if (contractInfo == null) {
|
|
|
+ throw new ServiceException("合同段信息为null");
|
|
|
+ }
|
|
|
+ if (contractInfo.getContractType() == 2) { //3 监理
|
|
|
+ pkeyId = treePrivate.getJlerTreeId();
|
|
|
+ } else if (contractInfo.getContractType() == 3 || contractInfo.getContractType() == 8) { //业主
|
|
|
+ pkeyId = treePrivate.getYzerTreeId();
|
|
|
+ }else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String sql2="select * from m_wbs_tree_private where p_key_id="+pkeyId;
|
|
|
+ WbsTreePrivate wbsTreePrivate1 = jdbcTemplate.queryForObject(sql2, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
+ String fileUrl = wbsTreePrivate1.getHtmlUrl();
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
|
|
|
- String sql="Select html_url from m_wbs_tree_private where p_key_id="+pkeyId;
|
|
|
- WbsTreePrivate wbsTreePrivate = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
- String fileUrl = wbsTreePrivate.getHtmlUrl();
|
|
|
File file1 = ResourceUtil.getFile(fileUrl);
|
|
|
InputStream fileInputStream;
|
|
|
if (file1.exists()) {
|
|
@@ -303,14 +322,12 @@ public class TrialNumberRuleServiceImpl extends BaseServiceImpl<TrialNumberRuleM
|
|
|
fileInputStream = CommonUtil.getOSSInputStream(path);
|
|
|
}
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
- htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
- htmlString = htmlString.replaceAll("title", "titlexx");
|
|
|
Document doc = Jsoup.parse(htmlString);
|
|
|
- Elements elementsWithPlaceholderxx = doc.select("el-input[placeholder~=.*委托单编号.*]");
|
|
|
+ Elements elementsWithPlaceholderxx = doc.select("el-input[placeholder*=委托单编号]");
|
|
|
if(!elementsWithPlaceholderxx.isEmpty()){
|
|
|
Element first = elementsWithPlaceholderxx.first();
|
|
|
String key = first.attr("id");
|
|
|
- Map<String, String> map = getTrialNumber(Long.valueOf(wbsTreePrivate.getProjectId()),contractId, 3, pkeyId, true);
|
|
|
+ Map<String, String> map = getTrialNumber(Long.valueOf(wbsTreePrivate1.getProjectId()),contractId, 3, pkeyId, true);
|
|
|
map.put(key,map.get("trialNumber"));
|
|
|
return map;
|
|
|
}
|