diff --git a/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java b/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java index 0dccee70..448185f0 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcOrganizationController.java @@ -89,6 +89,9 @@ public class DcOrganizationController extends BaseController @PostMapping public AjaxResult add(@RequestBody DcOrganization dcOrganization) { + if (dcOrganization.getParentId()==null){ + return AjaxResult.error("参数错误"); + } return toAjax(dcOrganizationService.insertDcOrganization(dcOrganization)); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java index 5b972b8d..f887018a 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcOrganizationServiceImpl.java @@ -84,6 +84,7 @@ public class DcOrganizationServiceImpl implements IDcOrganizationService public int insertDcOrganization(DcOrganization dcOrganization) { dcOrganization.setCreateTime(DateUtils.getNowDate()); + dcOrganization.setOrganizationType(2);//注入类型为驻点 return dcOrganizationMapper.insertDcOrganization(dcOrganization); } diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index ee7587ba..fcde4c70 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -46,14 +46,11 @@ order by warning.warning_time desc