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
e64a8656
Commit
e64a8656
authored
Jun 25, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
逻辑迁移
parent
93c4e40d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
103 deletions
+79
-103
IOrgUsrService.java
...join/amos/boot/module/jcs/api/service/IOrgUsrService.java
+30
-0
OrgUsrMapper.xml
...module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
+26
-0
OrgPersonController.java
...s/boot/module/jcs/biz/controller/OrgPersonController.java
+14
-49
OrgUsrController.java
...amos/boot/module/jcs/biz/controller/OrgUsrController.java
+9
-54
OrgUsrServiceImpl.java
...s/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
+0
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IOrgUsrService.java
View file @
e64a8656
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
service
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonFormVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgPersonVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -109,4 +116,27 @@ public interface IOrgUsrService {
...
@@ -109,4 +116,27 @@ public interface IOrgUsrService {
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
void
saveOrgUsr
(
OrgUsrVo
OrgUsrVo
)
throws
Exception
;
void
saveOrgUsr
(
OrgUsrVo
OrgUsrVo
)
throws
Exception
;
void
saveOrgPerson
(
OrgPersonVo
OrgPersonVo
)
throws
Exception
;
void
updateByIdOrgUsr
(
OrgUsrVo
OrgUsrVo
,
Long
id
)
throws
Exception
;
void
updateByIdOrgPerson
(
OrgPersonVo
OrgPersonVo
,
Long
id
)
throws
Exception
;
OrgUsrFormVo
selectCompanyById
(
Long
id
)
throws
Exception
;
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
;
void
saveDepartment
(
List
<
OrgDepartmentVo
>
OrgDepartmentVo
,
Long
id
)
throws
Exception
;
void
saveCompany
(
List
<
OrgUsrVo
>
OrgUsrVo
)
throws
Exception
;
OrgPersonFormVo
selectPersonById
(
Long
id
)
throws
Exception
;
OrgPersonFormVo
selectPersonByIdDetail
(
Long
id
)
throws
Exception
;
List
<
OrgMenuVo
>
selectPersonTree
()
throws
Exception
;
void
savePersonList
(
List
<
OrgPersonVo
>
OrgPersonVo
)
throws
Exception
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
e64a8656
...
@@ -16,6 +16,32 @@
...
@@ -16,6 +16,32 @@
</select>
</select>
<select
id=
"selectPersonList"
resultType=
"Map"
>
select * from (
SELECT
DISTINCT
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode,
<if
test=
"fields != null"
>
<foreach
collection=
"fields"
item=
"item"
separator=
","
>
MAX(case f.field_code when #{item} then v.field_value end) ${item}
</foreach>
</if>
FROM
cb_org_usr u LEFT JOIN
jc_alert_form_value v on u.sequence_nbr = v.alert_called_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType}
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
LIMIT #{pageNum}, #{pageSize}
</select>
<select
id=
"selectCompanyDepartmentMsg"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr"
>
<select
id=
"selectCompanyDepartmentMsg"
resultType=
"com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr"
>
SELECT
SELECT
sequence_nbr,
sequence_nbr,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrgPersonController.java
View file @
e64a8656
...
@@ -58,11 +58,8 @@ public class OrgPersonController {
...
@@ -58,11 +58,8 @@ public class OrgPersonController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增人员信息"
,
notes
=
"新增人员信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增人员信息"
,
notes
=
"新增人员信息"
)
public
ResponseModel
saveOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonVo
OrgPersonVo
)
{
public
ResponseModel
saveOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonVo
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
iOrgUsrService
.
saveOrgPerson
(
OrgPersonVo
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgPersonVo
.
getAlertFormValue
());
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -77,8 +74,7 @@ public class OrgPersonController {
...
@@ -77,8 +74,7 @@ public class OrgPersonController {
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据id删除"
,
notes
=
"根据id删除"
)
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
public
ResponseModel
deleteById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
{
// 删除时,只作逻辑删除
// 删除时,只作逻辑删除
iOrgUsrService
.
update
(
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -90,15 +86,8 @@ public class OrgPersonController {
...
@@ -90,15 +86,8 @@ public class OrgPersonController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonVo
OrgPersonVo
,
public
ResponseModel
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonVo
OrgPersonVo
,
@PathVariable
Long
id
)
throws
Exception
{
@PathVariable
Long
id
)
throws
Exception
{
iOrgUsrService
.
updateByIdOrgPerson
(
OrgPersonVo
,
id
);
// 修改人员信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
iOrgUsrService
.
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
iOrgUsrService
.
saveOrgUsr
(
oriOrgUsr
,
id
);
// 保存动态表单数据
iOrgUsrService
.
updateAlertFormValue
(
oriOrgUsr
,
orgUsr
.
getSequenceNbr
(),
OrgPersonVo
.
getAlertFormValue
());
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -112,26 +101,14 @@ public class OrgPersonController {
...
@@ -112,26 +101,14 @@ public class OrgPersonController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员详情"
,
notes
=
"获取人员详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员详情"
,
notes
=
"获取人员详情"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
iOrgUsrService
.
getById
(
id
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectPersonById
(
id
));
// 动态表单数据
List
<
FormValue
>
formValue
=
iOrgUsrService
.
getFormValue
(
id
);
OrgPersonFormVo
orgPersonFormVo
=
new
OrgPersonFormVo
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
iOrgUsrService
.
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
ResponseHelper
.
buildResponse
(
orgPersonFormVo
);
}
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{id}/detail"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}/detail"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员详情"
,
notes
=
"获取人员详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员详情"
,
notes
=
"获取人员详情"
)
public
ResponseModel
selectByIdDetail
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
public
ResponseModel
selectByIdDetail
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
iOrgUsrService
.
getById
(
id
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectPersonByIdDetail
(
id
));
// 动态表单数据
List
<
FormValue
>
formValue
=
iOrgUsrService
.
getFormValueDetail
(
id
);
OrgPersonFormVo
orgPersonFormVo
=
new
OrgPersonFormVo
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
iOrgUsrService
.
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
ResponseHelper
.
buildResponse
(
orgPersonFormVo
);
}
}
/**
/**
...
@@ -159,13 +136,8 @@ public class OrgPersonController {
...
@@ -159,13 +136,8 @@ public class OrgPersonController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员树"
,
notes
=
"获取人员树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取人员树"
,
notes
=
"获取人员树"
)
public
ResponseModel
selectCompanyTree
()
throws
Exception
{
public
ResponseModel
selectPersonTree
()
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectPersonTree
());
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
Collection
<
OrgUsr
>
list
=
iOrgUsrService
.
listByMap
(
columnMap
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getTree
(
null
,
list
,
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
));
}
}
/**
/**
...
@@ -189,14 +161,12 @@ public class OrgPersonController {
...
@@ -189,14 +161,12 @@ public class OrgPersonController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{orgCode}/users"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{orgCode}/users"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据orgCode查询"
,
notes
=
"根据orgCode查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据orgCode查询"
,
notes
=
"根据orgCode查询"
)
public
ResponseModel
selectUsersByOrgCode
(
HttpServletRequest
request
,
String
pageNum
,
String
pageSize
,
public
ResponseModel
selectUsersByOrgCode
(
HttpServletRequest
request
,
String
pageNum
,
String
pageSize
,
@PathVariable
Long
orgCode
)
{
@PathVariable
Long
orgCode
)
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"biz_org_code"
,
orgCode
);
columnMap
.
put
(
"biz_org_code"
,
orgCode
);
columnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
columnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
iOrgUsrService
.
listByMap
(
columnMap
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
listByMap
(
columnMap
));
return
ResponseHelper
.
buildResponse
(
null
);
}
}
/**
/**
...
@@ -221,15 +191,10 @@ public class OrgPersonController {
...
@@ -221,15 +191,10 @@ public class OrgPersonController {
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/save
Department
"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/save
Person
"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入人员信息"
,
notes
=
"导入人员信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入人员信息"
,
notes
=
"导入人员信息"
)
public
ResponseModel
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgPersonVo
>
OrgPersonVo
)
{
public
ResponseModel
savePerson
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgPersonVo
>
OrgPersonVo
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgPersonVo
.
size
();
i
++)
{
iOrgUsrService
.
savePersonList
(
OrgPersonVo
);
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgPersonVo
.
get
(
i
).
getAlertFormValue
());
}
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrgUsrController.java
View file @
e64a8656
...
@@ -5,16 +5,14 @@ import java.io.UnsupportedEncodingException;
...
@@ -5,16 +5,14 @@ import java.io.UnsupportedEncodingException;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -34,10 +32,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
...
@@ -34,10 +32,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
com.yeejoin.amos.boot.biz.common.utils.ExcelUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.ExcelUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrDownloadTemplateVO
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrVo
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrServiceImpl
;
...
@@ -99,13 +95,7 @@ public class OrgUsrController extends BaseController {
...
@@ -99,13 +95,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrVo
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
public
ResponseModel
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrVo
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
// 修改单位信息
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
iOrgUsrService
.
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
iOrgUsrService
.
saveOrgUsr
(
oriOrgUsr
,
id
);
// 保存动态表单数据
iOrgUsrService
.
updateAlertFormValue
(
oriOrgUsr
,
orgUsr
.
getSequenceNbr
(),
OrgUsrVo
.
getAlertFormValue
());
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -120,13 +110,7 @@ public class OrgUsrController extends BaseController {
...
@@ -120,13 +110,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位详情"
,
notes
=
"获取单位详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位详情"
,
notes
=
"获取单位详情"
)
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
public
ResponseModel
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
iOrgUsrService
.
getById
(
id
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectCompanyById
(
id
));
// 动态表单数据
List
<
FormValue
>
formValue
=
iOrgUsrService
.
getFormValue
(
id
);
OrgUsrFormVo
orgUsrFormVo
=
new
OrgUsrFormVo
();
orgUsrFormVo
.
setDynamicFormAlert
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrFormVo
);
return
ResponseHelper
.
buildResponse
(
orgUsrFormVo
);
}
}
...
@@ -139,20 +123,8 @@ public class OrgUsrController extends BaseController {
...
@@ -139,20 +123,8 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/selectByBizOrgType/{bizOrgType}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/selectByBizOrgType/{bizOrgType}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据bizOrgType分页查询"
,
notes
=
"根据bizOrgType分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据bizOrgType分页查询"
,
notes
=
"根据bizOrgType分页查询"
)
public
ResponseModel
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
@PathVariable
String
bizOrgType
)
{
public
ResponseModel
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
@PathVariable
String
bizOrgType
)
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
page
(
iOrgUsrService
.
bizOrgTypeListPage
(
pageNum
,
pageSize
,
bizOrgType
)));
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"biz_org_type"
,
bizOrgType
);
Page
<
OrgUsr
>
pageBean
=
new
Page
();
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
OrgUsr
>();
queryWrapper
.
allEq
(
columnMap
);
queryWrapper
.
orderByAsc
(
"sequence_nbr"
);
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
page
(
pageBean
,
queryWrapper
));
}
}
...
@@ -166,9 +138,6 @@ public class OrgUsrController extends BaseController {
...
@@ -166,9 +138,6 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树"
,
notes
=
"获取单位部门树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树"
,
notes
=
"获取单位部门树"
)
public
ResponseModel
<
List
<
OrgMenuVo
>>
selectCompanyTree
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuVo
>>
selectCompanyTree
()
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
List
<
OrgMenuVo
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
List
<
OrgMenuVo
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
...
@@ -229,17 +198,8 @@ public class OrgUsrController extends BaseController {
...
@@ -229,17 +198,8 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
public
ResponseModel
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgDepartmentVo
>
OrgDepartmentVo
,
@PathVariable
Long
id
)
{
public
ResponseModel
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgDepartmentVo
>
OrgDepartmentVo
,
@PathVariable
Long
id
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgDepartmentVo
.
size
();
i
++)
{
iOrgUsrService
.
saveDepartment
(
OrgDepartmentVo
,
id
);
// 导入部门信息的前提条件:单位信息已经存在
if
(
iOrgUsrService
.
getById
(
id
)
==
null
)
{
return
ResponseHelper
.
buildResponse
(
"单位信息需存在才可导入部门信息"
);
}
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgDepartmentVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_DEPARTMENT
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgDepartmentVo
.
get
(
i
).
getAlertFormValue
());
}
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -251,13 +211,8 @@ public class OrgUsrController extends BaseController {
...
@@ -251,13 +211,8 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveCompany"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/saveCompany"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入单位信息"
,
notes
=
"导入单位信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入单位信息"
,
notes
=
"导入单位信息"
)
public
ResponseModel
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgUsrVo
>
OrgUsrVo
)
{
public
ResponseModel
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgUsrVo
>
OrgUsrVo
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgUsrVo
.
size
();
i
++)
{
iOrgUsrService
.
saveCompany
(
OrgUsrVo
);
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getAlertFormValue
());
}
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
View file @
e64a8656
This diff is collapsed.
Click to expand it.
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