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
cfe322d2
Commit
cfe322d2
authored
Jun 25, 2021
by
李腾威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改单位树接口 单位/机构/人员 批量导入
parent
8dd06002
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
80 deletions
+73
-80
OrgUsrMapper.java
...yeejoin/amos/boot/module/jcs/api/mapper/OrgUsrMapper.java
+2
-5
IOrgUsrService.java
...join/amos/boot/module/jcs/api/service/IOrgUsrService.java
+2
-0
OrgMenuVo.java
...va/com/yeejoin/amos/boot/module/jcs/api/vo/OrgMenuVo.java
+0
-1
OrgPersonVo.java
.../com/yeejoin/amos/boot/module/jcs/api/vo/OrgPersonVo.java
+0
-1
OrgUsrMapper.xml
...module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
+14
-25
OrgDepartmentController.java
...ot/module/jcs/biz/controller/OrgDepartmentController.java
+1
-5
OrgPersonController.java
...s/boot/module/jcs/biz/controller/OrgPersonController.java
+18
-27
OrgUsrController.java
...amos/boot/module/jcs/biz/controller/OrgUsrController.java
+31
-15
OrgUsrServiceImpl.java
...s/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
+5
-1
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/mapper/OrgUsrMapper.java
View file @
cfe322d2
...
...
@@ -16,12 +16,9 @@ import org.apache.ibatis.annotations.Param;
* @date 2021-06-18
*/
public
interface
OrgUsrMapper
extends
BaseMapper
<
OrgUsr
>
{
/**
* 根据parent_id查上级机构名
* @param biz_org_code
* @return
*/
String
selectUpUnitByParam
(
@Param
(
"biz_org_code"
)
String
biz_org_code
);
List
<
Map
<
String
,
Object
>>
selectPersonList
(
Map
<
String
,
Object
>
map
);
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
}
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 @
cfe322d2
...
...
@@ -103,4 +103,6 @@ public interface IOrgUsrService {
* @throws Exception
*/
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
;
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/OrgMenuVo.java
View file @
cfe322d2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
api
.
vo
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/OrgPersonVo.java
View file @
cfe322d2
...
...
@@ -4,7 +4,6 @@ import java.io.Serializable;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
cfe322d2
...
...
@@ -14,29 +14,18 @@
</if>
</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
sequence_nbr,
biz_org_name,
biz_org_type,
parent_id
FROM
`cb_org_usr`
WHERE
is_delete = 0
and biz_org_type = "COMPANY" or biz_org_type = "DEPARTMENT"
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrgDepartmentController.java
View file @
cfe322d2
...
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import
java.io.UnsupportedEncodingException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Date
;
...
...
@@ -13,11 +12,9 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgUsrFormVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -37,7 +34,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.ExcelUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
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.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo
;
...
...
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 @
cfe322d2
...
...
@@ -2,8 +2,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import
java.io.UnsupportedEncodingException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -13,25 +11,18 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentFormVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.ExcelUtils
;
import
com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsr
;
...
...
@@ -178,7 +169,7 @@ public class OrgPersonController {
/**
*
*
*
根据orgCode查询
* @param orgCode
* @return
*/
...
...
@@ -211,21 +202,21 @@ public class OrgPersonController {
return
ResponseHelper
.
buildResponse
(
null
);
}
//
/**
// *
//
*
// * @param orgCode
// * @return
// */
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY
)
// @RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET
)
// @ApiOperation(httpMethod = "GET", value = "根据orgCode查询人员", notes = "根据orgCode查询人员")
// public ResponseModel selectUsersByOrgCode(HttpServletRequest request, String pageNum, String pageSize, @PathVariable Long orgCode
) {
// Map<String, Object> columnMap = new HashMap<>
();
// columnMap.put("is_delete",CommonConstant.IS_DELETE_00
);
// columnMap.put("biz_org_code", orgCode
);
// columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON
);
// return ResponseHelper.buildResponse( iOrgUsrService.listByMap(columnMap));
// }
/**
* 导入人员信息
*
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入人员信息"
,
notes
=
"导入人员信息"
)
public
ResponseModel
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgPersonVo
>
OrgPersonVo
)
{
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
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgPersonVo
.
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/controller/OrgUsrController.java
View file @
cfe322d2
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import
java.io.UnsupportedEncodingException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -13,8 +12,6 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.yeejoin.amos.boot.module.jcs.api.dto.AlertFromValueDto
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormValueVo
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgMenuVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -36,7 +33,6 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
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.NameUtils
;
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.vo.FormValue
;
import
com.yeejoin.amos.boot.module.jcs.api.vo.OrgDepartmentVo
;
...
...
@@ -164,19 +160,19 @@ public class OrgUsrController extends BaseController {
/**
* 获取单位树
*
* 获取单位部门树
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位
树"
,
notes
=
"获取单位
树"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位
部门树"
,
notes
=
"获取单位部门
树"
)
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
.
listByMap
(
columnMap
),
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
);
}
...
...
@@ -236,15 +232,35 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
public
ResponseModel
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
OrgDepartmentVo
OrgDepartmentVo
,
@PathVariable
Long
id
)
{
// 导入部门信息的前提条件:单位信息已经存在
if
(
iOrgUsrService
.
getById
(
id
)
==
null
)
{
return
ResponseHelper
.
buildResponse
(
"单位信息需存在才可导入部门信息"
);
public
ResponseModel
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgDepartmentVo
>
OrgDepartmentVo
,
@PathVariable
Long
id
)
{
for
(
int
i
=
0
;
i
<
OrgDepartmentVo
.
size
();
i
++)
{
// 导入部门信息的前提条件:单位信息已经存在
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
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入单位信息"
,
notes
=
"导入单位信息"
)
public
ResponseModel
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgUsrVo
>
OrgUsrVo
)
{
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
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getAlertFormValue
());
}
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_DEPARTMENT
);
iOrgUsrService
.
saveOrgUsrAlertFormValue
(
orgUsr
,
OrgDepartmentVo
.
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 @
cfe322d2
...
...
@@ -21,7 +21,6 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.lang.reflect.Method
;
...
...
@@ -379,4 +378,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto,OrgUsr,OrgUsrMappe
}
return
result
;
}
@Override
public
List
<
OrgUsr
>
selectCompanyDepartmentMsg
()
{
return
this
.
baseMapper
.
selectCompanyDepartmentMsg
();
}
}
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