|
@@ -1104,23 +1104,14 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean syncContractTabSort(String projectId) {
|
|
|
- if (ObjectUtil.isNotEmpty(projectId)) {
|
|
|
- List<WbsTreePrivate> tabs = jdbcTemplate.query("select id,p_key_id,sort from m_wbs_tree_private where is_deleted = 0 and sort is not null and wbs_type = 1 and project_id = " + projectId, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
- List<ContractInfo> contractInfos = jdbcTemplate.query("select id from m_contract_info where is_deleted = 0 and contract_type = 1 and p_id = " + projectId, new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
- for (ContractInfo contractInfo : contractInfos) {
|
|
|
- for (List<WbsTreePrivate> wbsTreePrivates : Lists.partition(tabs, 1000)) {
|
|
|
- try {
|
|
|
- this.batchUpdateData(wbsTreePrivates, contractInfo.getId());
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- throw new ServiceException("保存数据异常,请联系管理员");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return true;
|
|
|
+ public boolean syncContractTabSort(String projectId,Long pKeyId) {
|
|
|
+ //1、获取指定项目指定节点下的表单信息
|
|
|
+ Long count = wbsTreePrivateMapper.selectCount(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPId, pKeyId).eq(WbsTreePrivate::getType, 1));
|
|
|
+ if(count > 0){
|
|
|
+ throw new RuntimeException("请选择底层节点");
|
|
|
}
|
|
|
- return false;
|
|
|
+ baseMapper.updateSortNotIsUseSort(Long.valueOf(projectId),pKeyId);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|