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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
285 additions
and
177 deletions
+285
-177
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
+10
-55
OrgUsrServiceImpl.java
...s/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
+205
-73
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,14 +211,9 @@ public class OrgUsrController extends BaseController {
...
@@ -251,14 +211,9 @@ 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
();
return
ResponseHelper
.
buildResponse
(
null
);
BeanUtils
.
copyProperties
(
OrgUsrVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getAlertFormValue
());
}
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
...
@@ -15,7 +15,11 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
...
@@ -15,7 +15,11 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrMapper;
import
com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.jcs.api.service.IOrgUsrService
;
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.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -23,8 +27,10 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
...
@@ -23,8 +27,10 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -42,7 +48,7 @@ import java.util.Map;
...
@@ -42,7 +48,7 @@ import java.util.Map;
*/
*/
@Service
@Service
public
class
OrgUsrServiceImpl
extends
BaseService
<
OrgUsrDto
,
OrgUsr
,
OrgUsrMapper
>
implements
IOrgUsrService
{
public
class
OrgUsrServiceImpl
extends
BaseService
<
OrgUsrDto
,
OrgUsr
,
OrgUsrMapper
>
implements
IOrgUsrService
{
@Autowired
@Autowired
AlertFormValueServiceImpl
alertFormValueServiceImpl
;
AlertFormValueServiceImpl
alertFormValueServiceImpl
;
@Autowired
@Autowired
...
@@ -54,6 +60,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -54,6 +60,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
public
String
selectUpUnitByParam
(
String
biz_org_code
)
{
public
String
selectUpUnitByParam
(
String
biz_org_code
)
{
return
this
.
baseMapper
.
selectUpUnitByParam
(
biz_org_code
);
return
this
.
baseMapper
.
selectUpUnitByParam
(
biz_org_code
);
}
}
@Override
@Override
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
List
<
OrgMenuVo
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
public
List
<
OrgMenuVo
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
...
@@ -99,11 +106,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -99,11 +106,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
@Override
@Override
public
List
<
OrgMenuVo
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
public
List
<
OrgMenuVo
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
List
<
OrgMenuVo
>
childList
=
new
ArrayList
<>();
List
<
OrgMenuVo
>
childList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
switch
(
IDHierarchy
)
{
case
1
:
case
1
:
...
@@ -147,7 +154,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -147,7 +154,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
//子集的间接子对象
//子集的间接子对象
for
(
OrgMenuVo
entity
:
childList
)
{
for
(
OrgMenuVo
entity
:
childList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
if
(
entity
.
getChildren
()
!=
null
){
if
(
entity
.
getChildren
()
!=
null
)
{
entity
.
setLeaf
(
false
);
entity
.
setLeaf
(
false
);
}
}
}
}
...
@@ -176,27 +183,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -176,27 +183,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
// 下级单位
// 下级单位
Map
<
String
,
Object
>
downUnitColumnMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
downUnitColumnMap
=
new
HashMap
<>();
downUnitColumnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
downUnitColumnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
downUnitColumnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
downUnitColumnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
downUnitColumnMap
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
downUnitColumnMap
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
QueryWrapper
downUnitWrapper
=
new
QueryWrapper
<
OrgUsr
>();
QueryWrapper
downUnitWrapper
=
new
QueryWrapper
<
OrgUsr
>();
downUnitWrapper
.
allEq
(
downUnitColumnMap
);
downUnitWrapper
.
allEq
(
downUnitColumnMap
);
List
<
OrgUsr
>
downList
=
list
(
downUnitWrapper
);
List
<
OrgUsr
>
downList
=
list
(
downUnitWrapper
);
if
(
downList
.
size
()
==
0
){
if
(
downList
.
size
()
==
0
)
{
resultMap
.
put
(
"downUnit"
,
false
);
resultMap
.
put
(
"downUnit"
,
false
);
}
else
{
}
else
{
resultMap
.
put
(
"downUnit"
,
true
);
resultMap
.
put
(
"downUnit"
,
true
);
}
}
// 人员数量
// 人员数量
Map
<
String
,
Object
>
countPerson
=
new
HashMap
<>();
Map
<
String
,
Object
>
countPerson
=
new
HashMap
<>();
countPerson
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
countPerson
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
countPerson
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
countPerson
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
QueryWrapper
personNumWrapper
=
new
QueryWrapper
<
Integer
>();
QueryWrapper
personNumWrapper
=
new
QueryWrapper
<
Integer
>();
personNumWrapper
.
allEq
(
countPerson
);
personNumWrapper
.
allEq
(
countPerson
);
resultMap
.
put
(
"personNum"
,
count
(
personNumWrapper
));
resultMap
.
put
(
"personNum"
,
count
(
personNumWrapper
));
QueryWrapper
companyWrapper
=
new
QueryWrapper
<
AlertFormValue
>();
QueryWrapper
companyWrapper
=
new
QueryWrapper
<
AlertFormValue
>();
companyWrapper
.
eq
(
"alert_called_id"
,
company
.
getSequenceNbr
());
companyWrapper
.
eq
(
"alert_called_id"
,
company
.
getSequenceNbr
());
List
<
Map
<
String
,
Object
>>
personList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
personList
=
new
ArrayList
<>();
if
(
alertFormValueServiceImpl
.
list
(
companyWrapper
).
size
()
!=
0
)
{
if
(
alertFormValueServiceImpl
.
list
(
companyWrapper
).
size
()
!=
0
)
{
// 查询动态表单Phone
// 查询动态表单Phone
Map
<
String
,
Object
>
phone
=
new
HashMap
<>();
Map
<
String
,
Object
>
phone
=
new
HashMap
<>();
phone
.
put
(
"alert_called_id"
,
company
.
getSequenceNbr
());
phone
.
put
(
"alert_called_id"
,
company
.
getSequenceNbr
());
...
@@ -215,15 +222,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -215,15 +222,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
Map
<
String
,
Object
>
personMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"id"
,
orgUsr
.
getSequenceNbr
());
personMap
.
put
(
"id"
,
orgUsr
.
getSequenceNbr
());
personMap
.
put
(
"name"
,
orgUsr
.
getBizOrgName
());
personMap
.
put
(
"name"
,
orgUsr
.
getBizOrgName
());
personMap
.
put
(
"unit"
,
company
.
getBizOrgName
());
personMap
.
put
(
"unit"
,
company
.
getBizOrgName
());
QueryWrapper
wrapper
=
new
QueryWrapper
<
AlertFormValue
>();
QueryWrapper
wrapper
=
new
QueryWrapper
<
AlertFormValue
>();
wrapper
.
eq
(
"alert_called_id"
,
orgUsr
.
getSequenceNbr
());
wrapper
.
eq
(
"alert_called_id"
,
orgUsr
.
getSequenceNbr
());
if
(
alertFormValueServiceImpl
.
list
(
wrapper
).
size
()
==
0
)
{
if
(
alertFormValueServiceImpl
.
list
(
wrapper
).
size
()
==
0
)
{
personMap
.
put
(
"administrativePositionCode"
,
null
);
personMap
.
put
(
"administrativePositionCode"
,
null
);
personMap
.
put
(
"tel"
,
null
);
personMap
.
put
(
"tel"
,
null
);
personMap
.
put
(
"img"
,
null
);
personMap
.
put
(
"img"
,
null
);
personList
.
add
(
personMap
);
personList
.
add
(
personMap
);
}
else
{
}
else
{
// 查询动态表单zhiwei
// 查询动态表单zhiwei
Map
<
String
,
Object
>
zhiwei
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
zhiwei
=
new
HashMap
<
String
,
Object
>();
zhiwei
.
put
(
"alert_called_id"
,
orgUsr
.
getSequenceNbr
());
zhiwei
.
put
(
"alert_called_id"
,
orgUsr
.
getSequenceNbr
());
...
@@ -252,60 +259,61 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -252,60 +259,61 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
});
});
}
}
resultMap
.
put
(
"children"
,
personList
);
resultMap
.
put
(
"children"
,
personList
);
companyPersonMsg
.
add
(
resultMap
);
companyPersonMsg
.
add
(
resultMap
);
}
}
return
companyPersonMsg
;
return
companyPersonMsg
;
}
}
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
String
pageNum
,
String
pageSize
,
OrgUsr
orgUsr
)
{
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
String
pageNum
,
String
pageSize
,
OrgUsr
orgUsr
)
{
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
}
else
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
else
{
}
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
QueryWrapper
<
OrgUsr
>
orgUsrQueryWrapper
=
new
QueryWrapper
<>();
}
Class
<?
extends
OrgUsr
>
aClass
=
orgUsr
.
getClass
();
QueryWrapper
<
OrgUsr
>
orgUsrQueryWrapper
=
new
QueryWrapper
<>();
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
Class
<?
extends
OrgUsr
>
aClass
=
orgUsr
.
getClass
();
try
{
Arrays
.
stream
(
aClass
.
getDeclaredFields
()).
forEach
(
field
->
{
field
.
setAccessible
(
true
);
try
{
Object
o
=
field
.
get
(
orgUsr
);
field
.
setAccessible
(
true
);
if
(
o
!=
null
)
{
Object
o
=
field
.
get
(
orgUsr
);
Class
<?>
type
=
field
.
getType
();
if
(
o
!=
null
)
{
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
Class
<?>
type
=
field
.
getType
();
if
(
type
.
equals
(
Integer
.
class
))
{
String
name
=
NameUtils
.
camel2Underline
(
field
.
getName
());
Integer
fileValue
=
(
Integer
)
field
.
get
(
orgUsr
);
if
(
type
.
equals
(
Integer
.
class
))
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
Integer
fileValue
=
(
Integer
)
field
.
get
(
orgUsr
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
Long
fileValue
=
(
Long
)
field
.
get
(
orgUsr
);
}
else
if
(
type
.
equals
(
Long
.
class
))
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
Long
fileValue
=
(
Long
)
field
.
get
(
orgUsr
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
}
else
if
(
type
.
equals
(
String
.
class
))
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
}
else
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
}
else
{
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
String
fileValue
=
(
String
)
field
.
get
(
orgUsr
);
}
orgUsrQueryWrapper
.
eq
(
name
,
fileValue
);
}
}
}
catch
(
Exception
e
)
{
}
}
}
catch
(
Exception
e
)
{
});
}
pageBean
.
setTotal
(
this
.
baseMapper
.
selectCount
(
orgUsrQueryWrapper
));
});
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
orgUsr
);
pageBean
.
setTotal
(
this
.
baseMapper
.
selectCount
(
orgUsrQueryWrapper
));
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
Map
<
String
,
Object
>
map
=
Bean
.
BeantoMap
(
orgUsr
);
map
.
put
(
"pageSize"
,
pageBean
.
getSize
());
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
"246"
));
map
.
put
(
"pageSize"
,
pageBean
.
getSize
());
pageBean
.
setRecords
(
this
.
baseMapper
.
selectPersonList
(
map
));
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
"246"
));
map
.
put
(
"bizOrgType"
,
"PERSON"
);
pageBean
.
setRecords
(
this
.
baseMapper
.
selectPersonList
(
map
));
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonList
(
map
);
map
.
put
(
"bizOrgType"
,
"PERSON"
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonList
(
map
);
pageBean
.
setRecords
(
list
);
return
pageBean
;
pageBean
.
setRecords
(
list
);
}
return
pageBean
;
}
@Override
@Override
public
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
{
public
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
{
// 动态表单数据
// 动态表单数据
List
<
AlertFormValueVo
>
list
=
iAlertFromValueService
.
listByCalledId
(
id
);
List
<
AlertFormValueVo
>
list
=
iAlertFromValueService
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
();
List
<
FormValue
>
formValue
=
new
ArrayList
();
for
(
AlertFormValueVo
alertFormValue
:
list
)
{
for
(
AlertFormValueVo
alertFormValue
:
list
)
{
...
@@ -321,13 +329,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -321,13 +329,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
return
formValue
;
return
formValue
;
}
}
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
// 动态表单数据
// 动态表单数据
List
<
AlertFormValueVo
>
list
=
iAlertFromValueService
.
listByCalledId
(
id
);
List
<
AlertFormValueVo
>
list
=
iAlertFromValueService
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
();
List
<
FormValue
>
formValue
=
new
ArrayList
();
for
(
AlertFormValueVo
alertFormValue
:
list
)
{
for
(
AlertFormValueVo
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getIsBlock
());
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getIsBlock
());
formValue
.
add
(
value
);
formValue
.
add
(
value
);
}
}
...
@@ -335,7 +343,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -335,7 +343,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
@Override
@Override
public
void
saveOrgUsr
(
OrgUsr
oriOrgUsr
,
Long
id
)
throws
Exception
{
public
void
saveOrgUsr
(
OrgUsr
oriOrgUsr
,
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
orgUsr
=
new
OrgUsr
();
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
orgUsr
.
setSequenceNbr
(
id
);
orgUsr
.
setSequenceNbr
(
id
);
...
@@ -358,7 +366,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -358,7 +366,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
@Override
@Override
public
void
updateAlertFormValue
(
OrgUsr
orgUsr
,
Long
alertCalledId
,
List
<
AlertFormValue
>
alertFromValuelist
)
throws
Exception
{
public
void
updateAlertFormValue
(
OrgUsr
orgUsr
,
Long
alertCalledId
,
List
<
AlertFormValue
>
alertFromValuelist
)
throws
Exception
{
// 填充主键
// 填充主键
alertFromValuelist
.
stream
().
forEach
(
alertFromValue
->
{
alertFromValuelist
.
stream
().
forEach
(
alertFromValue
->
{
alertFromValue
.
setAlertCalledId
(
orgUsr
.
getSequenceNbr
());
alertFromValue
.
setAlertCalledId
(
orgUsr
.
getSequenceNbr
());
...
@@ -380,7 +388,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -380,7 +388,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
}
@Override
@Override
public
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
{
public
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
{
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
queryWrapper
.
eq
(
"alert_called_id"
,
id
);
// 动态表单数据
// 动态表单数据
...
@@ -403,7 +411,131 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
...
@@ -403,7 +411,131 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
getAlertFormValue
());
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
getAlertFormValue
());
}
}
@Override
public
void
saveOrgPerson
(
OrgPersonVo
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgPersonVo
.
getAlertFormValue
());
}
@Override
public
void
updateByIdOrgUsr
(
OrgUsrVo
OrgUsrVo
,
Long
id
)
throws
Exception
{
// 修改单位信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
saveOrgUsr
(
oriOrgUsr
,
id
);
// 保存动态表单数据
updateAlertFormValue
(
oriOrgUsr
,
orgUsr
.
getSequenceNbr
(),
OrgUsrVo
.
getAlertFormValue
());
}
@Override
public
void
updateByIdOrgPerson
(
OrgPersonVo
OrgPersonVo
,
Long
id
)
throws
Exception
{
// 修改人员信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
saveOrgUsr
(
oriOrgUsr
,
id
);
// 保存动态表单数据
updateAlertFormValue
(
oriOrgUsr
,
orgUsr
.
getSequenceNbr
(),
OrgPersonVo
.
getAlertFormValue
());
}
@Override
public
OrgUsrFormVo
selectCompanyById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgUsrFormVo
orgUsrFormVo
=
new
OrgUsrFormVo
();
orgUsrFormVo
.
setDynamicFormAlert
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrFormVo
);
return
orgUsrFormVo
;
}
@Override
public
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
{
Map
<
String
,
Object
>
columnMap
=
new
HashMap
<>();
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
page
(
pageBean
,
queryWrapper
);
}
@Override
public
void
saveDepartment
(
List
<
OrgDepartmentVo
>
OrgDepartmentVo
,
Long
id
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgDepartmentVo
.
size
();
i
++)
{
// 导入部门信息的前提条件:单位信息已经存在
if
(
getById
(
id
)
!=
null
)
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgDepartmentVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_DEPARTMENT
);
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgDepartmentVo
.
get
(
i
).
getAlertFormValue
());
}
}
}
@Override
public
void
saveCompany
(
List
<
OrgUsrVo
>
OrgUsrVo
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgUsrVo
.
size
();
i
++)
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getAlertFormValue
());
}
}
@Override
public
OrgPersonFormVo
selectPersonById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgPersonFormVo
orgPersonFormVo
=
new
OrgPersonFormVo
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
orgPersonFormVo
;
}
@Override
public
OrgPersonFormVo
selectPersonByIdDetail
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValueDetail
(
id
);
OrgPersonFormVo
orgPersonFormVo
=
new
OrgPersonFormVo
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
orgPersonFormVo
;
}
@Override
public
List
<
OrgMenuVo
>
selectPersonTree
()
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_PERSON
);
Collection
<
OrgUsr
>
list
=
listByMap
(
columnMap
);
return
getTree
(
null
,
list
,
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
}
@Override
public
void
savePersonList
(
List
<
OrgPersonVo
>
OrgPersonVo
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
OrgPersonVo
.
size
();
i
++)
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
.
get
(
i
),
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgPersonVo
.
get
(
i
).
getAlertFormValue
());
}
}
}
}
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