|
@@ -451,13 +451,23 @@ public class WbsTreePrivateController extends BladeController {
|
|
|
@ApiOperation(value = "删除节点下的元素表", notes = "传入表单id、wbsId、projectId")
|
|
|
public R removeTableByCondition(@RequestParam("id") String id,
|
|
|
@RequestParam("wbsId") String wbsId,
|
|
|
- @RequestParam("projectId") String projectId) {
|
|
|
- Long row = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getWbsId, wbsId).eq(WbsTreeContract::getId, id));
|
|
|
- if (row > 0L) {
|
|
|
- throw new ServiceException("当前表单被合同段引用中,删除失败");
|
|
|
- }
|
|
|
- if (wbsTreePrivateService.removeTableByCondition(id, wbsId, projectId)) {
|
|
|
- return R.success("删除成功");
|
|
|
+ @RequestParam("projectId") String projectId, @RequestParam("pKeyId") String pKeyId) {
|
|
|
+ if (StringUtil.isNumeric(pKeyId)) {
|
|
|
+ Long row = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getWbsId, wbsId).eq(WbsTreeContract::getIsTypePrivatePid, pKeyId));
|
|
|
+ if (row > 0L) {
|
|
|
+ throw new ServiceException("当前表单被合同段引用中,删除失败");
|
|
|
+ }
|
|
|
+ if (wbsTreePrivateService.removeTableByPKeyIdCondition(pKeyId, wbsId, projectId)) {
|
|
|
+ return R.success("删除成功");
|
|
|
+ }
|
|
|
+ } else if (StringUtil.isNumeric(id)) {
|
|
|
+ Long row = wbsTreeContractMapper.selectCount(Wrappers.<WbsTreeContract>query().lambda().eq(WbsTreeContract::getProjectId, projectId).eq(WbsTreeContract::getWbsId, wbsId).eq(WbsTreeContract::getId, id));
|
|
|
+ if (row > 0L) {
|
|
|
+ throw new ServiceException("当前表单被合同段引用中,删除失败");
|
|
|
+ }
|
|
|
+ if (wbsTreePrivateService.removeTableByCondition(id, wbsId, projectId)) {
|
|
|
+ return R.success("删除成功");
|
|
|
+ }
|
|
|
}
|
|
|
return R.fail("删除失败");
|
|
|
}
|