Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
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
首航-临时账号
api
Commits
fd4216a2
Commit
fd4216a2
authored
Dec 24, 2019
by
zhangyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出
parent
ac2f6459
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
242 additions
and
52 deletions
+242
-52
DepartDao.xml
resources/mapper/modules/depart/DepartDao.xml
+24
-1
DepartController.java
src/com/ejweb/modules/depart/api/DepartController.java
+68
-40
DepartTypeBean.java
src/com/ejweb/modules/depart/bean/DepartTypeBean.java
+47
-0
DepartDao.java
src/com/ejweb/modules/depart/dao/DepartDao.java
+7
-4
DepartTypeEntity.java
src/com/ejweb/modules/depart/entity/DepartTypeEntity.java
+71
-0
DepartService.java
src/com/ejweb/modules/depart/service/DepartService.java
+25
-7
No files found.
resources/mapper/modules/depart/DepartDao.xml
View file @
fd4216a2
...
@@ -46,5 +46,27 @@
...
@@ -46,5 +46,27 @@
AND verif_id=#{verifId}
AND verif_id=#{verifId}
</if>
</if>
</select>
</select>
<select
id=
"findDepartByList"
resultType=
"com.ejweb.modules.depart.entity.DepartEntity"
>
SELECT
fu.id,
fu.depart_name,
fu.is_verif,
fu.is_risk,
f.depart_id
FROM `foc_user_depart_type` f
INNER JOIN foc_user_depart fu on f.depart_id = fu.id AND fu.del_flag='0'
WHERE f.del_flag = '0'
<if
test=
"type != null and type !=''"
>
AND f.type=#{type}
</if>
</select>
<select
id=
"findDepartAllList"
resultType=
"com.ejweb.modules.depart.entity.DepartTypeEntity"
>
SELECT
a.id,
a.is_verif,
a.is_risk,
a.depart_name
FROM foc_user_depart a
WHERE a.del_flag = '0'
</select>
</mapper>
</mapper>
\ No newline at end of file
src/com/ejweb/modules/depart/api/DepartController.java
View file @
fd4216a2
package
com
.
ejweb
.
modules
.
depart
.
api
;
package
com
.
ejweb
.
modules
.
depart
.
api
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.ejweb.core.api.RequestBean
;
import
com.ejweb.core.api.RequestBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.api.ResponseBean
;
import
com.ejweb.core.conf.ErrorCode
;
import
com.ejweb.core.conf.ErrorCode
;
import
com.ejweb.core.conf.GConstants
;
import
com.ejweb.core.conf.GConstants
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.bean.DepartTypeBean
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartTypeEntity
;
import
com.ejweb.modules.depart.service.DepartService
;
import
com.ejweb.modules.depart.service.DepartService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
/**
/**
* Airport Controller
* Airport Controller
*
* @author zhanglg
* @author zhanglg
* @version 2016-8-23
* @version 2016-8-23
*/
*/
@Controller
@Controller
@RequestMapping
(
value
=
"/api/depart"
)
@RequestMapping
(
value
=
"/api/depart"
)
public
class
DepartController
{
public
class
DepartController
{
@Autowired
@Autowired
private
DepartService
departService
;
private
DepartService
departService
;
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"list"
)
@RequestMapping
(
value
=
"list"
)
public
ResponseBean
list
(
RequestBean
requestBean
,
BindingResult
errors
)
{
public
ResponseBean
list
(
RequestBean
requestBean
,
BindingResult
errors
)
{
ResponseBean
responseBean
=
new
ResponseBean
();
ResponseBean
responseBean
=
new
ResponseBean
();
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
String
message
=
departService
.
validate
(
bean
,
errors
);
String
message
=
departService
.
validate
(
bean
,
errors
);
if
(
message
==
null
){
// 通过参数校验
if
(
message
==
null
)
{
// 通过参数校验
List
<
DepartEntity
>
list
=
departService
.
findAllList
(
bean
.
getIsVerif
());
List
<
DepartEntity
>
list
=
departService
.
findAllList
(
bean
.
getIsVerif
());
if
(
list
==
null
){
// 数据为空
if
(
list
==
null
)
{
// 数据为空
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
return
responseBean
;
}
responseBean
.
setData
(
list
);
return
responseBean
;
return
responseBean
;
}
}
responseBean
.
setData
(
list
);
responseBean
.
setMessage
(
message
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
return
responseBean
;
}
responseBean
.
setMessage
(
message
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"risklist"
)
@RequestMapping
(
value
=
"risklist"
)
public
ResponseBean
risklist
(
RequestBean
requestBean
,
BindingResult
errors
)
{
public
ResponseBean
risklist
(
RequestBean
requestBean
,
BindingResult
errors
)
{
ResponseBean
responseBean
=
new
ResponseBean
();
ResponseBean
responseBean
=
new
ResponseBean
();
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
String
message
=
departService
.
validate
(
bean
,
errors
);
String
message
=
departService
.
validate
(
bean
,
errors
);
if
(
message
==
null
){
// 通过参数校验
if
(
message
==
null
)
{
// 通过参数校验
List
<
DepartEntity
>
list
=
departService
.
findRiskList
(
bean
);
List
<
DepartEntity
>
list
=
departService
.
findRiskList
(
bean
);
if
(
list
==
null
){
// 数据为空
if
(
list
==
null
)
{
// 数据为空
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
return
responseBean
;
}
responseBean
.
setData
(
list
);
return
responseBean
;
return
responseBean
;
}
}
responseBean
.
setData
(
list
);
responseBean
.
setMessage
(
message
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
return
responseBean
;
}
responseBean
.
setMessage
(
message
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
}
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"getByuserCode"
)
@RequestMapping
(
value
=
"getByuserCode"
)
public
ResponseBean
getByUserCode
(
RequestBean
requestBean
,
BindingResult
errors
)
{
public
ResponseBean
getByUserCode
(
RequestBean
requestBean
,
BindingResult
errors
)
{
ResponseBean
responseBean
=
new
ResponseBean
();
ResponseBean
responseBean
=
new
ResponseBean
();
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
DepartBean
bean
=
requestBean
.
getObjectBean
(
DepartBean
.
class
);
String
message
=
departService
.
validate
(
bean
,
errors
);
String
message
=
departService
.
validate
(
bean
,
errors
);
if
(
message
==
null
)
{
// 通过参数校验
if
(
message
==
null
)
{
// 通过参数校验
DepartEntity
entity
=
departService
.
getByUserCode
(
bean
.
getUserCode
());
DepartEntity
entity
=
departService
.
getByUserCode
(
bean
.
getUserCode
());
if
(
entity
==
null
)
{
// 查询结果为空
if
(
entity
==
null
)
{
// 查询结果为空
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
return
responseBean
;
return
responseBean
;
}
else
{
}
else
{
responseBean
.
setData
(
entity
);
responseBean
.
setData
(
entity
);
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setMessage
(
GConstants
.
OK
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2000
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2000
);
...
@@ -96,4 +100,28 @@ public class DepartController{
...
@@ -96,4 +100,28 @@ public class DepartController{
return
responseBean
;
return
responseBean
;
}
}
@ResponseBody
@RequestMapping
(
value
=
"departList"
)
public
ResponseBean
departList
(
RequestBean
requestBean
,
BindingResult
errors
)
{
ResponseBean
responseBean
=
new
ResponseBean
();
DepartTypeBean
bean
=
requestBean
.
getObjectBean
(
DepartTypeBean
.
class
);
String
message
=
departService
.
validate
(
bean
,
errors
);
// 通过参数校验
if
(
message
==
null
)
{
List
<
DepartTypeEntity
>
list
=
departService
.
findDepartList
(
bean
);
// 数据为空
if
(
list
==
null
)
{
responseBean
.
setMessage
(
GConstants
.
EMPTY
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_2001
);
return
responseBean
;
}
responseBean
.
setData
(
list
);
return
responseBean
;
}
responseBean
.
setMessage
(
message
);
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4001
);
return
responseBean
;
}
}
}
src/com/ejweb/modules/depart/bean/DepartTypeBean.java
0 → 100644
View file @
fd4216a2
/**
*
*/
package
com
.
ejweb
.
modules
.
depart
.
bean
;
import
com.ejweb.core.base.GenericBean
;
import
org.hibernate.validator.constraints.NotEmpty
;
/**
*
* @team IT Team
* @author zhanglg
* @version 1.0
* @time 2016年9月9日
*/
public
class
DepartTypeBean
extends
GenericBean
{
@NotEmpty
(
message
=
"type不能为空"
)
String
type
;
String
verifId
;
String
isVerif
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getVerifId
()
{
return
verifId
;
}
public
void
setVerifId
(
String
verifId
)
{
this
.
verifId
=
verifId
;
}
public
String
getIsVerif
()
{
return
isVerif
;
}
public
void
setIsVerif
(
String
isVerif
)
{
this
.
isVerif
=
isVerif
;
}
}
src/com/ejweb/modules/depart/dao/DepartDao.java
View file @
fd4216a2
package
com
.
ejweb
.
modules
.
depart
.
dao
;
package
com
.
ejweb
.
modules
.
depart
.
dao
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.ejweb.core.base.BaseDao
;
import
com.ejweb.core.base.BaseDao
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartTypeEntity
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
/**
*
*
...
@@ -19,4 +19,6 @@ public interface DepartDao extends BaseDao{
...
@@ -19,4 +19,6 @@ public interface DepartDao extends BaseDao{
public
List
<
DepartEntity
>
findAllList
(
DepartEntity
departEntity
);
public
List
<
DepartEntity
>
findAllList
(
DepartEntity
departEntity
);
public
DepartEntity
getByUserCode
(
@Param
(
value
=
"userCode"
)
String
userCode
);
public
DepartEntity
getByUserCode
(
@Param
(
value
=
"userCode"
)
String
userCode
);
public
List
<
DepartEntity
>
findRiskList
(
DepartBean
bean
);
public
List
<
DepartEntity
>
findRiskList
(
DepartBean
bean
);
public
List
<
DepartEntity
>
findDepartByList
(
@Param
(
value
=
"type"
)
String
type
,
@Param
(
value
=
"isVerif"
)
String
isVerif
);
public
List
<
DepartTypeEntity
>
findDepartAllList
();
}
}
\ No newline at end of file
src/com/ejweb/modules/depart/entity/DepartTypeEntity.java
0 → 100644
View file @
fd4216a2
package
com
.
ejweb
.
modules
.
depart
.
entity
;
import
com.ejweb.core.base.BaseEntity
;
/**
*
* 论证部门Entity
* @author zhanglg
* @version 2016-08-24
*/
public
class
DepartTypeEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
private
String
departName
;
private
String
isVerif
;
private
String
isRisk
;
private
Boolean
check
=
false
;
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
Boolean
getCheck
()
{
return
check
;
}
public
void
setCheck
(
Boolean
check
)
{
this
.
check
=
check
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
==
null
?
null
:
id
.
trim
();
}
public
String
getDepartName
()
{
return
departName
;
}
public
void
setDepartName
(
String
departName
)
{
this
.
departName
=
departName
;
}
public
String
getIsVerif
()
{
return
isVerif
;
}
public
void
setIsVerif
(
String
isVerif
)
{
this
.
isVerif
=
isVerif
;
}
public
String
getIsRisk
()
{
return
isRisk
;
}
public
void
setIsRisk
(
String
isRisk
)
{
this
.
isRisk
=
isRisk
;
}
}
\ No newline at end of file
src/com/ejweb/modules/depart/service/DepartService.java
View file @
fd4216a2
package
com
.
ejweb
.
modules
.
depart
.
service
;
package
com
.
ejweb
.
modules
.
depart
.
service
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.ejweb.core.base.BaseService
;
import
com.ejweb.core.base.BaseService
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.bean.DepartBean
;
import
com.ejweb.modules.depart.bean.DepartTypeBean
;
import
com.ejweb.modules.depart.dao.DepartDao
;
import
com.ejweb.modules.depart.dao.DepartDao
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartEntity
;
import
com.ejweb.modules.depart.entity.DepartTypeEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
/**
* Depart Service
* Depart Service
...
@@ -39,5 +40,22 @@ public class DepartService extends BaseService<DepartDao> {
...
@@ -39,5 +40,22 @@ public class DepartService extends BaseService<DepartDao> {
return
departDao
.
findRiskList
(
bean
);
return
departDao
.
findRiskList
(
bean
);
}
}
public
List
<
DepartTypeEntity
>
findDepartList
(
DepartTypeBean
departTypeBean
){
//查询所有的部门
List
<
DepartTypeEntity
>
allList
=
departDao
.
findDepartAllList
();
// 根据类型type值查询对应的部门信息
String
type
=
departTypeBean
.
getType
();
List
<
DepartEntity
>
byList
=
departDao
.
findDepartByList
(
type
,
departTypeBean
.
getIsVerif
());
if
(
byList
!=
null
)
{
for
(
DepartTypeEntity
udAll
:
allList
)
{
for
(
DepartEntity
udBy
:
byList
)
{
if
(
udAll
.
getId
()
==
udBy
.
getId
()
||
udAll
.
getId
().
equals
(
udBy
.
getId
()))
{
udAll
.
setCheck
(
true
);
}
}
}
}
return
allList
;
}
}
}
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