|
@@ -772,36 +772,36 @@ public class MeterTreeController extends BladeController {
|
|
|
@GetMapping("/contract/remove")
|
|
|
@ApiOperationSupport(order = 29)
|
|
|
@ApiOperation(value = "合同段树节点删除", notes = "传入id")
|
|
|
- public R<Object> contractRemove(@RequestParam String id) {
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
- MeterTreeContract obj = meterTreeContractService.getById(id);
|
|
|
- if (obj != null) {
|
|
|
- if (obj.getParentId().equals(0L) && obj.getAncestor().equals("0")) {
|
|
|
- throw new ServiceException("根节点无法删除");
|
|
|
- }
|
|
|
-
|
|
|
- /*子节点判断*/
|
|
|
- Long countChild = meterTreeContractService.getBaseMapper().selectCount(Wrappers.<MeterTreeContract>lambdaQuery()
|
|
|
- .eq(MeterTreeContract::getTemplateId, obj.getTemplateId())
|
|
|
- .eq(MeterTreeContract::getProjectId, obj.getProjectId())
|
|
|
- .eq(MeterTreeContract::getContractId, obj.getContractId())
|
|
|
- .eq(MeterTreeContract::getStatus, 1)
|
|
|
- .like(MeterTreeContract::getAncestor, id));
|
|
|
- if (countChild > 0) {
|
|
|
- throw new ServiceException("该节点下存在子节点,无法删除");
|
|
|
- }
|
|
|
-
|
|
|
- /*清单判断*/
|
|
|
- Long inventoryFormMeterCount = inventoryFormMeterService.getBaseMapper().selectCount(Wrappers.<InventoryFormMeter>lambdaQuery()
|
|
|
- .eq(InventoryFormMeter::getContractMeterId, id));
|
|
|
- if (inventoryFormMeterCount != null && inventoryFormMeterCount > 0) {
|
|
|
- throw new ServiceException("该节点下存在清单信息,无法删除");
|
|
|
- }
|
|
|
-
|
|
|
- return R.data(meterTreeContractService.removeById(id));
|
|
|
- }
|
|
|
- }
|
|
|
- return R.fail("操作失败");
|
|
|
+ public R<Object> contractRemove(@RequestParam Long id) {
|
|
|
+ return meterTreeContractService.contractRemove(id);
|
|
|
+// if (StringUtils.isNotEmpty(id)) {
|
|
|
+// MeterTreeContract obj = meterTreeContractService.getById(id);
|
|
|
+// if (obj != null) {
|
|
|
+// if (obj.getParentId().equals(0L) && obj.getAncestor().equals("0")) {
|
|
|
+// throw new ServiceException("根节点无法删除");
|
|
|
+// }
|
|
|
+//
|
|
|
+// /*子节点判断*/
|
|
|
+// Long countChild = meterTreeContractService.getBaseMapper().selectCount(Wrappers.<MeterTreeContract>lambdaQuery()
|
|
|
+// .eq(MeterTreeContract::getTemplateId, obj.getTemplateId())
|
|
|
+// .eq(MeterTreeContract::getProjectId, obj.getProjectId())
|
|
|
+// .eq(MeterTreeContract::getContractId, obj.getContractId())
|
|
|
+// .eq(MeterTreeContract::getStatus, 1)
|
|
|
+// .like(MeterTreeContract::getAncestor, id));
|
|
|
+// if (countChild > 0) {
|
|
|
+// throw new ServiceException("该节点下存在子节点,无法删除");
|
|
|
+// }
|
|
|
+//
|
|
|
+// /*清单判断*/
|
|
|
+// Long inventoryFormMeterCount = inventoryFormMeterService.getBaseMapper().selectCount(Wrappers.<InventoryFormMeter>lambdaQuery()
|
|
|
+// .eq(InventoryFormMeter::getContractMeterId, id));
|
|
|
+// if (inventoryFormMeterCount != null && inventoryFormMeterCount > 0) {
|
|
|
+// throw new ServiceException("该节点下存在清单信息,无法删除");
|
|
|
+// }
|
|
|
+//
|
|
|
+// return R.data(meterTreeContractService.removeById(id));
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
@GetMapping("/contract/lock")
|