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
3367a248
Commit
3367a248
authored
Jul 13, 2021
by
高晓磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
船只备案中删除逻辑修改(校验船只下是否包含船舶违规记录、采砂许可证数据、接驳数据)
parent
f6c809e4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
0 deletions
+76
-0
ShipInfoDao.java
...biz/src/main/java/com/xyst/dinas/biz/dao/ShipInfoDao.java
+6
-0
ShipInfoDaoImpl.java
...java/com/xyst/dinas/biz/internal/dao/ShipInfoDaoImpl.java
+30
-0
ShipInfoServiceImpl.java
.../xyst/dinas/biz/internal/service/ShipInfoServiceImpl.java
+17
-0
ShipInfoService.java
...main/java/com/xyst/dinas/biz/service/ShipInfoService.java
+6
-0
ShipInfoController.java
.../main/java/com/xyst/dinas/biz/web/ShipInfoController.java
+17
-0
No files found.
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/dao/ShipInfoDao.java
View file @
3367a248
...
...
@@ -24,4 +24,10 @@ public interface ShipInfoDao extends BaseDao {
List
<
KObject
>
getByCode
(
String
code
,
UUID
id
);
List
<
KObject
>
getAllShipByRegionalCompanyIds
(
List
<
UUID
>
uuidList
);
List
<
KObject
>
getShipViolationById
(
UUID
id
);
List
<
KObject
>
getSandMiningByShipId
(
UUID
id
);
List
<
KObject
>
getDischargingByShipId
(
UUID
id
);
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/dao/ShipInfoDaoImpl.java
View file @
3367a248
...
...
@@ -14,6 +14,7 @@ import com.xyst.dinas.biz.enumeration.OrganizationTypeEnum;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.criterion.DetachedCriteria
;
import
org.hibernate.criterion.LogicalExpression
;
import
org.hibernate.criterion.Order
;
import
org.hibernate.criterion.Restrictions
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -130,6 +131,35 @@ public class ShipInfoDaoImpl extends AbstractBaseDao implements ShipInfoDao, Shi
return
(
List
<
KObject
>)
template
.
findByCriteria
(
detachedCriteria
);
}
@Override
public
List
<
KObject
>
getShipViolationById
(
UUID
id
)
{
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
"com.xyst.dinas.safe.datamodel.ShipViolation"
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"shipInfo.id"
,
id
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
BaseConstants
.
DISCARD
,
false
));
return
(
List
<
KObject
>)
template
.
findByCriteria
(
detachedCriteria
);
}
@Override
public
List
<
KObject
>
getSandMiningByShipId
(
UUID
id
)
{
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
"com.xyst.dinas.production.datamodel.SandMining"
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
detachedCriteria
.
add
(
Restrictions
.
eq
(
"ship.id"
,
id
));
return
(
List
<
KObject
>)
template
.
findByCriteria
(
detachedCriteria
);
}
@Override
public
List
<
KObject
>
getDischargingByShipId
(
UUID
id
)
{
KClass
bean
=
Amino
.
getStaticMetadataContext
().
getBean
(
"com.xyst.dinas.production.datamodel.Discharging"
,
KClass
.
class
);
DetachedCriteria
detachedCriteria
=
DetachedCriteria
.
forEntityName
(
bean
.
getName
());
LogicalExpression
or
=
Restrictions
.
or
(
Restrictions
.
eq
(
"sandMiningShip.id"
,
id
),
Restrictions
.
eq
(
"transportShip.id"
,
id
));
detachedCriteria
.
add
(
or
);
detachedCriteria
.
add
(
Restrictions
.
eq
(
"del"
,
false
));
return
(
List
<
KObject
>)
template
.
findByCriteria
(
detachedCriteria
);
}
@Override
public
UUID
create
(
KObject
kObject
)
{
...
...
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/internal/service/ShipInfoServiceImpl.java
View file @
3367a248
...
...
@@ -56,6 +56,7 @@ public class ShipInfoServiceImpl implements ShipInfoService {
@Override
public
void
deleteById
(
UUID
id
)
{
shipInfoDao
.
deleteById
(
id
);
//同时删除许可证上的许可证预警设置
}
@Override
...
...
@@ -109,4 +110,20 @@ public class ShipInfoServiceImpl implements ShipInfoService {
}
return
GpsOOUtil
.
history
(
account
,
accountPassword
,
imei
,
null
,
startTime
,
endTime
,
null
);
}
@Override
public
List
<
KObject
>
getShipViolationById
(
UUID
id
)
{
return
shipInfoDao
.
getShipViolationById
(
id
);
}
@Override
public
List
<
KObject
>
getSandMiningByShipId
(
UUID
id
)
{
return
shipInfoDao
.
getSandMiningByShipId
(
id
);
}
@Override
public
List
<
KObject
>
getDischargingByShipId
(
UUID
id
)
{
return
shipInfoDao
.
getDischargingByShipId
(
id
);
}
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/service/ShipInfoService.java
View file @
3367a248
...
...
@@ -29,4 +29,10 @@ public interface ShipInfoService {
List
<
Map
<
String
,
Object
>>
getShipsTracking
(
List
<
KObject
>
allShipByRegionalCompanyIds
)
throws
Exception
;
List
<
Object
>
getShipHistoryById
(
UUID
uuid
,
Long
startTime
,
Long
endTime
)
throws
Exception
;
List
<
KObject
>
getShipViolationById
(
UUID
id
);
List
<
KObject
>
getSandMiningByShipId
(
UUID
id
);
List
<
KObject
>
getDischargingByShipId
(
UUID
id
);
}
backend/xyst.dinas.biz/src/main/java/com/xyst/dinas/biz/web/ShipInfoController.java
View file @
3367a248
...
...
@@ -13,6 +13,7 @@ import com.xyst.dinas.biz.service.ShipInfoService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.UUID
;
@RestController
()
...
...
@@ -90,6 +91,22 @@ public class ShipInfoController {
if
(
id
==
null
){
return
ResponseObj
.
error
(
400
,
"'id' must be not null!"
);
}
//查询船只有没有船舶违规记录
List
<
KObject
>
violationById
=
shipInfoService
.
getShipViolationById
(
id
);
if
(
violationById
.
size
()>
0
){
return
ResponseObj
.
error
(
500
,
"该船只下有船舶违规记录,暂不支持删除操作!"
);
}
//查询船只有没有采砂许可证数据
List
<
KObject
>
sandMiningByShipId
=
shipInfoService
.
getSandMiningByShipId
(
id
);
if
(
sandMiningByShipId
.
size
()>
0
){
return
ResponseObj
.
error
(
500
,
"该船只下有采砂许可证数据,暂不支持删除操作"
);
}
//查询船只有没有接驳数据
List
<
KObject
>
discharging
=
shipInfoService
.
getDischargingByShipId
(
id
);
if
(
discharging
.
size
()>
0
){
return
ResponseObj
.
error
(
500
,
"该船只下有采砂许可证数据,暂不支持删除操作"
);
}
shipInfoService
.
deleteById
(
id
);
return
ResponseObj
.
success
(
"删除成功"
);
}
...
...
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