|
|
@@ -122,6 +122,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
private final InformationQueryClient informationQueryClient;
|
|
|
private final IWbsTreeContractService wbsTreeContractService;
|
|
|
+ private final WbsTreeContractExtendService wbsTreeContractExtendService;
|
|
|
private final IFormulaService formulaService;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@@ -1087,12 +1088,33 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
public void gsColor(Long pKeyId, String nodeId, String projectId, Document doc) {
|
|
|
try {
|
|
|
List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(Collections.singletonList(pKeyId), projectId, nodeId, ExecuteType.INSPECTION);
|
|
|
+ //扩展----根据父节点查询不允许执行的公式
|
|
|
+ WbsTreeContractExtend byId = wbsTreeContractExtendService.getById(nodeId);
|
|
|
+ List<String> list;
|
|
|
+
|
|
|
+ if(byId != null){
|
|
|
+ String formulaConfig = byId.getFormulaConfig();
|
|
|
+ if(StringUtils.isNotEmpty(formulaConfig)){
|
|
|
+ list = Arrays.asList(formulaConfig.split(","));
|
|
|
+ } else {
|
|
|
+ list = new ArrayList<>();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list = new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
if (!keyMappers.isEmpty()) {
|
|
|
keyMappers.stream()
|
|
|
.filter(e -> e.getFormulaId() != null)
|
|
|
.forEach(e -> {
|
|
|
String key = e.getField() + "__";
|
|
|
- processElements(doc.select("table").first().select("[keyname^=" + key + "]"));
|
|
|
+ Elements select = doc.select("table").first().select("[keyname^=" + key + "]");
|
|
|
+ if(list.contains(e.getTableName() + ":" + e.getField())){
|
|
|
+ //当前元素不执行公式
|
|
|
+ select.stream().map(this::findParentTd).filter(Objects::nonNull).forEach(element -> element.attr("clearFormula", "1"));
|
|
|
+ }else{
|
|
|
+ processElements(select);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
} catch (Exception e) {
|