Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
c346f25b
Commit
c346f25b
authored
Oct 27, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加重复校验功能
parent
169358a5
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
7 deletions
+55
-7
InputItemController.java
.../amos/patrol/business/controller/InputItemController.java
+4
-0
PointController.java
...join/amos/patrol/business/controller/PointController.java
+18
-4
RouteController.java
...join/amos/patrol/business/controller/RouteController.java
+15
-0
RouteMapper.java
.../yeejoin/amos/patrol/business/dao/mapper/RouteMapper.java
+1
-1
IInputItemDao.java
...in/amos/patrol/business/dao/repository/IInputItemDao.java
+7
-0
IPointDao.java
...eejoin/amos/patrol/business/dao/repository/IPointDao.java
+6
-0
RouteServiceImpl.java
...n/amos/patrol/business/service/impl/RouteServiceImpl.java
+2
-1
IRouteService.java
...oin/amos/patrol/business/service/intfc/IRouteService.java
+2
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/InputItemController.java
View file @
c346f25b
...
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -554,6 +555,9 @@ public class InputItemController extends AbstractBaseController {
...
@@ -554,6 +555,9 @@ public class InputItemController extends AbstractBaseController {
if
(
param
.
getEquipmentType
()
==
null
&&
param
.
getCustomType
()
==
null
&&
param
.
getFacilitiesType
()
==
null
&&
param
.
getKeyPartsType
()
==
null
){
if
(
param
.
getEquipmentType
()
==
null
&&
param
.
getCustomType
()
==
null
&&
param
.
getFacilitiesType
()
==
null
&&
param
.
getKeyPartsType
()
==
null
){
throw
new
BadRequest
(
"适用类型至少需选择一项"
);
throw
new
BadRequest
(
"适用类型至少需选择一项"
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
inputItemDao
.
findByItemName
(
param
.
getName
())))
{
throw
new
BadRequest
(
"该名称已存在,请重新输入"
);
}
//如果为1则为否,顺应机场逻辑
//如果为1则为否,顺应机场逻辑
param
.
setCustomType
(
"1"
.
equals
(
param
.
getCustomType
())
?
null
:
param
.
getCustomType
());
param
.
setCustomType
(
"1"
.
equals
(
param
.
getCustomType
())
?
null
:
param
.
getCustomType
());
param
.
setKeyPartsType
(
"1"
.
equals
(
param
.
getKeyPartsType
())
?
null
:
param
.
getKeyPartsType
());
param
.
setKeyPartsType
(
"1"
.
equals
(
param
.
getKeyPartsType
())
?
null
:
param
.
getKeyPartsType
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PointController.java
View file @
c346f25b
...
@@ -7,10 +7,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -7,10 +7,7 @@ import javax.servlet.http.HttpServletResponse;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.PointMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.IPointClassifyDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.*
;
import
com.yeejoin.amos.patrol.business.dao.repository.IPointInputItemDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRoutePointItemDao
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.EquipFeign
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.vo.*
;
import
com.yeejoin.amos.patrol.business.vo.*
;
...
@@ -64,6 +61,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
...
@@ -64,6 +61,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
@RestController
@RestController
...
@@ -78,6 +76,8 @@ public class PointController extends AbstractBaseController {
...
@@ -78,6 +76,8 @@ public class PointController extends AbstractBaseController {
@Autowired
@Autowired
private
PointMapper
pointMapper
;
private
PointMapper
pointMapper
;
@Autowired
private
IPointDao
iPointDao
;
@Autowired
@Autowired
private
ICatalogTreeService
catalogTreeService
;
private
ICatalogTreeService
catalogTreeService
;
...
@@ -1502,6 +1502,20 @@ public class PointController extends AbstractBaseController {
...
@@ -1502,6 +1502,20 @@ public class PointController extends AbstractBaseController {
if
(
ObjectUtils
.
isEmpty
(
pointNewVo
.
getChargePersonId
()))
{
if
(
ObjectUtils
.
isEmpty
(
pointNewVo
.
getChargePersonId
()))
{
return
CommonResponseUtil
.
failure
(
"责任人不能为空"
);
return
CommonResponseUtil
.
failure
(
"责任人不能为空"
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
pointNewVo
.
getName
()))
{
List
<
Point
>
list
=
iPointDao
.
findByName
(
pointNewVo
.
getName
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
throw
new
BadRequest
(
"该名称巡检点已存在"
);
}
}
if
(!
ObjectUtils
.
isEmpty
(
pointNewVo
.
getName
()))
{
List
<
Point
>
list
=
iPointDao
.
findByNo
(
pointNewVo
.
getPointNo
());
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
throw
new
BadRequest
(
"该编号已存在"
);
}
}
try
{
try
{
Point
point
=
new
Point
();
Point
point
=
new
Point
();
BeanUtils
.
copyProperties
(
pointNewVo
,
point
);
BeanUtils
.
copyProperties
(
pointNewVo
,
point
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/RouteController.java
View file @
c346f25b
...
@@ -9,10 +9,13 @@ import java.util.Map;
...
@@ -9,10 +9,13 @@ import java.util.Map;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao
;
import
com.yeejoin.amos.patrol.business.dao.repository.IRoutePointDao
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.feign.JcsFeignClient
;
import
com.yeejoin.amos.patrol.business.service.impl.RouteServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -54,6 +57,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
...
@@ -54,6 +57,7 @@ import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
...
@@ -80,6 +84,8 @@ public class RouteController extends AbstractBaseController {
...
@@ -80,6 +84,8 @@ public class RouteController extends AbstractBaseController {
private
RoutePointItemMapper
routePointItemMapper
;
private
RoutePointItemMapper
routePointItemMapper
;
@Autowired
@Autowired
private
IRoutePointDao
iRoutePointDao
;
private
IRoutePointDao
iRoutePointDao
;
@Autowired
private
RouteServiceImpl
routeServiceImpl
;
/**
/**
*
*
* 新增接口
* 新增接口
...
@@ -167,6 +173,15 @@ public class RouteController extends AbstractBaseController {
...
@@ -167,6 +173,15 @@ public class RouteController extends AbstractBaseController {
String
loginOrgCode
=
getOrgCode
(
reginParams
);
String
loginOrgCode
=
getOrgCode
(
reginParams
);
route
.
setOrgCode
(
loginOrgCode
);
route
.
setOrgCode
(
loginOrgCode
);
if
(!
StringUtils
.
isEmpty
(
route
.
getName
())){
LambdaQueryWrapper
<
Route
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Route:
:
getName
,
route
.
getName
());
List
<
Route
>
list
=
routeServiceImpl
.
list
(
wrapper
);
if
(!
ObjectUtils
.
isEmpty
(
list
)
||
list
.
size
()>
0
){
throw
new
BadRequest
(
"该名称路线已存在"
);
}
}
if
(
route
.
getDeptId
()!=
null
){
if
(
route
.
getDeptId
()!=
null
){
//查询jcs
//查询jcs
ResponseModel
<
Object
>
companyInfo
=
jcsFeignClient
.
getCompanyInfo
(
route
.
getDeptId
());
ResponseModel
<
Object
>
companyInfo
=
jcsFeignClient
.
getCompanyInfo
(
route
.
getDeptId
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/RouteMapper.java
View file @
c346f25b
...
@@ -17,7 +17,7 @@ import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
...
@@ -17,7 +17,7 @@ import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePointItem
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePointItem
;
public
interface
RouteMapper
extends
BaseMapper
{
public
interface
RouteMapper
extends
BaseMapper
,
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
<
Route
>
{
/**
/**
* 根据路线id与点id,获取路线上点的项
* 根据路线id与点id,获取路线上点的项
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/IInputItemDao.java
View file @
c346f25b
...
@@ -33,4 +33,11 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
...
@@ -33,4 +33,11 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query
(
value
=
"delete * from p_input_item where is not null and is_delete =0"
,
nativeQuery
=
true
)
@Query
(
value
=
"delete * from p_input_item where is not null and is_delete =0"
,
nativeQuery
=
true
)
void
deleteAllByEquipmentNameIsNotNull
();
void
deleteAllByEquipmentNameIsNotNull
();
@Query
(
value
=
"select * from p_input_item where item_no = ?1 and is_delete =0"
,
nativeQuery
=
true
)
List
<
InputItem
>
findByItemNo
(
String
itemNo
);
@Query
(
value
=
"select * from p_input_item where name = ?1 and is_delete =0"
,
nativeQuery
=
true
)
List
<
InputItem
>
findByItemName
(
String
name
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/repository/IPointDao.java
View file @
c346f25b
...
@@ -27,4 +27,10 @@ public interface IPointDao extends BaseDao<Point, Long> {
...
@@ -27,4 +27,10 @@ public interface IPointDao extends BaseDao<Point, Long> {
Optional
<
Point
>
findById
(
Long
id
);
Optional
<
Point
>
findById
(
Long
id
);
@Query
(
value
=
"select * from p_point where point_no = (?1) and is_delete =0"
,
nativeQuery
=
true
)
List
<
Point
>
findByNo
(
String
pointNo
);
@Query
(
value
=
"select * from p_point where name = (?1) and is_delete =0"
,
nativeQuery
=
true
)
List
<
Point
>
findByName
(
String
name
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/RouteServiceImpl.java
View file @
c346f25b
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
patrol
.
business
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
...
@@ -67,7 +68,7 @@ import java.util.Set;
...
@@ -67,7 +68,7 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
(
"routeService"
)
@Service
(
"routeService"
)
public
class
RouteServiceImpl
implements
IRouteService
{
public
class
RouteServiceImpl
extends
ServiceImpl
<
RouteMapper
,
Route
>
implements
IRouteService
{
@Autowired
@Autowired
private
IRouteDao
iRouteDao
;
private
IRouteDao
iRouteDao
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/IRouteService.java
View file @
c346f25b
...
@@ -5,6 +5,7 @@ import java.util.LinkedHashMap;
...
@@ -5,6 +5,7 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.patrol.business.param.LoginUserParam
;
import
com.yeejoin.amos.patrol.business.param.LoginUserParam
;
import
com.yeejoin.amos.patrol.business.param.SynRouteParam
;
import
com.yeejoin.amos.patrol.business.param.SynRouteParam
;
import
com.yeejoin.amos.patrol.business.util.DaoCriteria
;
import
com.yeejoin.amos.patrol.business.util.DaoCriteria
;
...
@@ -22,7 +23,7 @@ import com.yeejoin.amos.patrol.dao.entity.Point;
...
@@ -22,7 +23,7 @@ import com.yeejoin.amos.patrol.dao.entity.Point;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.Route
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePoint
;
import
com.yeejoin.amos.patrol.dao.entity.RoutePoint
;
public
interface
IRouteService
{
public
interface
IRouteService
extends
IService
<
Route
>
{
/**
/**
* 添加巡检路线
* 添加巡检路线
...
...
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