Commit 9cad4c13 by 高晓磊

场站管理增删改查提交

parent ba4171d8
......@@ -20,4 +20,7 @@ public interface StationDao extends BaseDao {
void deleteById(UUID id);
List<KObject> getByName(String name, UUID id);
void modify(KObject kobject);
}
......@@ -60,11 +60,24 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
return (List<KObject>) template.findByCriteria(detachedCriteria);
}
@Override
public void modify(KObject kobject) {
KObject id = load(kobject.getUuid("id"));
kobject.set("creator",id.get("creator"));
kobject.set("createTime",id.getDate("createTime"));
KObject staff = AminoContextHolder.getContext().getStaff();
kobject.set("modifyTime",new Date());
kobject.set("modifier",staff.getUuid("id"));
kobject.set("del",true);
template.merge(kobject);
}
@Override
public UUID create(KObject kObject) {
KObject staff = AminoContextHolder.getContext().getStaff();
kObject.set("department", staff.get("department"));
kObject.set("id",UUID.randomUUID());
kObject.set("creator",staff);
kObject.set("createTime", new Date());
kObject.set("del",false);
......@@ -79,7 +92,10 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
@Override
public void deleteById(UUID id) {
KObject staff = AminoContextHolder.getContext().getStaff();
KObject kobject = (KObject) template.load(STATION, id);
kobject.set("modifyTime",new Date());
kobject.set("modifier.id",staff.getUuid("id"));
kobject.set("del",true);
template.update(kobject);
}
......
......@@ -51,7 +51,8 @@ public class StationServiceImpl implements StationService {
@Override
public void update(KObject kobject) {
stationDao.update(kobject);
stationDao.modify(kobject);
}
@Override
......
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://www.beecode.cn/schema/amino-metadata" xmlns:m="http://www.beecode.cn/schema/inz-query">
<specification>1.0</specification>
<id>17949029-14df-48e6-8b8b-383e44383095</id>
<name>com.xyst.dinas.biz.query.StationInfoApply</name>
<title>场站管理</title>
<description>场站管理</description>
<define>inz.query.Query</define>
<define-version>1.0</define-version>
<dependency>com.xyst.dinas.biz.datamodel.Station</dependency>
<content>
<m:query>
<m:type>com.xyst.dinas.biz.datamodel.Station</m:type>
<m:dataProcessor>com.xyst.dinas.biz.internal.StationInfoQueryProcessor</m:dataProcessor>
<m:authorityItem></m:authorityItem>
<m:innerScenes>
<m:innerScene>
<m:id>054ad121-1501-4047-9574-0268bd08ba1b</m:id>
<m:title>全部</m:title>
<m:javaImplement>com.beecode.inz.common.scene.CommonAllScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
<m:innerScene>
<m:id>d40d3b3b-5f67-4c96-bed3-3bc186d6433b</m:id>
<m:title>已废弃</m:title>
<m:javaImplement>com.beecode.inz.common.scene.DefaultDiscardScene</m:javaImplement>
<m:defaultExecute></m:defaultExecute>
<m:hide></m:hide>
</m:innerScene>
</m:innerScenes>
<m:fields>
<m:field>
<m:name>id</m:name>
<m:title>id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>stationName</m:name>
<m:title>场站名称</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>stationAddress</m:name>
<m:title>场站地址</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>department.id</m:name>
<m:title>所属部门id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.beecode.bap.department.datamodel.Department</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>department.name</m:name>
<m:title>所属部门名称</m:title>
<m:type>string</m:type>
<m:ref>
<m:name>com.beecode.bap.department.datamodel.Department</m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>createTime</m:name>
<m:title>创建时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>creator.id</m:name>
<m:title>创建人id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.beecode.bap.staff.datamodel.Staff</m:name>
<m:type>数据字典</m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>creator.name</m:name>
<m:title>创建人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifyTime</m:name>
<m:title>修改时间</m:title>
<m:type>datetime</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifier.name</m:name>
<m:title>修改人</m:title>
<m:type>string</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>modifier.id</m:name>
<m:title>修改人id</m:title>
<m:type>uuid</m:type>
<m:ref>
<m:name>com.beecode.bap.staff.datamodel.Staff</m:name>
<m:type>数据字典</m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
<m:field>
<m:name>stationStatus</m:name>
<m:title>场站状态</m:title>
<m:type>int</m:type>
<m:ref>
<m:name></m:name>
<m:type></m:type>
</m:ref>
<m:desc></m:desc>
</m:field>
</m:fields>
</m:query>
</content>
</metadata>
\ No newline at end of file
......@@ -22,23 +22,23 @@
<column name="modifier_id" not-null="false"/>
</many-to-one>
<property name="del" type="boolean" not-null="false">
<column name="del"/>
<column name="del" default="false"/>
</property>
<property name="discard" type="boolean" not-null="false">
<column name="discard"/>
<column name="discard" default="false" />
</property>
<many-to-one name="department" entity-name="com.beecode.bap.department.datamodel.Department" fetch="select">
<column name="department" not-null="false"/>
</many-to-one>
<property name="stationName" type="nstring" not-null="true">
<column name="station_name" length="200" />
<column name="station_name" length="30" />
</property>
<property name="stationAddress" type="nstring" length="200" not-null="false">
<property name="stationAddress" type="nstring" length="80" not-null="false">
<column name="station_address"/>
</property>
<property name="stationStatus" type="integer" not-null="false">
<column name="station_status"/>
<property name="stationStatus" type="integer" not-null="true">
<column name="station_status" />
</property>
<property name="stationCoordinate" type="nstring" not-null="false">
<column name="station_coordinate"/>
......
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