|
@@ -131,6 +131,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
private final WbsFormElementMapper wbsFormElementMapper;
|
|
|
private final TrialCyAccessoriesClient trialCyAccessoriesClient;
|
|
|
private final WbsTreeContractStatisticsClient wbsTreeContractStatisticsClient;
|
|
|
+ private final FormulaDataBlockMapper formulaDataBlockMapper;
|
|
|
|
|
|
|
|
|
|
|
@@ -4694,8 +4695,36 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
if(dto.getRightPkeyId()==null){
|
|
|
throw new ServiceException("请选择要移动到哪个节点");
|
|
|
}
|
|
|
- List<WbsTreeContract> list= wbsTreeContractMapper.getWbsTreeContractsByPKeyIds(dto.getLeftPkeyIds());
|
|
|
+ List<WbsTreeContract> list= wbsTreeContractMapper.getWbsTreeContractsByPKeyIds(dto.getLeftPkeyIds());
|
|
|
+ WbsTreeContract moveFatherNode = this.getById(list.get(0).getPId());
|
|
|
WbsTreeContract fatherContract = this.getById(dto.getRightPkeyId());
|
|
|
+
|
|
|
+ String sql="SELECT * from m_formula_data_block WHERE sw_id = "+moveFatherNode.getId()+" and contract_id ="+moveFatherNode.getContractId()+" and type =0";
|
|
|
+ List<FormulaDataBlock> formulaDataBlocks1 = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(FormulaDataBlock.class));
|
|
|
+
|
|
|
+ String sql1="SELECT * from m_formula_data_block WHERE sw_id = "+fatherContract.getId()+" and contract_id ="+fatherContract.getContractId()+" and type =0";
|
|
|
+ List<FormulaDataBlock> formulaDataBlocks2 = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(FormulaDataBlock.class));
|
|
|
+ List<ElementBlock> elementBlocks1=new ArrayList<>();
|
|
|
+ List<ElementBlock> elementBlocks2=new ArrayList<>();
|
|
|
+ if(formulaDataBlocks2.size()>0){
|
|
|
+ if(formulaDataBlocks1.size()>0){
|
|
|
+ elementBlocks1= JSON.parseArray(formulaDataBlocks1.get(0).getVal(), ElementBlock.class);
|
|
|
+ elementBlocks2= JSON.parseArray(formulaDataBlocks2.get(0).getVal(), ElementBlock.class);
|
|
|
+ elementBlocks2.addAll(elementBlocks1);
|
|
|
+ formulaDataBlocks2.get(0).setVal(JSON.toJSONString(elementBlocks2));
|
|
|
+ formulaDataBlockMapper.updateById(formulaDataBlocks2.get(0));
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(formulaDataBlocks1.size()>0){
|
|
|
+ elementBlocks1= JSON.parseArray(formulaDataBlocks1.get(0).getVal(), ElementBlock.class);
|
|
|
+ FormulaDataBlock insert = new FormulaDataBlock();
|
|
|
+ insert.setContractId(Long.parseLong(fatherContract.getContractId()));
|
|
|
+ insert.setType(0);
|
|
|
+ insert.setSwId(fatherContract.getId());
|
|
|
+ insert.setVal(JSON.toJSONString(elementBlocks1));
|
|
|
+ formulaDataBlockMapper.insert(insert);
|
|
|
+ }
|
|
|
+ }
|
|
|
for (WbsTreeContract contract : list) {
|
|
|
String oldancestorsPId = contract.getAncestorsPId();
|
|
|
String oldancestors = contract.getAncestors();
|