委托撤回功能 增加本地事务
This commit is contained in:
@ -22,6 +22,7 @@ import com.chinaunicom.mall.ebtp.project.projectrecord.service.IProjectRecordSer
|
|||||||
import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService;
|
import com.chinaunicom.mall.ebtp.project.projectsection.service.IProjectSectionService;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -103,6 +104,7 @@ public class ProjectEntrustBackServiceImpl extends ServiceImpl<ProjectEntrustBac
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean recall(String id) {
|
public boolean recall(String id) {
|
||||||
ProjectEntrustBack entrustBack = this.getById(id);
|
ProjectEntrustBack entrustBack = this.getById(id);
|
||||||
|
|
||||||
|
@ -494,6 +494,7 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean deleteProjectEntrust(Long ebpProjectId,String reason) {
|
public boolean deleteProjectEntrust(Long ebpProjectId,String reason) {
|
||||||
|
|
||||||
LambdaQueryWrapper<ProjectEntrust> queryWrapper = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<ProjectEntrust> queryWrapper = Wrappers.lambdaQuery();
|
||||||
@ -525,7 +526,6 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
|||||||
recordQueryWrapper.eq(ProjectRecord::getEntrustId, delProjectEntrust.getId());
|
recordQueryWrapper.eq(ProjectRecord::getEntrustId, delProjectEntrust.getId());
|
||||||
List<ProjectRecord> recordList = projectRecordService.list(recordQueryWrapper);
|
List<ProjectRecord> recordList = projectRecordService.list(recordQueryWrapper);
|
||||||
|
|
||||||
this.removeById(delProjectEntrust.getId());
|
|
||||||
if(!CollectionUtils.isEmpty(recordList)){
|
if(!CollectionUtils.isEmpty(recordList)){
|
||||||
long recordCount = recordList.stream().filter(n -> n.getStatus() > 1).count();
|
long recordCount = recordList.stream().filter(n -> n.getStatus() > 1).count();
|
||||||
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_RECORD_NOT_BACK.customValid(recordCount > 0);
|
ProjectExceptionEnum.FRAME_EXCEPTION_PROJECT_RECORD_NOT_BACK.customValid(recordCount > 0);
|
||||||
@ -539,8 +539,10 @@ public class ProjectEntrustServiceImpl extends BaseServiceImpl<ProjectEntrustMap
|
|||||||
projectRecordService.removeById(record.getId());
|
projectRecordService.removeById(record.getId());
|
||||||
sectionService.remove(new LambdaQueryWrapper<ProjectSection>().eq(ProjectSection::getProjectId,record.getId()));
|
sectionService.remove(new LambdaQueryWrapper<ProjectSection>().eq(ProjectSection::getProjectId,record.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
entrustBack.setDeleteData(deleteData);
|
entrustBack.setDeleteData(deleteData);
|
||||||
entrustBackService.save(entrustBack);
|
entrustBackService.save(entrustBack);
|
||||||
|
this.removeById(delProjectEntrust.getId());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user