Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-fb
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王衍超
cloud-fb
Commits
aa65d1c4
Commit
aa65d1c4
authored
Apr 06, 2021
by
高晓磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场站中的生产线新增和修改
parent
85e673dc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
StationDaoImpl.java
.../java/com/xyst/dinas/biz/internal/dao/StationDaoImpl.java
+29
-1
Station.hbm.xml
.../xyst.dinas.biz/src/main/resources/config/Station.hbm.xml
+7
-7
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/StationDaoImpl.java
View file @
aa65d1c4
...
...
@@ -5,7 +5,9 @@ import com.beecode.bap.attachment.common.Page;
import
com.beecode.bcp.core.context.AminoContextHolder
;
import
com.beecode.bcp.type.KClass
;
import
com.beecode.bcp.type.KObject
;
import
com.beecode.bcp.type.support.KernelArray
;
import
com.beecode.inz.basis.internal.dao.AbstractBaseDao
;
import
com.xyst.dinas.biz.constant.ProductionLineConstant
;
import
com.xyst.dinas.biz.constant.StationConstant
;
import
com.xyst.dinas.biz.dao.DinasTypeDao
;
import
com.xyst.dinas.biz.dao.StationDao
;
...
...
@@ -15,6 +17,7 @@ import org.hibernate.criterion.Restrictions;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.orm.hibernate5.HibernateTemplate
;
import
java.lang.reflect.Array
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
...
...
@@ -78,6 +81,19 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
kobject
.
set
(
"modifyTime"
,
new
Date
());
kobject
.
set
(
"modifier"
,
staff
);
kobject
.
set
(
"del"
,
false
);
template
.
deleteAll
(
id
.
get
(
"productionLines"
).
toList
());
KObject
productions
=
kobject
.
get
(
"productionLines"
);
if
(
null
!=
productions
){
List
<
KObject
>
kObjects
=
productions
.
toList
();
for
(
KObject
object
:
kObjects
)
{
if
(
null
==
object
.
getUuid
(
"id"
)){
object
.
set
(
"id"
,
UUID
.
randomUUID
());
}
object
.
set
(
"station"
,
kobject
);
template
.
save
(
ProductionLineConstant
.
ENTITY
,
object
);
}
}
template
.
merge
(
kobject
);
}
...
...
@@ -93,7 +109,19 @@ public class StationDaoImpl extends AbstractBaseDao implements StationDao, Stat
kObject
.
set
(
"creator"
,
staff
);
kObject
.
set
(
"createTime"
,
new
Date
());
kObject
.
set
(
"del"
,
false
);
return
((
UUID
)
template
.
save
(
kObject
));
UUID
save
=
(
UUID
)
template
.
save
(
kObject
);
KObject
productions
=
kObject
.
get
(
"productionLines"
);
if
(
null
!=
productions
){
List
<
KObject
>
kObjects
=
productions
.
toList
();
for
(
KObject
object
:
kObjects
)
{
if
(
null
==
object
.
getUuid
(
"id"
)){
object
.
set
(
"id"
,
UUID
.
randomUUID
());
}
object
.
set
(
"station"
,
kObject
);
template
.
save
(
ProductionLineConstant
.
ENTITY
,
object
);
}
}
return
save
;
}
@Override
...
...
backend/xyst.dinas.biz/src/main/resources/config/Station.hbm.xml
View file @
aa65d1c4
...
...
@@ -60,10 +60,6 @@
<comment>
场站状态,0已停业1经营中
</comment>
</column>
</property>
<bag
name=
"productionLines"
lazy=
"true"
fetch=
"select"
inverse=
"true"
>
<key
column=
"station_id"
not-null=
"true"
/>
<one-to-many
entity-name=
"com.xyst.dinas.biz.datamodel.ProductionLine"
/>
</bag>
<property
name=
"stationCoordinate"
type=
"nstring"
not-null=
"false"
>
<column
name=
"station_coordinate"
>
<comment>
场站的坐标按照逗号分隔
</comment>
...
...
@@ -94,14 +90,18 @@
<comment
>
排序
</comment>
</column>
</property>
<bag
name=
"productionLines"
lazy=
"true"
fetch=
"select"
inverse=
"true"
>
<key
column=
"station_id"
not-null=
"true"
/>
<one-to-many
entity-name=
"com.xyst.dinas.biz.datamodel.ProductionLine"
/>
</bag>
</class>
<class
entity-name=
"com.xyst.dinas.biz.datamodel.ProductionLine"
table=
"xyst_dinas_biz_production_Line"
optimistic-lock=
"version"
>
<class
entity-name=
"com.xyst.dinas.biz.datamodel.ProductionLine"
table=
"xyst_dinas_biz_production_Line"
>
<tuplizer
entity-mode=
"dynamic-map"
class=
"com.beecode.bcp.store.hibernate.KObjectEntityTuplizer"
/>
<id
name=
"id"
type=
"uuid-binary"
column=
"id"
length=
"16"
>
<generator
class=
"assigned"
/>
</id>
<many-to-one
name=
"station"
entity-name=
"com.xyst.dinas.biz.datamodel.
ProductionLine"
fetch=
"select"
>
<column
name=
"station_id"
not-null=
"false"
>
<many-to-one
name=
"station"
entity-name=
"com.xyst.dinas.biz.datamodel.
Station"
fetch=
"select"
>
<column
name=
"station_id"
not-null=
"false"
>
<comment>
所属场站
</comment>
</column>
</many-to-one>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment