Commit a5982574 by 高晓磊

摄像头关联摄像头账号表

parent 335254ea
......@@ -2,6 +2,7 @@ package com.xyst.dinas.biz.internal.dao;
import com.beecode.amino.core.Amino;
import com.beecode.bap.attachment.common.Page;
import com.beecode.bap.org.BapOrgConstants;
import com.beecode.bcp.core.context.AminoContextHolder;
import com.beecode.bcp.type.KClass;
import com.beecode.bcp.type.KObject;
......@@ -56,7 +57,7 @@ public class CameraInfoDaoImpl extends AbstractBaseDao implements CameraInfoDao,
detachedCriteria.add(Restrictions.eq("del", false));
detachedCriteria.add(Restrictions.eq("regionalCompany.id", currentLoginRegionalCompany.getUuid("id")));
if(null!=stationId){
detachedCriteria.add(Restrictions.eq("stationId", stationId));
detachedCriteria.add(Restrictions.eq("regionalStation.id", stationId));
}
if(null!=watershedId){
detachedCriteria.add(Restrictions.eq("watershedId", watershedId));
......@@ -89,6 +90,10 @@ public class CameraInfoDaoImpl extends AbstractBaseDao implements CameraInfoDao,
kobject.set("creator", id.get("creator"));
kobject.set("createTime", id.getDate("createTime"));
kobject.set("regionalCompany", currentLoginRegionalCompany);
Object cameraAccount = template.load("com.xyst.dinas.biz.dict.datamodel.CameraAccount", kobject.get("cameraAccount").getUuid("id"));
Object regionalStation = template.load("com.xyst.dinas.biz.datamodel.Station", kobject.get("regionalStation").getUuid("id"));
kobject.set("cameraAccount",cameraAccount);
kobject.set("regionalStation",regionalStation);
KObject staff = AminoContextHolder.getContext().getStaff();
kobject.set("modifyTime", new Date());
kobject.set("modifier", staff);
......@@ -102,6 +107,10 @@ public class CameraInfoDaoImpl extends AbstractBaseDao implements CameraInfoDao,
public UUID create(KObject object, KObject regionalCompany) {
KObject staff = AminoContextHolder.getContext().getStaff();
object.set("id", UUID.randomUUID());
Object cameraAccount = template.load("com.xyst.dinas.biz.dict.datamodel.CameraAccount", object.get("cameraAccount").getUuid("id"));
Object regionalStation = template.load("com.xyst.dinas.biz.datamodel.Station", object.get("regionalStation").getUuid("id"));
object.set("cameraAccount",cameraAccount);
object.set("regionalStation",regionalStation);
object.set("creator", staff);
object.set("createTime", new Date());
object.set("del", false);
......
......@@ -9,7 +9,6 @@ import com.beecode.inz.basis.internal.dao.AbstractBaseDao;
import com.xyst.dinas.biz.constant.StationConstant;
import com.xyst.dinas.biz.dao.DinasTypeDao;
import com.xyst.dinas.biz.dao.StationDao;
import com.xyst.dinas.biz.service.CameraInfoService;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -42,6 +41,8 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
if(null!=stationStatus){
detachedCriteria.add(Restrictions.eq("stationStatus", stationStatus));
}
KObject currentLoginRegionalCompany = dinasTypeDao.getCurrentLoginRegionalCompany();
detachedCriteria.add(Restrictions.eq("regionalCompany.id",currentLoginRegionalCompany.getUuid("id")));
int offset = page.getPageSize() * (page.getPageNo() - 1);
List<KObject> list = (List<KObject>) template.findByCriteria(detachedCriteria,offset,page.getPageSize());
page.setDatas(list);
......
......@@ -63,13 +63,13 @@ public class CameraInfoController {
if(kobject.getBigInteger("cameraObject").intValue()!=1&&kobject.getBigInteger("cameraObject").intValue()!=0){
return ResponseObj.error(400,"所属对象不正确");
}
if(kobject.getBigInteger("cameraObject").intValue()==0&&null==kobject.getUuid("stationId")){
if(kobject.getBigInteger("cameraObject").intValue()==0&&null==kobject.get("regionalStation").get("id")){
return ResponseObj.error(400,"请选择具体的场站");
}
if(kobject.getBigInteger("cameraObject").intValue()==1&&null==kobject.getUuid("watershedId")){
return ResponseObj.error(400,"请选择具体的流域");
}
if(null==kobject.getUuid("cameraAccountId")){
if(null==kobject.get("cameraAccount").get("id")){
return ResponseObj.error(400,"请选择集成账号");
}
......@@ -103,13 +103,13 @@ public class CameraInfoController {
if(kobject.getBigInteger("cameraObject").intValue()!=1&&kobject.getBigInteger("cameraObject").intValue()!=0){
return ResponseObj.error(400,"所属对象不正确");
}
if(kobject.getBigInteger("cameraObject").intValue()==0&&null==kobject.getUuid("stationId")){
if(kobject.getBigInteger("cameraObject").intValue()==0&&null==kobject.get("regionalStation").get("id")){
return ResponseObj.error(400,"请选择具体的场站");
}
if(kobject.getBigInteger("cameraObject").intValue()==1&&null==kobject.getUuid("watershedId")){
return ResponseObj.error(400,"请选择具体的流域");
}
if(null==kobject.getUuid("cameraAccountId")){
if(null==kobject.get("cameraAccount").get("id")){
return ResponseObj.error(400,"请选择集成账号");
}
......
......@@ -12,6 +12,8 @@
<dependency>com.beecode.bap.staff.datamodel.Staff</dependency>
<dependency>com.beecode.inz.common.datamodel.BaseInfo</dependency>
<dependency>com.xyst.dinas.biz.datamodel.Organization</dependency>
<dependency>com.xyst.dinas.biz.datamodel.Station</dependency>
<dependency>com.xyst.dinas.biz.dict.datamodel.CameraAccount</dependency>
<dependency>com.beecode.bap.biztrait.datamodel.BasicBillRequirement</dependency>
<content>
<m:class>
......@@ -89,7 +91,7 @@
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>ba9964ac-661e-4816-92f6-2b8bfa70b2df</m:id>
<m:id>961b9837-a995-4b4e-8790-2c1a9a2e0ade</m:id>
<m:name>isShare</m:name>
<m:title>是否分享</m:title>
<m:type>boolean</m:type>
......@@ -102,7 +104,7 @@
<m:type>bcp.type.constraint.NotNull</m:type>
</m:annotation>
</m:annotations>
<m:id>ba9964ac-661e-4816-92f6-2b8bfa70b2df</m:id>
<m:id>90b731ef-36e8-45d0-a6a1-bd5d5e9a7e6e</m:id>
<m:name>cameraObject</m:name>
<m:title>摄像头所属对象</m:title>
<m:type>int</m:type>
......@@ -133,7 +135,7 @@
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>650ad03e-87d2-11eb-b258-54ee750ba9b2</m:id>
<m:id>79474200-7fb2-4e1d-8d36-677bd744c8fb</m:id>
<m:name>watershedId</m:name>
<m:title>所属流域id</m:title>
<m:type>uuid</m:type>
......@@ -142,10 +144,10 @@
</m:attribute>
<m:attribute>
<m:annotations/>
<m:id>650ad03e-87d2-11eb-b258-54ee750ba9b2</m:id>
<m:name>stationId</m:name>
<m:title>所属场站id</m:title>
<m:type>uuid</m:type>
<m:id>5c95fede-c97e-4047-ab7d-3b2d7f20e524</m:id>
<m:name>regionalStation</m:name>
<m:title>所属场站</m:title>
<m:type>com.xyst.dinas.biz.datamodel.Station</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
......@@ -156,9 +158,9 @@
</m:annotation>
</m:annotations>
<m:id>0a0bf871-7f98-4fe8-b91e-6813e9794264</m:id>
<m:name>cameraAccountId</m:name>
<m:title>摄像头账号id</m:title>
<m:type>uuid</m:type>
<m:name>cameraAccount</m:name>
<m:title>摄像头账号</m:title>
<m:type>com.xyst.dinas.biz.dict.datamodel.CameraAccount</m:type>
<m:description></m:description>
<m:default></m:default>
</m:attribute>
......
......@@ -42,7 +42,7 @@
</property>
<many-to-one name="regionalCompany" entity-name="com.xyst.dinas.biz.datamodel.Organization" fetch="select">
<column name="regional_company" not-null="false">
<column name="regional_company" not-null="true">
<comment>所属组织机构</comment>
</column>
</many-to-one>
......@@ -108,17 +108,16 @@
</column>
</property>
<property name="stationId" type="uuid-binary" not-null="false">
<column name="station_id" length="16">
<comment>场站id</comment>
<many-to-one name="regionalStation" entity-name="com.xyst.dinas.biz.datamodel.Station" fetch="select">
<column name="regional_station" not-null="false" >
<comment>所属场站</comment>
</column>
</property>
<property name="cameraAccountId" type="uuid-binary" not-null="false">
<column name="camera_account_id" length="16">
<comment>摄像头账号id</comment>
</many-to-one>
<many-to-one name="cameraAccount" entity-name="com.xyst.dinas.biz.dict.datamodel.CameraAccount" fetch="select">
<column name="camera_account" not-null="true" >
<comment>摄像头账号</comment>
</column>
</property>
</many-to-one>
<property name="cameraModel" type="nstring" not-null="false">
<column name="camera_model" length="300" >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment