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
c19ca472
Commit
c19ca472
authored
Aug 20, 2021
by
李成龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
c3a5c80e
04ddc68d
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
2426 additions
and
2020 deletions
+2426
-2020
CurrentStatusDto.java
...oin/amos/boot/module/common/api/dto/CurrentStatusDto.java
+9
-0
DynamicFormInitDto.java
...n/amos/boot/module/common/api/dto/DynamicFormInitDto.java
+4
-1
FailureRepairlogDto.java
.../amos/boot/module/common/api/dto/FailureRepairlogDto.java
+1
-2
StatusDto.java
...om/yeejoin/amos/boot/module/common/api/dto/StatusDto.java
+9
-0
UserUnitDto.java
.../yeejoin/amos/boot/module/common/api/dto/UserUnitDto.java
+29
-0
FailureRepairlog.java
.../amos/boot/module/common/api/entity/FailureRepairlog.java
+0
-2
UserRolesEnum.java
...join/amos/boot/module/common/api/enums/UserRolesEnum.java
+31
-0
UserUnitTypeEnum.java
...n/amos/boot/module/common/api/enums/UserUnitTypeEnum.java
+15
-0
FailureDetailsMapper.java
...s/boot/module/common/api/mapper/FailureDetailsMapper.java
+33
-0
OrgUsrMapper.java
...join/amos/boot/module/common/api/mapper/OrgUsrMapper.java
+7
-0
IOrgUsrService.java
...n/amos/boot/module/common/api/service/IOrgUsrService.java
+170
-148
FailureDetailsMapper.xml
...on-api/src/main/resources/mapper/FailureDetailsMapper.xml
+69
-0
OrgUsrMapper.xml
...ule-common-api/src/main/resources/mapper/OrgUsrMapper.xml
+66
-2
FailureAuditController.java
.../module/common/biz/controller/FailureAuditController.java
+0
-31
FailureDetailsController.java
...odule/common/biz/controller/FailureDetailsController.java
+2
-2
FailureMaintainController.java
...dule/common/biz/controller/FailureMaintainController.java
+4
-69
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+127
-79
DynamicFormColumnServiceImpl.java
...common/biz/service/impl/DynamicFormColumnServiceImpl.java
+18
-3
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+13
-28
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+560
-603
FailureMaintainServiceImpl.java
...e/common/biz/service/impl/FailureMaintainServiceImpl.java
+6
-77
FailureVerifyServiceImpl.java
...ule/common/biz/service/impl/FailureVerifyServiceImpl.java
+3
-16
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+1176
-952
AlertCalledController.java
...boot/module/jcs/biz/controller/AlertCalledController.java
+2
-1
OpreateLogEventHandler.java
...dule/jcs/biz/controller/event/OpreateLogEventHandler.java
+48
-0
pom.xml
amos-boot-module/amos-boot-module-biz/pom.xml
+15
-1
application.properties
...boot-system-jcs/src/main/resources/application.properties
+1
-2
mt-sql-task.xml
...intenance/src/main/resources/db/changelog/mt-sql-task.xml
+8
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/CurrentStatusDto.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
lombok.Data
;
@Data
public
class
CurrentStatusDto
{
private
String
cutrentStatusName
;
private
Integer
cutrentStatusCount
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/DynamicFormInitDto.java
View file @
c19ca472
...
...
@@ -37,10 +37,13 @@ public class DynamicFormInitDto implements Serializable{
@ApiModelProperty
(
value
=
"提交表单附加字段"
)
private
DynamicFormInstanceDto
formItemDescr
;
@ApiModelProperty
(
value
=
"
接口地址
"
)
@ApiModelProperty
(
value
=
"
配置
"
)
private
String
columnConfig
;
private
int
sort
;
@ApiModelProperty
(
value
=
"接口地址"
)
private
String
url
;
public
DynamicFormInitDto
()
{
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/FailureRepairlogDto.java
View file @
c19ca472
...
...
@@ -24,7 +24,6 @@ public class FailureRepairlogDto extends BaseDto {
@ApiModelProperty
(
value
=
"流程处理人Id"
)
private
Integer
processAuditorId
;
@ApiModelProperty
(
value
=
"处理人所属部门"
)
private
String
processDepartment
;
...
...
@@ -41,6 +40,6 @@ public class FailureRepairlogDto extends BaseDto {
private
Long
faultId
;
@ApiModelProperty
(
value
=
"流程处理人"
)
private
String
processAuditor
Cid
;
private
String
processAuditor
Name
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/StatusDto.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
lombok.Data
;
@Data
public
class
StatusDto
{
private
Integer
currentStatus
;
private
Integer
currentStatusCount
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/UserUnitDto.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 单位归属
*
* @author gaojianqiang
* @date 2021-08-19
*/
@Data
@ApiModel
(
value
=
"UserUnitDto"
,
description
=
"用户单位归属"
)
public
class
UserUnitDto
{
@ApiModelProperty
(
value
=
"人员类型1-维保公司;2-业主单位"
)
private
String
identityType
;
@ApiModelProperty
(
value
=
"人员id"
)
private
String
personSeq
;
@ApiModelProperty
(
value
=
"人员名称"
)
private
String
personName
;
@ApiModelProperty
(
value
=
"公司id"
)
private
String
companyId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/entity/FailureRepairlog.java
View file @
c19ca472
...
...
@@ -62,6 +62,4 @@ public class FailureRepairlog extends BaseEntity {
@TableField
(
"fault_id"
)
private
Long
faultId
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/UserRolesEnum.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
enums
;
public
enum
UserRolesEnum
{
ADMIN
(
"admin"
,
"机场单位"
),
AIRPORTUNIT
(
"AIRPORTUNIT"
,
"机场单位"
);
private
String
code
;
private
String
name
;
UserRolesEnum
(
String
code
,
String
name
){
this
.
code
=
code
;
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/enums/UserUnitTypeEnum.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
@Getter
@AllArgsConstructor
public
enum
UserUnitTypeEnum
{
MAINTENANCE_COMPANY
(
"1"
,
"维保公司"
),
OWNER_UNIT
(
"2"
,
"业主单位"
);
private
String
value
;
private
String
name
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/FailureDetailsMapper.java
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.StatusDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* Mapper 接口
...
...
@@ -10,4 +19,28 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
* @date 2021-08-04
*/
public
interface
FailureDetailsMapper
extends
BaseMapper
<
FailureDetails
>
{
/**
*查询全部 分页
* @param page
* @return
*/
IPage
<
FailureDetails
>
selectAllPage
(
Page
page
);
/**
*查询我发起的 分页
* current 当前页
* size 条数
* @return
*/
IPage
<
FailureDetails
>
selectISubPage
(
Page
page
,
String
submissionPid
);
/**
*查询待处理 分页
* @param page
* @return
*/
IPage
<
FailureDetails
>
selectInProcessing
(
Page
page
);
List
<
StatusDto
>
selectStatusCount
();
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/OrgUsrMapper.java
View file @
c19ca472
...
...
@@ -63,4 +63,11 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
/**
* 查询单位基本信息列表和单位下所有的重点部位数量。
*/
List
<
OrgUsrTreeDto
>
getCompanyAndKeySite
(
Long
companyId
);
List
<
UserUnitDto
>
getUserUnit
(
String
id
,
String
type
,
String
code
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
service
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
/**
* 机构/部门/人员表 服务类
...
...
@@ -19,161 +16,186 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
* @date 2021-06-18
*/
public
interface
IOrgUsrService
{
/**
* 查询上级单位
* @param parent_id
* @return
*/
/**
* 查询上级单位
*
* @param parent_id
* @return
*/
String
selectUpUnitByParam
(
String
parent_id
);
/**
* 获取父级
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List
<
OrgMenuDto
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
/**
* 获取父级
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List
<
OrgMenuDto
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
/**
* 获取子数据集合
*
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List
<
OrgMenuDto
>
getSub
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
/**
* 组装融合调度单位人员信息
*
* @param ids
* @return
* @throws Exception
*/
List
<
Map
<
String
,
Object
>>
returnCompanyPersonMsg
(
List
<
Long
>
ids
)
throws
Exception
;
/**
* 获取动态表单数据
*
* @param id
* @return
* @throws Exception
*/
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
;
/**
* 保存 机构/部门/人员基本信息
*
* @param
* @throws Exception
*/
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
;
/**
* 新增机构/部门/人员基本信息和动态表单数据
*
* @param orgUsr
* @param alertFromValuelist
*/
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
;
/**
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
throws
Exception
;
/**
* @param id
* @throws Exception
*/
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
;
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
void
saveOrgUsr
(
OrgUsrDto
OrgUsrDto
)
throws
Exception
;
void
saveOrgPerson
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonDto
,
Long
id
)
throws
Exception
;
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
;
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
;
void
saveDepartment
(
List
<
OrgDepartmentDto
>
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrDto
)
throws
Exception
;
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
;
OrgPersonFormDto
selectPersonByIdDetail
(
Long
id
)
throws
Exception
;
List
<
OrgMenuDto
>
selectPersonTree
()
throws
Exception
;
void
savePersonList
(
List
<
OrgPersonDto
>
OrgPersonDto
)
throws
Exception
;
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
)
throws
Exception
;
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
;
List
<
Map
<
String
,
Object
>>
selectForShowByListId
(
List
<
Long
>
ids
)
throws
Exception
;
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 列表
*/
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
);
/**
* 获取子数据集合
* @param topId
* @param entityList
* @param packageURL
* @param IDMethodName
* @param IDHierarchy
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @return
* @throws Exception
*/
List
<
OrgMenuDto
>
getSub
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 统计
*/
Integer
listContractDtoCount
(
RequestData
par
);
/**
* 组装融合调度单位人员信息
* @param ids
* @return
* @throws Exception
*/
List
<
Map
<
String
,
Object
>>
returnCompanyPersonMsg
(
List
<
Long
>
ids
)
throws
Exception
;
/**
* * @param null
*
* @return <PRE>
* author tw
* date 2021/7/26
* </PRE>
*/
/**
* 获取动态表单数据
* @param id
* @return
* @throws Exception
*/
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
;
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
);
/**
* 保存 机构/部门/人员基本信息
* @param
* @throws Exception
*/
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
;
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
);
/**
* 新增机构/部门/人员基本信息和动态表单数据
* @param orgUsr
* @param alertFromValuelist
*/
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
;
List
<
Map
<
String
,
Object
>>
getparent
();
/**
* 更新机构/部门/人员基本信息和动态表单数据
*
* @param instanceId 实例id
* @param fromValueList 动态表单数据列表
* @throws Exception
*/
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
throws
Exception
;
List
<
OrgUsrExcelDto
>
exportToExcel
();
UserUnitDto
getUserUnit
(
String
id
,
String
type
,
String
code
);
/**
*
* @param id
* @throws Exception
* 根据登陆人获取公司部门人员树
*/
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
;
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
void
saveOrgUsr
(
OrgUsrDto
OrgUsrDto
)
throws
Exception
;
void
saveOrgPerson
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonDto
,
Long
id
)
throws
Exception
;
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
;
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
;
void
saveDepartment
(
List
<
OrgDepartmentDto
>
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrDto
)
throws
Exception
;
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
;
OrgPersonFormDto
selectPersonByIdDetail
(
Long
id
)
throws
Exception
;
List
<
OrgMenuDto
>
selectPersonTree
()
throws
Exception
;
void
savePersonList
(
List
<
OrgPersonDto
>
OrgPersonDto
)
throws
Exception
;
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
)
throws
Exception
;
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
;
List
<
Map
<
String
,
Object
>>
selectForShowByListId
(
List
<
Long
>
ids
)
throws
Exception
;
List
<
OrgMenuDto
>
companyUserTreeByUser
(
AgencyUserModel
user
);
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 列表
* 根据登陆人获取公司部门树
*/
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
);
List
<
OrgMenuDto
>
companyTreeByUser
(
AgencyUserModel
user
);
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
* 统计
* 根据登陆人获取公司列表(关联重点部位)
*/
Integer
listContractDtoCount
(
RequestData
par
);
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/26
* </PRE>
*/
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
);
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
);
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
List
<
OrgUsrTreeDto
>
companyListByUser
(
AgencyUserModel
user
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/FailureDetailsMapper.xml
View file @
c19ca472
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper"
>
<select
id=
"selectAllPage"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
</select>
<select
id=
"selectISubPage"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
WHERE
submission_pid = #{submissionPid}
</select>
<select
id=
"selectInProcessing"
resultType=
"com.yeejoin.amos.boot.module.common.api.entity.FailureDetails"
>
SELECT
sequence_nbr,
current_status,
failure_equipment_id,
failure_equipment,
fault_time,
fault_phenomenon,
submission_name,
submission_pid,
biz_code,
submission_time,
submission_branch,
submission_branch_id
FROM
cb_failure_details
WHERE
is_delete = 0
</select>
<select
id=
"selectStatusCount"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.StatusDto"
>
SELECT
cb_failure_details.current_status ,
count(cb_failure_details.current_status)
AS currentStatusCount
FROM
cb_failure_details
GROUP BY
cb_failure_details.current_status
</select>
</mapper>
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
c19ca472
...
...
@@ -307,8 +307,28 @@ LEFT JOIN (
FROM important_companys
</select>
<select
id=
"getUserUnit"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto"
>
SELECT
u.sequence_nbr AS personSeq,
u.biz_org_name AS personName,
'2' AS identityType,
IFNULL( LEFT ( u.biz_org_code, 6 ), '' ) AS companyId
FROM
`cb_org_usr` u
<where>
<if
test=
"id != null and id != ''"
>
u.amos_org_id = #{id}
</if>
<if
test=
"type != null and type != ''"
>
AND u.biz_org_type = #{type}
</if>
<if
test=
"code != null and code != ''"
>
AND u.biz_org_code LIKE CONCAT(#{code}, '%')
</if>
</where>
ORDER BY
u.sequence_nbr DESC
</select>
<select
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"
>
select
a.biz_org_name bizOrgName,
...
...
@@ -335,5 +355,49 @@ LEFT JOIN (
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null
</select>
<select
id=
"getCompanyAndKeySite"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.OrgUsrTreeDto"
>
SELECT
company_sur.sequence_nbr as sequenceNbr,
company_sur.biz_org_name as bizOrgName ,
company_sur.parent_id as parentId,
company_sur.biz_org_type as bizOrgType,
-- cb.field_value_label,
CASE
WHEN keysite_sur.num IS NULL THEN
0
ELSE
keysite_sur.num
END AS num
FROM
(
SELECT
company.sequence_nbr,
company.parent_id,
company.biz_org_name,
company.biz_org_type
FROM
cb_org_usr company
WHERE
(company.biz_org_type = 'COMPANY' OR company.biz_org_type = 'DEPARTMENT')
AND company.is_delete = FALSE
<if
test=
"companyId != null and companyId != ''"
>
AND biz_org_code LIKE CONCAT((SELECT biz_org_code FROM cb_org_usr WHERE sequence_nbr = #{companyId}),'%')
</if>
) company_sur
LEFT JOIN (
SELECT
keysite.belong_id,
COUNT(keysite.belong_id) as num
FROM
cb_key_site keysite
WHERE
keysite.is_delete = FALSE
GROUP BY
keysite.belong_id
) keysite_sur ON company_sur.sequence_nbr = keysite_sur.belong_id
-- LEFT JOIN cb_dynamic_form_instance as cb ON company_sur.sequence_nbr = cb.instance_id where field_code = 'companyNature'
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureAuditController.java
View file @
c19ca472
...
...
@@ -49,8 +49,6 @@ public class FailureAuditController extends BaseController {
}
}
/**
* 根据sequenceNbr查询
*
...
...
@@ -64,35 +62,6 @@ public class FailureAuditController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureAuditDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FailureAuditDto
>
page
=
new
Page
<
FailureAuditDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
FailureAuditDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryForFailureAuditList
());
}
/**
* 审核列表记录查询
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureDetailsController.java
View file @
c19ca472
...
...
@@ -181,8 +181,8 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前状态任务数量"
,
notes
=
"查询当前状态任务数量"
)
@GetMapping
(
value
=
"/list/count"
)
public
ResponseModel
<
List
<
FailureStatusCountDto
>>
selectStatusCount
(
@RequestParam
Integer
type
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
(
type
));
public
ResponseModel
<
Object
>
selectStatusCount
(
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
());
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/FailureMaintainController.java
View file @
c19ca472
...
...
@@ -2,23 +2,23 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureAudit
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
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.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl
;
...
...
@@ -59,71 +59,6 @@ public class FailureMaintainController extends BaseController {
}
/**
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
*
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/verify"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"验收操作"
,
notes
=
"根据sequenceNbr更新"
)
public
Object
updateBySequenceNbrFailureMaintain
(
@RequestBody
FailureMaintainDto
model
)
{
try
{
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
updateModel
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResponseHelper
.
buildResponse
(
false
);
}
}
/*
*/
/**
* 根据sequenceNbr更新
* 根据传递的Status状态确认验收状态
*
* @param sequenceNbr 主键
* @return
*//*
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/update/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "维修完成", notes = "根据sequenceNbr更新")
public Object updateByFailureMaintain(@RequestBody FailureMaintainDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
try {
return ResponseHelper.buildResponse(failureMaintainServiceImpl.updateStatus(model,getSelectedOrgInfo()));
} catch (Exception e) {
return ResponseHelper.buildResponse(false);
}
}
*/
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
FailureMaintainDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FailureMaintainDto
>
page
=
new
Page
<
FailureMaintainDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
failureMaintainServiceImpl
.
queryForFailureMaintainPage
(
page
));
}
/**
* 维修列表记录查询
*根据关联主表faultId查询
* @return
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.elasticsearch.core.SearchHits
;
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.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
;
...
...
@@ -27,18 +8,25 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.NameUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -50,14 +38,14 @@ import io.swagger.annotations.ApiOperation;
@RestController
@Api
(
tags
=
"单位Api"
)
@RequestMapping
(
value
=
"/org-usr"
)
public
class
OrgUsrController
extends
BaseController
{
public
class
OrgUsrController
extends
BaseController
{
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
/**
* 新增单位信息
*
...
...
@@ -67,8 +55,8 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/save"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位信息"
,
notes
=
"新增单位信息"
)
public
ResponseModel
<?>
saveOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
)
throws
Exception
{
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
saveOrgUsr
(
OrgUsrVo
);
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
saveOrgUsr
(
OrgUsrVo
);
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
@@ -85,13 +73,13 @@ public class OrgUsrController extends BaseController {
// 删除时,只作逻辑删除
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
try
{
eSOrgUsrService
.
deleteById
(
id
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
();
}
eSOrgUsrService
.
deleteById
(
id
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
();
}
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
@@ -105,8 +93,8 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
@@ -121,7 +109,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位详情"
,
notes
=
"获取单位详情"
)
public
ResponseModel
<
OrgUsrFormDto
>
selectById
(
HttpServletRequest
request
,
@PathVariable
Long
id
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectCompanyById
(
id
));
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
selectCompanyById
(
id
));
}
...
...
@@ -135,48 +123,48 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/selectByBizOrgType/{bizOrgType}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据bizOrgType分页查询"
,
notes
=
"根据bizOrgType分页查询"
)
public
ResponseModel
<
IPage
<
OrgUsr
>>
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
@PathVariable
String
bizOrgType
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
page
(
iOrgUsrService
.
bizOrgTypeListPage
(
pageNum
,
pageSize
,
bizOrgType
)));
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
page
(
iOrgUsrService
.
bizOrgTypeListPage
(
pageNum
,
pageSize
,
bizOrgType
)));
}
/**
*
* 获取单位部门树
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(key为物理主键)"
,
notes
=
"获取单位部门树(key为物理主键)\""
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTree
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTree
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
*
* 获取单位部门树
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/orgTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(bizOrgCode为物理主键)"
,
notes
=
"获取单位部门树(bizOrgCode为物理主键)\""
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTreeCode
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyDepartmentMsg
());
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取单位部门树
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/orgTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(bizOrgCode为物理主键)"
,
notes
=
"获取单位部门树(bizOrgCode为物理主键)\""
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTreeCode
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyDepartmentMsg
());
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取单位部门树
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/org/company/tree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位树(bizOrgCode为物理主键)"
,
notes
=
"获取单位树(bizOrgCode为物理主键)"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getCompanyTree
()
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getCompanyTree
()
{
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyList
());
return
ResponseHelper
.
buildResponse
(
menus
);
}
...
...
@@ -237,7 +225,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
public
ResponseModel
<?>
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgDepartmentDto
>
OrgDepartmentVo
,
@PathVariable
Long
id
)
throws
Exception
{
iOrgUsrService
.
saveDepartment
(
OrgDepartmentVo
,
id
);
iOrgUsrService
.
saveDepartment
(
OrgDepartmentVo
,
id
);
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
@@ -250,8 +238,8 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/saveCompany"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入单位信息"
,
notes
=
"导入单位信息"
)
public
ResponseModel
<?>
saveCompany
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgUsrDto
>
OrgUsrVo
)
throws
Exception
{
iOrgUsrService
.
saveCompany
(
OrgUsrVo
);
return
ResponseHelper
.
buildResponse
(
null
);
iOrgUsrService
.
saveCompany
(
OrgUsrVo
);
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
...
...
@@ -263,10 +251,10 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{ids}/users"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>
>
selectUsersByOrgCode
(
HttpServletRequest
request
,
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPersonMsg
(
ids
))
;
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectUsersByOrgCode
(
HttpServletRequest
request
,
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPersonMsg
(
ids
));
}
/**
* 根据id获取单位人员列表
*
...
...
@@ -277,13 +265,13 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/company/{ids}/person"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
public
ResponseModel
<
List
<
CompanyPerson
>>
selectCompanyPerson
(
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPerson
(
ids
))
;
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPerson
(
ids
));
}
/**
* 根据id获取单位人员列表
*
* @param
ids
* @param
amosUserId
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -292,35 +280,94 @@ public class OrgUsrController extends BaseController {
public
ResponseModel
<
OrgUsrDto
>
selectCompany
(
@PathVariable
String
amosUserId
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getOrg
(
amosUserId
));
}
/**
* 根据名称模糊匹配
*
* @param
id
* @param
name
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配"
,
notes
=
"根据名称模糊匹配"
)
public
ResponseModel
<
List
<
ESOrgUsrDto
>>
selectById
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
/**
* 根据名称模糊匹配
*
* @param
id
* @param
name
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getListdata"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据名称模糊匹配单位"
,
notes
=
"根据名称模糊匹配单位"
)
public
ResponseModel
<
List
<
ESOrgUsrDto
>>
selectByIddata
(
HttpServletRequest
request
,
String
name
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
return
ResponseHelper
.
buildResponse
(
eSOrgUsrService
.
queryByKeys
(
name
));
}
/**
* 获取单位部门树
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTreeByUser"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人获取单位部门树"
,
notes
=
"根据登陆人获取单位部门树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTreeByUser
()
throws
Exception
{
// 获取登陆人角色
AgencyUserModel
user
=
getUserInfo
();
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyTreeByUser
(
user
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取单位部门树
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyUserTreeByUser"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人获取单位部门用户树"
,
notes
=
"根据登陆人获取单位部门用户树"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
companyUserTreeByUser
()
{
// 获取登陆人角色
AgencyUserModel
user
=
getUserInfo
();
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
companyUserTreeByUser
(
user
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取单位列表
*
* @param
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyListByUser"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据登陆人获取单位列表"
,
notes
=
"根据登陆人获取单位列表"
)
public
ResponseModel
<
List
<
OrgUsrTreeDto
>>
companyListByUser
()
{
// 获取登陆人角色
AgencyUserModel
user
=
getUserInfo
();
List
<
OrgUsrTreeDto
>
menus
=
iOrgUsrService
.
companyListByUser
(
user
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
/**
* 获取用户单位归属
*
* @param id
* @return
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/getUserUnit"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取用户单位归属"
,
notes
=
"获取用户单位归属"
)
public
ResponseModel
<
UserUnitDto
>
getUserUnit
(
@RequestParam
String
id
,
@RequestParam
String
type
,
@RequestParam
String
code
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
getUserUnit
(
id
,
type
,
code
));
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DynamicFormColumnServiceImpl.java
View file @
c19ca472
...
...
@@ -66,6 +66,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
QueryWrapper
<
DynamicFormColumn
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"group_code"
,
code
);
queryWrapper
.
eq
(
"is_delete"
,
false
);
queryWrapper
.
orderByAsc
(
"sort"
);
List
<
DynamicFormColumn
>
dynamicFormColumn
=
this
.
list
(
queryWrapper
);
List
<
DynamicFormInitDto
>
listForm
=
new
ArrayList
<
DynamicFormInitDto
>();
...
...
@@ -76,9 +77,9 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
dynamicForm
.
getFieldType
().
equals
(
"string"
)
||
dynamicForm
.
getFieldType
().
equals
(
"datetime"
)
||
dynamicForm
.
getFieldType
().
equals
(
"textarea"
)
||
dynamicForm
.
getFieldType
().
equals
(
"upload"
)
||
dynamicForm
.
getFieldType
().
equals
(
"tagging"
)
||
dynamicForm
.
getFieldType
().
equals
(
"inputBitmap"
))
{
dynamicForm
.
getFieldType
().
equals
(
"upload"
)
||
dynamicForm
.
getFieldType
().
equals
(
"tagging"
)
||
dynamicForm
.
getFieldType
().
equals
(
"inputBitmap"
))
{
DynamicFormInitDto
vo
=
new
DynamicFormInitDto
(
dynamicForm
.
getFieldCode
(),
dynamicForm
.
getFieldName
(),
dynamicForm
.
getFieldType
(),
new
SelectItems
(),
null
);
...
...
@@ -161,6 +162,20 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
vo
.
setSort
(
dynamicFormValue
.
getSort
());
listForm
.
add
(
vo
);
break
;
case
"url"
:
vo
=
new
DynamicFormInitDto
(
dynamicForm
.
getFieldCode
(),
dynamicForm
.
getFieldName
(),
dynamicForm
.
getFieldType
(),
new
SelectItems
(
new
ArrayList
<>()),
columnConfigJson
.
toJSONString
());
vo
.
setUrl
(
columnConfigJson
.
getString
(
"url"
));
dynamicFormValue
=
new
DynamicFormInstanceDto
();
BeanUtils
.
copyProperties
(
dynamicForm
,
dynamicFormValue
);
dynamicFormValue
.
setSequenceNbr
(
null
);
dynamicFormValue
.
setFormColumnId
(
dynamicForm
.
getSequenceNbr
());
dynamicFormValue
.
setAppKey
(
appKey
);
vo
.
setFormItemDescr
(
dynamicFormValue
);
vo
.
setSort
(
dynamicFormValue
.
getSort
());
listForm
.
add
(
vo
);
break
;
default
:
vo
=
new
DynamicFormInitDto
(
dynamicForm
.
getFieldCode
(),
dynamicForm
.
getFieldName
(),
dynamicForm
.
getFieldType
(),
new
SelectItems
(
new
ArrayList
<>()),
null
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureAuditServiceImpl.java
View file @
c19ca472
...
...
@@ -44,21 +44,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureAuditServiceImpl
.
class
);
/**
* 分页查询
*/
public
Page
<
FailureAuditDto
>
queryForFailureAuditPage
(
Page
<
FailureAuditDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureAuditDto
>
queryForFailureAuditList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 发起审核
...
...
@@ -75,23 +61,23 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
int
auditResult
=
0
;
Boolean
repairResult
=
null
;
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_AUDIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
auditResult
=
AuditResultEnum
.
SEND_BACK
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_SUBMIT
,
userInfo
,
condition
);
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
Boolean
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
WAITING_MAINTAIN
,
userInfo
,
condition
);
}
if
(
ObjectUtils
.
isEmpty
(
auditResult
)
)
{
if
(
!
repairResult
)
{
throw
new
Exception
(
"添加报修日志失败"
);
}
model
.
setAuditResult
(
auditResult
);
...
...
@@ -115,7 +101,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
//当前角色部门id为维修部门的时候 修改状态
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
...
...
@@ -124,19 +110,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
Long
faultId
=
model
.
getFaultId
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
// String processAuditor = model.getAuditor();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
else
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Cid
);
repairlog
(
faultId
,
processAuditorId
,
auditDepartmentId
,
processTime
,
processDepartment
,
conditionText
,
processAuditor
Name
);
}
if
(
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
)){
return
true
;
...
...
@@ -152,7 +137,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditor
Cid
)
{
String
processDepartment
,
String
processResult
,
String
processAuditor
Name
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
...
...
@@ -160,7 +145,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureDetailsServiceImpl.java
View file @
c19ca472
...
...
@@ -2,23 +2,20 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Random
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -27,9 +24,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
...
...
@@ -39,7 +33,6 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
* 服务实现类
...
...
@@ -49,507 +42,470 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
*/
@Service
public
class
FailureDetailsServiceImpl
extends
BaseService
<
FailureDetailsDto
,
FailureDetails
,
FailureDetailsMapper
>
implements
IFailureDetailsService
{
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
@Autowired
WorkflowFeignService
workflowFeignService
;
@Value
(
"${failure.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
@Autowired
FailureAuditServiceImpl
failureAuditServiceImpl
;
@Autowired
IFailureAuditService
failureAuditService
;
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
@Autowired
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
/**
* 分页查询
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> page = new Page<>(current, size);
return baseMapper.selectPage(page, wrapper);*/
Page
pages
=
new
Page
<>(
current
,
size
);
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
IPage
iPage
=
page
(
pages
,
lambdaQueryWrapper
);
Page
<
FailureDetails
>
page
=
new
Page
();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setRecords
(
iPage
.
getRecords
());
return
page
;
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
());
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
return
queryForPage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
}
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
}
/**
* 我发起分页查询
*/
public
IPage
<
FailureDetails
>
queryForPage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
if
(
submissionPid
==
null
)
{
return
null
;
}
/* QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid", submissionPid);
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return baseMapper.selectPage(failureDetailsPage, wrapper);*/
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return
page
(
pages
,
lambdaQueryWrapper
);
}
/**
* 待处理分页查询
*/
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
if
(
submissionPid
==
null
)
{
return
null
;
}
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
notIn
(
FailureDetails:
:
getCurrentStatus
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
()
).
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid", submissionPid);
wrapper.notIn("current_status", FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode(),
FailureStatuEnum.WAITING_AUDIT.getCode());
wrapper.orderByDesc("submission_time");*/
IPage
<
FailureDetails
>
failureDetailsPage
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
lambdaQueryWrapper
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 根据状态查询
*/
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
failureDetailsDto
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
return
failureDetailsDto
;
}
/**
* 根据状态查询
*/
public
List
<
FailureDetails
>
queryForFailureStatus
(
Long
currentStatus
)
{
String
status
=
new
String
();
List
<
FailureStatuEnum
>
list
=
new
ArrayList
<>();
list
.
add
(
FailureStatuEnum
.
WAITING_AUDIT
);
list
.
add
(
FailureStatuEnum
.
WAITING_SUBMIT
);
list
.
add
(
FailureStatuEnum
.
WAITING_MAINTAIN
);
list
.
add
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
);
list
.
add
(
FailureStatuEnum
.
REFUSE
);
list
.
add
(
FailureStatuEnum
.
FINISH
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
status
=
list
.
get
(
i
).
getName
();
}
;
}
/* FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{}; */
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
/**
* 查询任务状态数量
*/
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
if
(
type
.
equals
(
SELECY_ALL
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
}
int
auditStatus
=
0
;
int
submitStatus
=
0
;
int
maintainStatus
=
0
;
int
acceptanceStatus
=
0
;
int
refuseStatus
=
0
;
int
finishStatus
=
0
;
int
inMaintenance
=
0
;
List
<
FailureStatusCountDto
>
list
=
new
ArrayList
<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
List
<
String
>
statusName
=
new
ArrayList
<>();
Collections
.
addAll
(
statusName
,
FailureStatuEnum
.
WAITING_AUDIT
.
getName
(),
FailureStatuEnum
.
WAITING_SUBMIT
.
getName
(),
FailureStatuEnum
.
WAITING_MAINTAIN
.
getName
(),
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getName
(),
FailureStatuEnum
.
REFUSE
.
getName
(),
FailureStatuEnum
.
FINISH
.
getName
(),
FailureStatuEnum
.
IN_MAINTENANCE
.
getName
());
for
(
int
i
=
0
;
i
<
failureDetailsDtos
.
size
();
i
++)
{
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
()))
{
auditStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_SUBMIT
.
getCode
()))
{
submitStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_MAINTAIN
.
getCode
()))
{
maintainStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
.
getCode
()))
{
acceptanceStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
REFUSE
.
getCode
()))
{
refuseStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
FINISH
.
getCode
()))
{
finishStatus
++;
}
if
(
failureDetailsDtos
.
get
(
i
).
getCurrentStatus
().
equals
(
FailureStatuEnum
.
IN_MAINTENANCE
.
getCode
()))
{
inMaintenance
++;
}
}
int
[]
statusCount
=
{
auditStatus
,
submitStatus
,
maintainStatus
,
acceptanceStatus
,
refuseStatus
,
finishStatus
,
inMaintenance
};
for
(
int
i
=
0
;
i
<
statusName
.
size
();
i
++)
{
FailureStatusCountDto
statusCountDto
=
new
FailureStatusCountDto
();
statusCountDto
.
setStatus
(
statusName
.
get
(
i
));
statusCountDto
.
setCount
(
statusCount
[
i
]);
list
.
add
(
statusCountDto
);
}
return
list
;
}
/**
* 发起故障保修单
*
* @throws Exception
*/
@Transactional
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
jsonObject
=
workflowFeignService
.
startByVariable
(
body
);
if
(
jsonObject
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
// return CommonResponseUtil.failure("启动流程失败");
}
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
instance
==
null
)
{
// return CommonResponseUtil.failure("无提交隐患权限");
}
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
// 拿到流程processId
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
FailureDetailsDto
model
=
null
;
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureDetailsDto
.
setIsDelete
(
false
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
}
// 添加至报修日志
Long
faultId
=
model
.
getSequenceNbr
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorCid
=
userInfo
.
getRole
().
getRoleName
();
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorCid
);
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
)){
return
true
;
}
else
{
throw
new
Exception
(
"执行流程失败"
);
}
}
/**
* 添加报修日志
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
return
true
;
}
return
false
;
}
@Transactional
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
Integer
.
parseInt
(
condition
));
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeNoExecuteFromInstanceAdd
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
if
(
nextTaskId
!=
null
)
{
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
}
return
true
;
}
/**
* 已经存在的操作人的任务执行,用于维修中节点完成任务
*
* @param sequenceNbr
* @param userInfo
* @return
*/
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
())
&&
map
.
get
(
"checkFlag"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
null
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
true
;
}
public
boolean
excuteTask
(
String
procressId
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
workflowFeignService
.
pickupAndCompleteTask
(
detail
.
getString
(
"id"
),
conditionMap
);
}
}
return
true
;
}
public
Object
getNextTaskGroupName
(
String
procressId
)
{
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
String
currentRoleName
=
""
;
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
for
(
Object
object
:
taskGroupNameObject
.
getJSONArray
(
"data"
))
{
JSONObject
taskGroupNameDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
currentRoleName
=
currentRoleName
+
taskGroupNameDetail
.
getString
(
"groupId"
)
+
","
;
}
}
return
currentRoleName
;
}
public
boolean
checkExcuteTaskAuth
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
}
public
String
checkIsInMaintenance
(
Long
sequenceNbr
)
{
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
String
id
=
detail
.
getString
(
"id"
);
return
id
;
}
}
}
return
null
;
}
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
// 获取当前登录用户的角色
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"checkFlag"
,
false
);
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Long
failureEquipmentId
=
failureDetailsDto
.
getSubmissionBranchId
();
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
// 获取流程中原本设置的当前节点的执行权限
JSONArray
taskGroupNameDetail
=
taskGroupNameObject
.
getJSONArray
(
"data"
);
// 如果拿不到当前任务的执行角色,则返回校验失败
if
(
ObjectUtils
.
isEmpty
(
taskGroupNameDetail
))
{
continue
;
}
String
defaultExecutionRoleProcess
=
taskGroupNameDetail
.
getJSONObject
(
0
).
getString
(
"groupId"
);
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if
(!
defaultExecutionRoleProcess
.
equals
(
currentLoginUserRole
))
{
continue
;
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if
(
name
.
contains
(
EMERGENCY_COMMAND
))
{
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
sequenceNbr
);
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
break
;
}
}
else
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
break
;
}
}
}
}
return
map
;
}
/**
* 獲取待處理的任務數量
*
* @param userInfo
* @return
*/
public
int
getPendingCount
(
ReginParams
userInfo
)
{
int
countNum
=
0
;
// 获取当前登录人的部门id
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
// 获取同角色信息的我的待办任务
JSONObject
taskListJson
=
workflowFeignService
.
getTasksNoAuth
(
processDefinitionKey
,
userInfo
.
getUserModel
().
getUserId
());
JSONArray
taskList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
taskListJson
.
getString
(
"data"
)));
for
(
Object
i
:
taskList
)
{
JSONObject
task
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
String
procressId
=
task
.
getString
(
"processInstanceId"
);
// 通过流程ID查找当前的故障报修表ID 的信息
LambdaQueryWrapper
<
FailureDetails
>
wrapper
=
new
LambdaQueryWrapper
<
FailureDetails
>();
wrapper
.
eq
(
FailureDetails:
:
getProcessId
,
procressId
);
FailureDetails
failureDetails
=
this
.
baseMapper
.
selectOne
(
wrapper
);
// 通过故障报修单查找创建人的部门ID
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
failureDetails
.
getSequenceNbr
());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if
(
task
.
getString
(
"name"
).
contains
(
EMERGENCY_COMMAND
))
{
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
countNum
++;
break
;
}
}
else
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if
(
failureDetails
.
getFailureEquipmentId
().
intValue
()
==
seq
.
intValue
())
{
countNum
++;
break
;
}
}
}
return
countNum
;
}
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONArray
datArray
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
datArray
=
object
.
getJSONArray
(
"data"
);
}
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
if
(
datArray
!=
null
)
{
for
(
Object
i
:
datArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
// 从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
if
(
failureRepairlog
!=
null
)
{
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditorName
()
==
null
?
""
:
failureRepairlog
.
getProcessAuditorName
());
}
}
list
.
add
(
detail
);
}
implements
IFailureDetailsService
{
@Autowired
SourceFileServiceImpl
sourceFileServiceImpl
;
@Autowired
WorkflowFeignService
workflowFeignService
;
@Value
(
"${failure.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
@Autowired
FailureAuditServiceImpl
failureAuditServiceImpl
;
@Autowired
IFailureAuditService
failureAuditService
;
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
@Autowired
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交报修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
public
String
[]
roleName
=
{
""
,
""
};
/**
* 分页查询
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
Page
pages
=
new
Page
<>(
current
,
size
);
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return
page
(
pages
,
lambdaQueryWrapper
);
}
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
baseMapper
.
selectAllPage
(
page
);
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
return
baseMapper
.
selectISubPage
(
page
,
userInfo
.
getUserModel
().
getUserId
());
}
return
this
.
queryForWaitManage
(
page
,
userInfo
);
}
/**
* 我发起分页查询
*/
public
IPage
<
FailureDetails
>
queryForPage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
if
(
submissionPid
==
null
)
{
return
null
;
}
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
LambdaQueryWrapper
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return
page
(
pages
,
lambdaQueryWrapper
);
}
/**
* 待处理分页查询
*/
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
)
{
/* if (userInfo.getRole().getRoleName().equals())*/
/* if (submissionPid == null) {
return null;
}
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.notIn(FailureDetails::getCurrentStatus, FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode()
).orderByDesc(FailureDetails::getSubmissionTime);
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return baseMapper.selectPage(failureDetailsPage, lambdaQueryWrapper);*/
return
baseMapper
.
selectInProcessing
(
page
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureDetailsDto
>
queryForFailureDetailsList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 根据状态查询
*/
public
FailureDetailsDto
queryForOne
(
Long
sequenceNbr
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
failureDetailsDto
.
setCurrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
failureDetailsDto
.
getCurrentStatus
()));
List
<
SourceFile
>
sourceFiles
=
sourceFileServiceImpl
.
findBySourceId
(
sequenceNbr
);
failureDetailsDto
.
setAttachment
(
sourceFiles
);
return
failureDetailsDto
;
}
/**
* 根据状态查询
*/
public
List
<
FailureDetails
>
queryForFailureStatus
(
Long
currentStatus
)
{
String
status
=
new
String
();
List
<
FailureStatuEnum
>
list
=
new
ArrayList
<>();
list
.
add
(
FailureStatuEnum
.
WAITING_AUDIT
);
list
.
add
(
FailureStatuEnum
.
WAITING_SUBMIT
);
list
.
add
(
FailureStatuEnum
.
WAITING_MAINTAIN
);
list
.
add
(
FailureStatuEnum
.
WAITING_ACCEPTANCE
);
list
.
add
(
FailureStatuEnum
.
REFUSE
);
list
.
add
(
FailureStatuEnum
.
FINISH
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
status
=
list
.
get
(
i
).
getName
();
}
}
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
/**
* 查询任务状态数量
*/
public
List
<
CurrentStatusDto
>
queryStatusCount
()
{
List
<
StatusDto
>
statusDtos
=
baseMapper
.
selectStatusCount
();
List
<
CurrentStatusDto
>
currentStatusDtoList
=
new
ArrayList
<>();
statusDtos
.
forEach
(
e
->{
CurrentStatusDto
currentStatusDto
=
new
CurrentStatusDto
();
currentStatusDto
.
setCutrentStatusCount
(
e
.
getCurrentStatusCount
());
currentStatusDto
.
setCutrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
e
.
getCurrentStatus
()));
currentStatusDtoList
.
add
(
currentStatusDto
);
});
return
currentStatusDtoList
;
}
/**
* 发起故障保修单
*
* @throws Exception
*/
@Transactional
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
if
(
null
!=
failureDetailsDto
.
getSequenceNbr
())
{
return
updatetoModel
(
failureDetailsDto
,
userInfo
);
}
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"processDefinitionKey"
,
processDefinitionKey
);
JSONObject
jsonObject
=
workflowFeignService
.
startByVariable
(
body
);
if
(
jsonObject
==
null
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
// return CommonResponseUtil.failure("启动流程失败");
}
JSONObject
instance
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
instance
==
null
)
{
// return CommonResponseUtil.failure("无提交隐患权限");
}
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
WAITING_AUDIT
.
getCode
());
// 拿到流程processId
failureDetailsDto
.
setProcessId
(
instance
.
getString
(
"id"
));
FailureDetailsDto
model
=
null
;
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setSubmissionName
(
userInfo
.
getUserModel
().
getRealName
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
model
=
this
.
createWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
}
// 添加至报修日志
Long
faultId
=
model
.
getSequenceNbr
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorName
=
failureDetailsDto
.
getSubmissionName
();
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorName
);
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
))
{
return
true
;
}
else
{
throw
new
Exception
(
"执行流程失败"
);
}
}
/**
* 更新故障保修单
*/
public
Object
updatetoModel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
FailureDetailsDto
model
=
this
.
updateWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureDetailsDto
.
getSequenceNbr
(),
failureDetailsDto
.
getAttachment
());
}
// 添加至报修日志
Long
faultId
=
model
.
getSequenceNbr
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"重新提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorName
=
failureDetailsDto
.
getSubmissionName
();
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorName
);
if
(
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
null
))
{
return
true
;
}
else
{
throw
new
Exception
(
"执行流程失败"
);
}
}
/**
* 添加报修日志
*/
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorName
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessDepartmentId
(
departmentId
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorName
(
processAuditorName
);
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
return
true
;
}
return
false
;
}
@Transactional
public
boolean
excuteTask
(
Long
sequenceNbr
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
Integer
.
parseInt
(
condition
));
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
if
(
map
.
get
(
"name"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeNoExecuteFromInstanceAdd
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
else
{
workflowFeignService
.
pickupAndCompleteTask
(
map
.
get
(
"taskId"
).
toString
(),
conditionMap
);
}
// 判断下一个节点是不是维修中,如果是则添加当前任务的执行人
String
nextTaskId
=
checkIsInMaintenance
(
sequenceNbr
);
if
(
nextTaskId
!=
null
)
{
workflowFeignService
.
pickuptask
(
nextTaskId
);
}
}
return
true
;
}
/**
* 已经存在的操作人的任务执行,用于维修中节点完成任务
*
* @param sequenceNbr
* @param userInfo
* @return
*/
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
try
{
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
())
&&
map
.
get
(
"checkFlag"
).
toString
().
startsWith
(
PROCESS_NAME
[
4
]))
{
workflowFeignService
.
completeByVariable
(
map
.
get
(
"taskId"
).
toString
(),
null
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
false
;
}
return
true
;
}
public
boolean
excuteTask
(
String
procressId
,
ReginParams
userInfo
,
String
condition
)
throws
Exception
{
HashMap
<
String
,
Object
>
conditionMap
=
new
HashMap
<
String
,
Object
>();
conditionMap
.
put
(
"condition"
,
condition
);
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
workflowFeignService
.
pickupAndCompleteTask
(
detail
.
getString
(
"id"
),
conditionMap
);
}
}
return
true
;
}
public
Object
getNextTaskGroupName
(
String
procressId
)
{
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
String
currentRoleName
=
""
;
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
for
(
Object
object
:
taskGroupNameObject
.
getJSONArray
(
"data"
))
{
JSONObject
taskGroupNameDetail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
object
));
currentRoleName
=
currentRoleName
+
taskGroupNameDetail
.
getString
(
"groupId"
)
+
","
;
}
}
return
currentRoleName
;
}
public
boolean
checkExcuteTaskAuth
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
return
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
());
}
public
String
checkIsInMaintenance
(
Long
sequenceNbr
)
{
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
String
id
=
detail
.
getString
(
"id"
);
return
id
;
}
}
}
return
null
;
}
public
Map
<
String
,
Object
>
checkExcuteTaskAuthMap
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
// 获取当前登录用户的角色
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"checkFlag"
,
false
);
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
sequenceNbr
);
// 获取送达部门的ID
Long
failureEquipmentId
=
failureDetailsDto
.
getSubmissionBranchId
();
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
JSONArray
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
JSONObject
taskGroupNameObject
=
workflowFeignService
.
getTaskGroupName
(
detail
.
getString
(
"id"
));
// 获取流程中原本设置的当前节点的执行权限
JSONArray
taskGroupNameDetail
=
taskGroupNameObject
.
getJSONArray
(
"data"
);
// 如果拿不到当前任务的执行角色,则返回校验失败
if
(
ObjectUtils
.
isEmpty
(
taskGroupNameDetail
))
{
continue
;
}
String
defaultExecutionRoleProcess
=
taskGroupNameDetail
.
getJSONObject
(
0
).
getString
(
"groupId"
);
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if
(!
defaultExecutionRoleProcess
.
equals
(
currentLoginUserRole
))
{
continue
;
}
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if
(
name
.
contains
(
EMERGENCY_COMMAND
))
{
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
sequenceNbr
);
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
break
;
}
}
else
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if
(
failureEquipmentId
.
intValue
()
==
seq
.
intValue
())
{
map
.
put
(
"taskId"
,
detail
.
getString
(
"id"
));
map
.
put
(
"checkFlag"
,
true
);
map
.
put
(
"name"
,
detail
.
getString
(
"name"
));
break
;
}
}
}
}
return
map
;
}
/**
* 獲取待處理的任務數量
*
* @param userInfo
* @return
*/
public
int
getPendingCount
(
ReginParams
userInfo
)
{
int
countNum
=
0
;
// 获取当前登录人的部门id
Long
seq
=
userInfo
.
getDepartment
().
getSequenceNbr
();
// 获取同角色信息的我的待办任务
JSONObject
taskListJson
=
workflowFeignService
.
getTasksNoAuth
(
processDefinitionKey
,
userInfo
.
getUserModel
().
getUserId
());
JSONArray
taskList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
taskListJson
.
getString
(
"data"
)));
for
(
Object
i
:
taskList
)
{
JSONObject
task
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
String
procressId
=
task
.
getString
(
"processInstanceId"
);
// 通过流程ID查找当前的故障报修表ID 的信息
LambdaQueryWrapper
<
FailureDetails
>
wrapper
=
new
LambdaQueryWrapper
<
FailureDetails
>();
wrapper
.
eq
(
FailureDetails:
:
getProcessId
,
procressId
);
FailureDetails
failureDetails
=
this
.
baseMapper
.
selectOne
(
wrapper
);
// 通过故障报修单查找创建人的部门ID
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByFaultId
(
failureDetails
.
getSequenceNbr
());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if
(
task
.
getString
(
"name"
).
contains
(
EMERGENCY_COMMAND
))
{
Long
auditDepartmentId
=
failureRepairlog
.
getProcessDepartmentId
();
if
(
auditDepartmentId
.
intValue
()
==
seq
.
intValue
())
{
countNum
++;
break
;
}
}
else
{
// 判断当前节点任务属于送达部门节点时需要判断当前登录人所在的部门id是否与表单发起时设置的送达部门一致
if
(
failureDetails
.
getFailureEquipmentId
().
intValue
()
==
seq
.
intValue
())
{
countNum
++;
break
;
}
}
}
return
countNum
;
}
public
Object
getCurrentProcessHistoryTask
(
Long
id
)
{
FailureDetailsDto
failureDetailsDto
=
this
.
queryBySeq
(
id
);
String
processId
=
failureDetailsDto
.
getProcessId
();
JSONObject
object
=
workflowFeignService
.
queryHistoryTaskListByProcessId
(
processId
);
JSONArray
datArray
=
null
;
if
(
ObjectUtils
.
isNotEmpty
(
object
))
{
datArray
=
object
.
getJSONArray
(
"data"
);
}
List
<
Object
>
list
=
new
ArrayList
<
Object
>();
if
(
datArray
!=
null
)
{
for
(
Object
i
:
datArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
if
(
detail
.
containsKey
(
"operator"
)
&&
!
detail
.
getString
(
"name"
).
contains
(
"维修中"
))
{
// 从流程记录表中拿到处理人的名称
FailureRepairlog
failureRepairlog
=
failureRepairlogService
.
findByprocessAuditor
(
detail
.
getString
(
"operator"
));
if
(
failureRepairlog
!=
null
)
{
detail
.
replace
(
"operator"
,
failureRepairlog
.
getProcessAuditorName
()
==
null
?
""
:
failureRepairlog
.
getProcessAuditorName
());
}
}
list
.
add
(
detail
);
}
// datArray.stream().forEach(i -> {
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
...
...
@@ -560,99 +516,99 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// list.add(detail);
// }
// });
}
return
list
;
}
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
result
+=
random
.
nextInt
(
10
);
}
return
newDate
+
result
;
}
/**
* 获取当前登录人能够操作的任务执行Button类型
*
* @param sequenceNbr
* @param userInfo
* @return
*/
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
int
flag
=
0
;
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
// 提交维修单
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
// 审核
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
}
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
// 维修
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
// 验收
flag
=
5
;
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
}
}
return
flag
;
}
public
Object
getCurrentTask
(
Long
sequenceNbr
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<
Map
<
String
,
String
>>();
JSONArray
taskDetailArray
=
null
;
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
name
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
String
id
=
detail
.
getString
(
"id"
);
JSONObject
assignObject
=
workflowFeignService
.
getTaskAssign
(
id
);
JSONObject
resultObject
=
assignObject
.
getJSONObject
(
"data"
);
if
(
resultObject
!=
null
)
{
map
.
put
(
"name"
,
"维修部门维修人员 维修"
);
if
(
detail
.
containsKey
(
"informerList"
))
{
JSONArray
informerList
=
detail
.
getJSONArray
(
"informerList"
);
if
(
informerList
!=
null
&&
informerList
.
size
()
>
0
)
{
for
(
Object
informerDetail
:
informerList
)
{
JSONObject
informerDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
informerDetail
));
if
(
informerDetailJson
.
getString
(
"userName"
)
.
equals
(
resultObject
.
getString
(
"assignee"
)))
{
map
.
put
(
"assignee"
,
informerDetailJson
.
getString
(
"realName"
));
break
;
}
}
}
}
}
}
list
.
add
(
map
);
}
}
return
list
;
}
}
return
list
;
}
public
static
String
buildOrderNo
()
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
newDate
=
sdf
.
format
(
new
Date
());
String
result
=
""
;
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
result
+=
random
.
nextInt
(
10
);
}
return
newDate
+
result
;
}
/**
* 获取当前登录人能够操作的任务执行Button类型
*
* @param sequenceNbr
* @param userInfo
* @return
*/
public
Integer
getExcuteTaskAuthButton
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
int
flag
=
0
;
Map
<
String
,
Object
>
map
=
this
.
checkExcuteTaskAuthMap
(
sequenceNbr
,
userInfo
);
if
(
Boolean
.
parseBoolean
(
map
.
get
(
"checkFlag"
).
toString
()))
{
String
buttonValueString
=
map
.
get
(
"name"
).
toString
();
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
0
]))
{
// 提交维修单
flag
=
1
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
1
]))
{
// 审核
flag
=
2
;
if
(
buttonValueString
.
startsWith
(
PROCESS_NAME
[
2
]))
{
flag
=
3
;
}
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
2
]))
{
// 维修
flag
=
4
;
}
else
if
(
buttonValueString
.
endsWith
(
PROCESS_NAME
[
3
]))
{
// 验收
flag
=
5
;
}
}
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
JSONObject
object
=
workflowFeignService
.
queryHistoryTasksByProcessInstanceId
(
details
.
getProcessId
());
JSONArray
array
=
object
.
getJSONArray
(
"rows"
);
for
(
Object
historyDetail
:
array
)
{
JSONObject
historyDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
historyDetail
));
if
(
"rejected"
.
equals
(
historyDetailJson
.
getString
(
"activityId"
)))
{
flag
=
6
;
}
}
return
flag
;
}
public
Object
getCurrentTask
(
Long
sequenceNbr
)
{
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<
Map
<
String
,
String
>>();
JSONArray
taskDetailArray
=
null
;
FailureDetails
details
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
String
procressId
=
details
.
getProcessId
();
JSONObject
teskObject
=
workflowFeignService
.
getTaskList
(
procressId
);
if
(
ObjectUtils
.
isNotEmpty
(
teskObject
))
{
taskDetailArray
=
teskObject
.
getJSONArray
(
"data"
);
for
(
Object
obj
:
taskDetailArray
)
{
JSONObject
detail
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
name
=
detail
.
getString
(
"name"
);
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
name
);
if
(
name
.
startsWith
(
PROCESS_NAME
[
4
]))
{
String
id
=
detail
.
getString
(
"id"
);
JSONObject
assignObject
=
workflowFeignService
.
getTaskAssign
(
id
);
JSONObject
resultObject
=
assignObject
.
getJSONObject
(
"data"
);
if
(
resultObject
!=
null
)
{
map
.
put
(
"name"
,
"维修部门维修人员 维修"
);
if
(
detail
.
containsKey
(
"informerList"
))
{
JSONArray
informerList
=
detail
.
getJSONArray
(
"informerList"
);
if
(
informerList
!=
null
&&
informerList
.
size
()
>
0
)
{
for
(
Object
informerDetail
:
informerList
)
{
JSONObject
informerDetailJson
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
informerDetail
));
if
(
informerDetailJson
.
getString
(
"userName"
)
.
equals
(
resultObject
.
getString
(
"assignee"
)))
{
map
.
put
(
"assignee"
,
informerDetailJson
.
getString
(
"realName"
));
break
;
}
}
}
}
}
}
list
.
add
(
map
);
}
}
return
list
;
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureMaintainServiceImpl.java
View file @
c19ca472
...
...
@@ -76,8 +76,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
WorkflowFeignService
workflowFeignService
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
int
MAINTENANCE_COMPLETE
=
0
;
...
...
@@ -86,25 +84,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
/**
* 分页查询
*/
public
Page
<
FailureMaintainDto
>
queryForFailureMaintainPage
(
Page
<
FailureMaintainDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
FailureMaintainDto
>
queryForFailureMaintainList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 添加维修记录
...
...
@@ -132,10 +112,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
...
...
@@ -179,10 +159,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
...
...
@@ -195,55 +175,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
return
true
;
}
/**
* 根据审核结果更新维修表
*/
public
Boolean
updateModel
(
FailureMaintainDto
failureMaintainDto
,
ReginParams
userInfo
)
throws
Exception
{
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureMaintainDto
.
getFaultId
(),
userInfo
);
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
failureMaintainDto
.
getFaultId
());
if
(
result
)
{
this
.
updateWithModel
(
failureMaintainDto
);
// 根据status修改状态
String
processResult
=
new
String
();
String
condition
=
failureMaintainDto
.
getCondition
();
int
conditionStatus
=
Integer
.
parseInt
(
condition
);
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
()
==
failureDetailsDto
.
getBizCode
())
{
// 同意状态为已完结
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
AGREE
.
getCode
())
{
// 同意状态为已完结
failureDetailsDto
.
setCurrentStatus
(
failureDetailsDto
.
getCurrentStatus
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
0
];
}
else
if
(
conditionStatus
==
AuditResultEnum
.
REFUSE
.
getCode
()){
// 不同意状态为已拒绝
failureDetailsDto
.
setCurrentStatus
(
FailureStatuEnum
.
REFUSE
.
getCode
());
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
processResult
=
PROCESS_RESULT
[
1
];
}
// 添加报修日志
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditorCid
=
userInfo
.
getRole
().
getRoleName
();
Boolean
repairlog
=
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditorCid
);
if
(
ObjectUtils
.
isEmpty
(
repairlog
)){
throw
new
RuntimeException
(
"验收添加报修日志出错"
);
}
if
(
failureDetailsService
.
excuteTask
(
failureMaintainDto
.
getFaultId
(),
userInfo
,
condition
)){
return
true
;
}
else
{
throw
new
RuntimeException
(
"验收执行流程失败"
);
}
}
return
false
;
}
/**
* 根据FaultId查询
...
...
@@ -273,9 +204,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
* 添加报修日志
*/
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorName
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
...
...
@@ -284,7 +213,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/FailureVerifyServiceImpl.java
View file @
c19ca472
...
...
@@ -66,33 +66,21 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
}
Boolean
repairResult
=
null
;
//根据验收的结果进行业务操作
/* if (condition == AuditResultEnum.AGREE.getCode() ) {
verifyResult = AuditResultEnum.AGREE.getCode();
Boolean repairResult = updateStatus(model, FailureStatuEnum.WAITING_ACCEPTANCE, userInfo, condition);
} else*/
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
/*else if (condition == (AuditResultEnum.SEND_BACK.getCode())) {
verifyResult = AuditResultEnum.SEND_BACK.getCode();
Boolean repairResult = updateStatus(model, FailureStatuEnum.WAITING_SUBMIT, userInfo, condition);
} */
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
verifyResult
=
AuditResultEnum
.
AGREE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
}
model
.
setVerifyResult
(
verifyResult
);
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
/* if (byfaultId.size() == 0) {
this.createWithModel(model);
} else {*/
this
.
createWithModel
(
model
);
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
,
condition
+
""
))
{
throw
new
Exception
(
"执行流程失败"
);
}
/* }*/
return
true
;
}
...
...
@@ -154,7 +142,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processVerifyorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processVerifyorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
...
...
@@ -166,7 +154,6 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
* 根据FaultId查询
*/
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureVerify
>
page
=
new
Page
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
c19ca472
...
...
@@ -11,15 +11,18 @@ import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.UserRolesEnum
;
import
com.yeejoin.amos.boot.module.common.api.feign.SupervisionFeign
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -27,13 +30,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import
javax.annotation.Resource
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -45,468 +42,468 @@ import java.util.stream.Collectors;
@Service
public
class
OrgUsrServiceImpl
extends
BaseService
<
OrgUsrDto
,
OrgUsr
,
OrgUsrMapper
>
implements
IOrgUsrService
{
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
@Autowired
DynamicFormColumnServiceImpl
alertFormServiceImpl
;
@Resource
OrgUsrMapper
orgUsrMapper
;
@Autowired
SupervisionFeign
supervisionFeign
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
@Override
public
String
selectUpUnitByParam
(
String
id
)
{
return
this
.
baseMapper
.
selectUpUnitByParam
(
id
);
}
public
static
List
<
OrgMenuDto
>
buildTreeParallel
(
List
<
OrgUsr
>
list
)
{
List
<
OrgMenuDto
>
menuList
=
list
.
stream
().
map
(
o
->
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
(),
ObjectUtils
.
isEmpty
(
o
.
getParentId
())
?
0L
:
Long
.
valueOf
(
o
.
getParentId
()),
o
.
getBizOrgType
(),
false
,
o
.
getBizOrgCode
());
return
menu
;
}).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
result
=
new
ArrayList
<>();
Map
<
Long
,
OrgMenuDto
>
map
=
new
HashMap
<>(
menuList
.
size
());
menuList
.
forEach
(
e
->
map
.
put
(
e
.
getKey
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
OrgMenuDto
>>
entries
=
map
.
entrySet
();
entries
.
parallelStream
().
forEach
(
entry
->
{
OrgMenuDto
value
=
entry
.
getValue
();
if
(
value
!=
null
)
{
OrgMenuDto
treeDto
=
map
.
get
(
value
.
getParentId
());
if
(
treeDto
!=
null
)
{
List
<
OrgMenuDto
>
children
=
treeDto
.
getChildren
();
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
treeDto
.
setChildren
(
children
);
}
children
.
add
(
value
);
}
else
{
result
.
add
(
value
);
}
}
});
return
result
;
}
@Override
public
List
<
OrgMenuDto
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
List
<
OrgMenuDto
>
resultList
=
new
ArrayList
<>();
Class
<?>
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
// 获取顶层元素集合
Long
parentId
;
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
!
ObjectUtils
.
isEmpty
(
PARENTIDMethodNameme
.
invoke
(
entity
))
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
@Autowired
DynamicFormColumnServiceImpl
alertFormServiceImpl
;
@Resource
OrgUsrMapper
orgUsrMapper
;
@Autowired
SupervisionFeign
supervisionFeign
;
@Autowired
ESOrgUsrService
eSOrgUsrService
;
@Override
public
String
selectUpUnitByParam
(
String
id
)
{
return
this
.
baseMapper
.
selectUpUnitByParam
(
id
);
}
public
static
List
<
OrgMenuDto
>
buildTreeParallel
(
List
<
OrgUsr
>
list
)
{
List
<
OrgMenuDto
>
menuList
=
list
.
stream
().
map
(
o
->
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
o
.
getSequenceNbr
(),
o
.
getBizOrgName
(),
ObjectUtils
.
isEmpty
(
o
.
getParentId
())
?
0L
:
Long
.
valueOf
(
o
.
getParentId
()),
o
.
getBizOrgType
(),
false
,
o
.
getBizOrgCode
());
return
menu
;
}).
collect
(
Collectors
.
toList
());
List
<
OrgMenuDto
>
result
=
new
ArrayList
<>();
Map
<
Long
,
OrgMenuDto
>
map
=
new
HashMap
<>(
menuList
.
size
());
menuList
.
forEach
(
e
->
map
.
put
(
e
.
getKey
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
OrgMenuDto
>>
entries
=
map
.
entrySet
();
entries
.
parallelStream
().
forEach
(
entry
->
{
OrgMenuDto
value
=
entry
.
getValue
();
if
(
value
!=
null
)
{
OrgMenuDto
treeDto
=
map
.
get
(
value
.
getParentId
());
if
(
treeDto
!=
null
)
{
List
<
OrgMenuDto
>
children
=
treeDto
.
getChildren
();
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
treeDto
.
setChildren
(
children
);
}
children
.
add
(
value
);
}
else
{
result
.
add
(
value
);
}
}
});
return
result
;
}
@Override
public
List
<
OrgMenuDto
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
List
<
OrgMenuDto
>
resultList
=
new
ArrayList
<>();
Class
<?>
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
// 获取顶层元素集合
Long
parentId
;
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
!
ObjectUtils
.
isEmpty
(
PARENTIDMethodNameme
.
invoke
(
entity
))
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
// if (parentId == null || topId ==parentId ) {
// OrgMenuDto menu = new OrgMenuDto(Long.valueOf(String.valueOf(IDMethodNameme.invoke(entity))),
// String.valueOf(NAMEMethodNameme.invoke(entity)), parentId,
// String.valueOf(OrgTypeMethodNameme.invoke(entity)), false);
// resultList.add(menu);
// }
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start******************************/
if
(
parentId
==
null
)
{
//topId与parentId的等值判断,修改人陈浩 on 2021/07/21
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
resultList
.
add
(
menu
);
}
else
if
(
topId
!=
null
&&
topId
.
longValue
()
==
parentId
.
longValue
())
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
resultList
.
add
(
menu
);
}
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---end******************************/
}
// 获取每个顶层元素的子数据集合
for
(
OrgMenuDto
entity
:
resultList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
}
return
resultList
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
OrgMenuDto
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
List
<
OrgMenuDto
>
childList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Long
parentId
;
// 子集的直接子对象
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
!
ObjectUtils
.
isEmpty
(
PARENTIDMethodNameme
.
invoke
(
entity
))
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
if
(
parentId
==
null
)
{
if
(
topId
==
parentId
)
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
childList
.
add
(
menu
);
}
}
else
{
if
(
topId
.
longValue
()
==
parentId
.
longValue
())
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
childList
.
add
(
menu
);
}
}
}
// 子集的间接子对象
for
(
OrgMenuDto
entity
:
childList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
if
(
entity
.
getChildren
()
!=
null
)
{
entity
.
setLeaf
(
false
);
}
}
// 递归退出条件
if
(
childList
.
size
()
==
0
)
{
return
null
;
}
return
childList
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
returnCompanyPersonMsg
(
List
<
Long
>
ids
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
companyPersonMsg
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
// 查询出单位基本信息
OrgUsr
company
=
getById
(
ids
.
get
(
i
));
resultMap
.
put
(
"id"
,
company
.
getSequenceNbr
());
// 上级单位
resultMap
.
put
(
"upUnit"
,
selectUpUnitByParam
(
company
.
getSequenceNbr
()
+
""
));
// 当前单位
resultMap
.
put
(
"currentUnit"
,
company
.
getBizOrgName
());
// 下级单位
Map
<
String
,
Object
>
downUnitColumnMap
=
new
HashMap
<>();
downUnitColumnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
downUnitColumnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
downUnitColumnMap
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
QueryWrapper
<
OrgUsr
>
downUnitWrapper
=
new
QueryWrapper
<
OrgUsr
>();
downUnitWrapper
.
allEq
(
downUnitColumnMap
);
List
<
OrgUsr
>
downList
=
list
(
downUnitWrapper
);
if
(
downList
.
size
()
==
0
)
{
resultMap
.
put
(
"downUnit"
,
false
);
}
else
{
resultMap
.
put
(
"downUnit"
,
true
);
}
// 人员数量
Map
<
String
,
Object
>
countPerson
=
new
HashMap
<>();
countPerson
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
countPerson
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
QueryWrapper
<
OrgUsr
>
personNumWrapper
=
new
QueryWrapper
<
OrgUsr
>();
personNumWrapper
.
allEq
(
countPerson
);
int
personNum
=
count
(
personNumWrapper
);
resultMap
.
put
(
"personNum"
,
personNum
);
if
(
0
==
personNum
)
{
continue
;
}
List
<
Map
<
String
,
Object
>>
personList
=
new
ArrayList
<>();
// 查询动态表单Phone
Map
<
String
,
Object
>
phone
=
new
HashMap
<>();
phone
.
put
(
"instance_id"
,
company
.
getSequenceNbr
());
phone
.
put
(
"field_code"
,
"companyPhone"
);
QueryWrapper
<
DynamicFormInstance
>
phoneWrapper
=
new
QueryWrapper
<
DynamicFormInstance
>();
phoneWrapper
.
allEq
(
phone
);
DynamicFormInstance
phoneValue
=
alertFormValueServiceImpl
.
getOne
(
phoneWrapper
);
if
(
phoneValue
==
null
)
{
resultMap
.
put
(
"tel"
,
""
);
}
else
{
resultMap
.
put
(
"tel"
,
phoneValue
.
getFieldValue
());
}
// 获取单位人员列表信息
personList
=
listPerson
(
company
.
getSequenceNbr
()
+
""
).
stream
().
map
(
p
->
{
Map
<
String
,
Object
>
person
=
new
HashMap
<>();
person
.
put
(
"tel"
,
getValue
(
p
.
get
(
"telephone"
),
null
));
person
.
put
(
"img"
,
getValue
(
p
.
get
(
"personImg"
),
null
));
person
.
put
(
"id"
,
getValue
(
p
.
get
(
"sequenceNbr"
),
null
));
person
.
put
(
"name"
,
getValue
(
p
.
get
(
"bizOrgName"
),
null
));
person
.
put
(
"zhiwei"
,
getValue
(
p
.
get
(
"administrativePositionCode"
),
null
));
person
.
put
(
"unit"
,
getValue
(
p
.
get
(
"fireManagementPostCode"
),
null
));
return
person
;
}).
collect
(
Collectors
.
toList
());
resultMap
.
put
(
"children"
,
personList
);
companyPersonMsg
.
add
(
resultMap
);
}
return
companyPersonMsg
;
}
private
Object
getValue
(
Object
obj
,
Object
defaultValue
)
{
return
ObjectUtils
.
isEmpty
(
obj
)
?
defaultValue
:
obj
;
}
public
List
<
Map
<
String
,
Object
>>
listPerson
(
String
parentId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
OrgPersonEnum
.
人员
.
getCode
()));
map
.
put
(
"bizOrgType"
,
OrgPersonEnum
.
人员
.
getKey
());
map
.
put
(
"parentId"
,
parentId
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonAllList
(
map
);
return
list
==
null
?
new
ArrayList
<
Map
<
String
,
Object
>>()
:
list
;
}
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
req
)
{
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bizOrgType"
,
OrgPersonEnum
.
人员
.
getKey
());
if
(!
ObjectUtils
.
isEmpty
(
req
.
get
(
"bizOrgName"
)))
{
map
.
put
(
"bizOrgName"
,
req
.
get
(
"bizOrgName"
));
}
OrgUsr
parent
=
this
.
getById
(
Long
.
valueOf
(
req
.
get
(
"parentId"
).
toString
()));
map
.
put
(
"bizOrgCode"
,
ObjectUtils
.
isEmpty
(
parent
)
?
null
:
parent
.
getBizOrgCode
());
req
.
remove
(
"bizOrgName"
);
req
.
remove
(
"pageSize"
);
req
.
remove
(
"pageNum"
);
req
.
remove
(
"parentId"
);
map
.
put
(
"fieldsValue"
,
req
);
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
OrgPersonEnum
.
人员
.
getCode
()));
pageBean
.
setTotal
(
this
.
baseMapper
.
selectPersonListCount
(
map
));
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
map
.
put
(
"pageSize"
,
pageBean
.
getSize
());
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonList
(
map
);
pageBean
.
setRecords
(
list
);
return
pageBean
;
}
@Override
public
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
{
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
<>();
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
if
(
alertFormValue
.
getFieldValue
()
!=
null
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
else
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValueLabel
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
}
return
formValue
;
}
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
<>();
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
return
formValue
;
}
@Override
public
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
{
if
(
oriOrgUsr
.
getParentId
()
!=
oriOrgUsr
.
getParentId
())
{
OrgUsr
parent
=
getById
(
orgUsr
.
getParentId
());
if
(
parent
!=
null
&&
!
ObjectUtils
.
isEmpty
(
parent
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
updateChildOrgCode
(
oriOrgUsr
.
getBizOrgCode
(),
orgUsr
.
getBizOrgCode
());
orgUsr
.
setParentId
(
oriOrgUsr
.
getParentId
());
}
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecDate
(
new
Date
());
orgUsr
.
setRecUserId
(
me
.
getUserId
());
orgUsr
.
setRecUserName
(
me
.
getRealName
());
updateById
(
orgUsr
);
}
private
void
updateChildOrgCode
(
String
oriOrgCode
,
String
targetOrgCode
)
{
List
<
OrgUsr
>
list
=
queryOrgUsrList
(
oriOrgCode
);
if
(
ObjectUtils
.
isEmpty
(
list
))
{
return
;
}
list
.
forEach
(
action
->
{
action
.
setBizOrgCode
(
action
.
getBizOrgCode
().
replace
(
oriOrgCode
,
targetOrgCode
));
updateById
(
action
);
});
}
public
List
<
OrgUsr
>
queryOrgUsrList
(
String
bizOrgCode
)
{
return
this
.
baseMapper
.
queryOrgUsrListByBizOrgCode
(
bizOrgCode
);
}
@Override
public
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
{
orgUsr
.
setRecDate
(
new
Date
());
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserId
(
user
.
getUserId
());
// 单位新增情况
save
(
orgUsr
);
// 填充主键
alertFromValuelist
.
stream
().
forEach
(
alertFromValue
->
{
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
alertFromValue
.
setGroupCode
(
OrgPersonEnum
.
公司
.
getCode
());
}
else
if
(
OrgPersonEnum
.
部门
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
alertFromValue
.
setGroupCode
(
OrgPersonEnum
.
部门
.
getCode
());
}
alertFromValue
.
setInstanceId
(
orgUsr
.
getSequenceNbr
());
});
// 保存动态表单数据
alertFormValueServiceImpl
.
saveBatch
(
alertFromValuelist
);
OrgUsrFormDto
formDto
=
this
.
selectCompanyById
(
orgUsr
.
getSequenceNbr
());
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
supervisionFeign
.
asyncOwner
(
formDto
);
}
}
@Override
public
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
{
// 填充主键
fromValueList
.
forEach
(
alertFromValue
->
{
alertFromValue
.
setInstanceId
(
instanceId
);
});
List
<
DynamicFormInstanceDto
>
formList
=
alertFormValueServiceImpl
.
queryByCalledId
(
instanceId
);
Map
<
Long
,
DynamicFormInstanceDto
>
resourceMap
=
new
HashMap
<>();
Map
<
Long
,
DynamicFormInstance
>
newResourceMap
=
new
HashMap
<>();
formList
.
parallelStream
().
forEach
(
form
->
{
resourceMap
.
put
(
form
.
getFormColumnId
(),
form
);
});
List
<
DynamicFormInstance
>
updateList
=
new
ArrayList
<>();
List
<
DynamicFormInstance
>
addList
=
new
ArrayList
<>();
List
<
Long
>
deleteList
=
new
ArrayList
<>();
fromValueList
.
parallelStream
().
forEach
(
submitFormItem
->
{
if
(
resourceMap
.
containsKey
(
submitFormItem
.
getFormColumnId
()))
{
DynamicFormInstanceDto
oldForm
=
resourceMap
.
get
(
submitFormItem
.
getFormColumnId
());
submitFormItem
.
setSequenceNbr
(
oldForm
.
getSequenceNbr
());
updateList
.
add
(
submitFormItem
);
}
else
{
addList
.
add
(
submitFormItem
);
}
newResourceMap
.
put
(
submitFormItem
.
getFormColumnId
(),
submitFormItem
);
});
newResourceMap
.
keySet
().
parallelStream
().
forEach
(
form
->
{
resourceMap
.
remove
(
form
);
});
resourceMap
.
keySet
().
parallelStream
().
forEach
(
action
->
{
deleteList
.
add
(
resourceMap
.
get
(
action
).
getSequenceNbr
());
});
if
(
deleteList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
deleteBatchSeq
(
deleteList
);
}
if
(
updateList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
updateBatchById
(
updateList
);
}
if
(
addList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
saveBatch
(
addList
);
}
}
@Override
public
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
{
QueryWrapper
<
DynamicFormColumn
>
queryWrapper
=
new
QueryWrapper
<
DynamicFormColumn
>();
queryWrapper
.
eq
(
"group_code"
,
OrgPersonEnum
.
人员
.
getCode
());
List
<
DynamicFormColumn
>
alertForms
=
alertFormServiceImpl
.
list
(
queryWrapper
);
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
=
Bean
.
BeantoMap
(
orgUsr
);
result
.
put
(
"parenName"
,
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
// 放入所有动态表单数据
for
(
DynamicFormColumn
alertForm
:
alertForms
)
{
result
.
put
(
alertForm
.
getFieldCode
(),
null
);
}
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
result
.
put
(
alertFormValue
.
getFieldCode
(),
ObjectUtils
.
isEmpty
(
alertFormValue
.
getFieldValueLabel
())
?
alertFormValue
.
getFieldValue
()
:
alertFormValue
.
getFieldValueLabel
());
}
return
result
;
}
@Override
public
List
<
OrgUsr
>
selectCompanyDepartmentMsg
()
{
List
<
OrgUsr
>
list
=
this
.
baseMapper
.
selectCompanyDepartmentMsg
();
if
(
list
==
null
)
{
return
new
ArrayList
<>();
}
list
=
list
.
stream
().
filter
(
o
->
!
ObjectUtils
.
isEmpty
(
o
)).
collect
(
Collectors
.
toList
());
return
list
;
}
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start******************************/
if
(
parentId
==
null
)
{
//topId与parentId的等值判断,修改人陈浩 on 2021/07/21
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
resultList
.
add
(
menu
);
}
else
if
(
topId
!=
null
&&
topId
.
longValue
()
==
parentId
.
longValue
())
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
resultList
.
add
(
menu
);
}
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---end******************************/
}
// 获取每个顶层元素的子数据集合
for
(
OrgMenuDto
entity
:
resultList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
}
return
resultList
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
OrgMenuDto
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
List
<
OrgMenuDto
>
childList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
switch
(
IDHierarchy
)
{
case
1
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
case
2
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
case
3
:
IDMethodNameme
=
clazz
.
getSuperclass
().
getSuperclass
().
getDeclaredMethod
(
IDMethodName
);
break
;
default
:
IDMethodNameme
=
clazz
.
getDeclaredMethod
(
IDMethodName
);
break
;
}
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Long
parentId
;
// 子集的直接子对象
for
(
Object
ob
:
entityList
)
{
Object
entity
=
clazz
.
cast
(
ob
);
parentId
=
!
ObjectUtils
.
isEmpty
(
PARENTIDMethodNameme
.
invoke
(
entity
))
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
if
(
parentId
==
null
)
{
if
(
topId
==
parentId
)
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
childList
.
add
(
menu
);
}
}
else
{
if
(
topId
.
longValue
()
==
parentId
.
longValue
())
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
childList
.
add
(
menu
);
}
}
}
// 子集的间接子对象
for
(
OrgMenuDto
entity
:
childList
)
{
entity
.
setChildren
(
getSub
(
entity
.
getKey
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
));
if
(
entity
.
getChildren
()
!=
null
)
{
entity
.
setLeaf
(
false
);
}
}
// 递归退出条件
if
(
childList
.
size
()
==
0
)
{
return
null
;
}
return
childList
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
returnCompanyPersonMsg
(
List
<
Long
>
ids
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
companyPersonMsg
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
// 查询出单位基本信息
OrgUsr
company
=
getById
(
ids
.
get
(
i
));
resultMap
.
put
(
"id"
,
company
.
getSequenceNbr
());
// 上级单位
resultMap
.
put
(
"upUnit"
,
selectUpUnitByParam
(
company
.
getSequenceNbr
()
+
""
));
// 当前单位
resultMap
.
put
(
"currentUnit"
,
company
.
getBizOrgName
());
// 下级单位
Map
<
String
,
Object
>
downUnitColumnMap
=
new
HashMap
<>();
downUnitColumnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
downUnitColumnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
downUnitColumnMap
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
QueryWrapper
<
OrgUsr
>
downUnitWrapper
=
new
QueryWrapper
<
OrgUsr
>();
downUnitWrapper
.
allEq
(
downUnitColumnMap
);
List
<
OrgUsr
>
downList
=
list
(
downUnitWrapper
);
if
(
downList
.
size
()
==
0
)
{
resultMap
.
put
(
"downUnit"
,
false
);
}
else
{
resultMap
.
put
(
"downUnit"
,
true
);
}
// 人员数量
Map
<
String
,
Object
>
countPerson
=
new
HashMap
<>();
countPerson
.
put
(
"parent_id"
,
company
.
getSequenceNbr
());
countPerson
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
QueryWrapper
<
OrgUsr
>
personNumWrapper
=
new
QueryWrapper
<
OrgUsr
>();
personNumWrapper
.
allEq
(
countPerson
);
int
personNum
=
count
(
personNumWrapper
);
resultMap
.
put
(
"personNum"
,
personNum
);
if
(
0
==
personNum
)
{
continue
;
}
List
<
Map
<
String
,
Object
>>
personList
=
new
ArrayList
<>();
// 查询动态表单Phone
Map
<
String
,
Object
>
phone
=
new
HashMap
<>();
phone
.
put
(
"instance_id"
,
company
.
getSequenceNbr
());
phone
.
put
(
"field_code"
,
"companyPhone"
);
QueryWrapper
<
DynamicFormInstance
>
phoneWrapper
=
new
QueryWrapper
<
DynamicFormInstance
>();
phoneWrapper
.
allEq
(
phone
);
DynamicFormInstance
phoneValue
=
alertFormValueServiceImpl
.
getOne
(
phoneWrapper
);
if
(
phoneValue
==
null
)
{
resultMap
.
put
(
"tel"
,
""
);
}
else
{
resultMap
.
put
(
"tel"
,
phoneValue
.
getFieldValue
());
}
// 获取单位人员列表信息
personList
=
listPerson
(
company
.
getSequenceNbr
()
+
""
).
stream
().
map
(
p
->
{
Map
<
String
,
Object
>
person
=
new
HashMap
<>();
person
.
put
(
"tel"
,
getValue
(
p
.
get
(
"telephone"
),
null
));
person
.
put
(
"img"
,
getValue
(
p
.
get
(
"personImg"
),
null
));
person
.
put
(
"id"
,
getValue
(
p
.
get
(
"sequenceNbr"
),
null
));
person
.
put
(
"name"
,
getValue
(
p
.
get
(
"bizOrgName"
),
null
));
person
.
put
(
"zhiwei"
,
getValue
(
p
.
get
(
"administrativePositionCode"
),
null
));
person
.
put
(
"unit"
,
getValue
(
p
.
get
(
"fireManagementPostCode"
),
null
));
return
person
;
}).
collect
(
Collectors
.
toList
());
resultMap
.
put
(
"children"
,
personList
);
companyPersonMsg
.
add
(
resultMap
);
}
return
companyPersonMsg
;
}
private
Object
getValue
(
Object
obj
,
Object
defaultValue
)
{
return
ObjectUtils
.
isEmpty
(
obj
)
?
defaultValue
:
obj
;
}
public
List
<
Map
<
String
,
Object
>>
listPerson
(
String
parentId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
OrgPersonEnum
.
人员
.
getCode
()));
map
.
put
(
"bizOrgType"
,
OrgPersonEnum
.
人员
.
getKey
());
map
.
put
(
"parentId"
,
parentId
);
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonAllList
(
map
);
return
list
==
null
?
new
ArrayList
<
Map
<
String
,
Object
>>()
:
list
;
}
public
IPage
<
Map
<
String
,
Object
>>
pagePerson
(
String
pageNum
,
String
pageSize
,
Map
<
String
,
Object
>
req
)
{
IPage
<
Map
<
String
,
Object
>>
pageBean
=
null
;
if
(
StringUtils
.
isBlank
(
pageNum
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageBean
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageBean
=
new
Page
<>(
Integer
.
parseInt
(
pageNum
),
Integer
.
parseInt
(
pageSize
));
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bizOrgType"
,
OrgPersonEnum
.
人员
.
getKey
());
if
(!
ObjectUtils
.
isEmpty
(
req
.
get
(
"bizOrgName"
)))
{
map
.
put
(
"bizOrgName"
,
req
.
get
(
"bizOrgName"
));
}
OrgUsr
parent
=
this
.
getById
(
Long
.
valueOf
(
req
.
get
(
"parentId"
).
toString
()));
map
.
put
(
"bizOrgCode"
,
ObjectUtils
.
isEmpty
(
parent
)
?
null
:
parent
.
getBizOrgCode
());
req
.
remove
(
"bizOrgName"
);
req
.
remove
(
"pageSize"
);
req
.
remove
(
"pageNum"
);
req
.
remove
(
"parentId"
);
map
.
put
(
"fieldsValue"
,
req
);
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
OrgPersonEnum
.
人员
.
getCode
()));
pageBean
.
setTotal
(
this
.
baseMapper
.
selectPersonListCount
(
map
));
map
.
put
(
"pageNum"
,
(
pageBean
.
getCurrent
()
-
1
)
*
pageBean
.
getSize
());
map
.
put
(
"pageSize"
,
pageBean
.
getSize
());
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
selectPersonList
(
map
);
pageBean
.
setRecords
(
list
);
return
pageBean
;
}
@Override
public
List
<
FormValue
>
getFormValue
(
Long
id
)
throws
Exception
{
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
<>();
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
if
(
alertFormValue
.
getFieldValue
()
!=
null
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
else
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValueLabel
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
}
return
formValue
;
}
public
List
<
FormValue
>
getFormValueDetail
(
Long
id
)
throws
Exception
{
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
List
<
FormValue
>
formValue
=
new
ArrayList
<>();
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
FormValue
value
=
new
FormValue
(
alertFormValue
.
getFieldCode
(),
alertFormValue
.
getFieldName
(),
alertFormValue
.
getFieldType
(),
alertFormValue
.
getFieldValue
(),
alertFormValue
.
getBlock
());
formValue
.
add
(
value
);
}
return
formValue
;
}
@Override
public
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
{
if
(
oriOrgUsr
.
getParentId
()
!=
oriOrgUsr
.
getParentId
())
{
OrgUsr
parent
=
getById
(
orgUsr
.
getParentId
());
if
(
parent
!=
null
&&
!
ObjectUtils
.
isEmpty
(
parent
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
updateChildOrgCode
(
oriOrgUsr
.
getBizOrgCode
(),
orgUsr
.
getBizOrgCode
());
orgUsr
.
setParentId
(
oriOrgUsr
.
getParentId
());
}
AgencyUserModel
me
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecDate
(
new
Date
());
orgUsr
.
setRecUserId
(
me
.
getUserId
());
orgUsr
.
setRecUserName
(
me
.
getRealName
());
updateById
(
orgUsr
);
}
private
void
updateChildOrgCode
(
String
oriOrgCode
,
String
targetOrgCode
)
{
List
<
OrgUsr
>
list
=
queryOrgUsrList
(
oriOrgCode
);
if
(
ObjectUtils
.
isEmpty
(
list
))
{
return
;
}
list
.
forEach
(
action
->
{
action
.
setBizOrgCode
(
action
.
getBizOrgCode
().
replace
(
oriOrgCode
,
targetOrgCode
));
updateById
(
action
);
});
}
public
List
<
OrgUsr
>
queryOrgUsrList
(
String
bizOrgCode
)
{
return
this
.
baseMapper
.
queryOrgUsrListByBizOrgCode
(
bizOrgCode
);
}
@Override
public
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
{
orgUsr
.
setRecDate
(
new
Date
());
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserId
(
user
.
getUserId
());
// 单位新增情况
save
(
orgUsr
);
// 填充主键
alertFromValuelist
.
stream
().
forEach
(
alertFromValue
->
{
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
alertFromValue
.
setGroupCode
(
OrgPersonEnum
.
公司
.
getCode
());
}
else
if
(
OrgPersonEnum
.
部门
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
alertFromValue
.
setGroupCode
(
OrgPersonEnum
.
部门
.
getCode
());
}
alertFromValue
.
setInstanceId
(
orgUsr
.
getSequenceNbr
());
});
// 保存动态表单数据
alertFormValueServiceImpl
.
saveBatch
(
alertFromValuelist
);
OrgUsrFormDto
formDto
=
this
.
selectCompanyById
(
orgUsr
.
getSequenceNbr
());
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
orgUsr
.
getBizOrgType
()))
{
supervisionFeign
.
asyncOwner
(
formDto
);
}
}
@Override
public
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
{
// 填充主键
fromValueList
.
forEach
(
alertFromValue
->
{
alertFromValue
.
setInstanceId
(
instanceId
);
});
List
<
DynamicFormInstanceDto
>
formList
=
alertFormValueServiceImpl
.
queryByCalledId
(
instanceId
);
Map
<
Long
,
DynamicFormInstanceDto
>
resourceMap
=
new
HashMap
<>();
Map
<
Long
,
DynamicFormInstance
>
newResourceMap
=
new
HashMap
<>();
formList
.
parallelStream
().
forEach
(
form
->
{
resourceMap
.
put
(
form
.
getFormColumnId
(),
form
);
});
List
<
DynamicFormInstance
>
updateList
=
new
ArrayList
<>();
List
<
DynamicFormInstance
>
addList
=
new
ArrayList
<>();
List
<
Long
>
deleteList
=
new
ArrayList
<>();
fromValueList
.
parallelStream
().
forEach
(
submitFormItem
->
{
if
(
resourceMap
.
containsKey
(
submitFormItem
.
getFormColumnId
()))
{
DynamicFormInstanceDto
oldForm
=
resourceMap
.
get
(
submitFormItem
.
getFormColumnId
());
submitFormItem
.
setSequenceNbr
(
oldForm
.
getSequenceNbr
());
updateList
.
add
(
submitFormItem
);
}
else
{
addList
.
add
(
submitFormItem
);
}
newResourceMap
.
put
(
submitFormItem
.
getFormColumnId
(),
submitFormItem
);
});
newResourceMap
.
keySet
().
parallelStream
().
forEach
(
form
->
{
resourceMap
.
remove
(
form
);
});
resourceMap
.
keySet
().
parallelStream
().
forEach
(
action
->
{
deleteList
.
add
(
resourceMap
.
get
(
action
).
getSequenceNbr
());
});
if
(
deleteList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
deleteBatchSeq
(
deleteList
);
}
if
(
updateList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
updateBatchById
(
updateList
);
}
if
(
addList
.
size
()
>
0
)
{
alertFormValueServiceImpl
.
saveBatch
(
addList
);
}
}
@Override
public
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
{
QueryWrapper
<
DynamicFormColumn
>
queryWrapper
=
new
QueryWrapper
<
DynamicFormColumn
>();
queryWrapper
.
eq
(
"group_code"
,
OrgPersonEnum
.
人员
.
getCode
());
List
<
DynamicFormColumn
>
alertForms
=
alertFormServiceImpl
.
list
(
queryWrapper
);
// 动态表单数据
List
<
DynamicFormInstanceDto
>
list
=
alertFormValueServiceImpl
.
listByCalledId
(
id
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
=
Bean
.
BeantoMap
(
orgUsr
);
result
.
put
(
"parenName"
,
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
// 放入所有动态表单数据
for
(
DynamicFormColumn
alertForm
:
alertForms
)
{
result
.
put
(
alertForm
.
getFieldCode
(),
null
);
}
for
(
DynamicFormInstanceDto
alertFormValue
:
list
)
{
result
.
put
(
alertFormValue
.
getFieldCode
(),
ObjectUtils
.
isEmpty
(
alertFormValue
.
getFieldValueLabel
())
?
alertFormValue
.
getFieldValue
()
:
alertFormValue
.
getFieldValueLabel
());
}
return
result
;
}
@Override
public
List
<
OrgUsr
>
selectCompanyDepartmentMsg
()
{
List
<
OrgUsr
>
list
=
this
.
baseMapper
.
selectCompanyDepartmentMsg
();
if
(
list
==
null
)
{
return
new
ArrayList
<>();
}
list
=
list
.
stream
().
filter
(
o
->
!
ObjectUtils
.
isEmpty
(
o
)).
collect
(
Collectors
.
toList
());
return
list
;
}
public
List
<
OrgUsr
>
selectCompanyList
()
{
List
<
OrgUsr
>
list
=
...
...
@@ -519,499 +516,726 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
list
;
}
@Override
public
void
saveOrgUsr
(
OrgUsrDto
OrgUsrVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
if
(
OrgUsrVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgUsrVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgUsrVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
getDynamicFormValue
());
/**
@Override
public
void
saveOrgUsr
(
OrgUsrDto
OrgUsrVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
if
(
OrgUsrVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgUsrVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgUsrVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
getDynamicFormValue
());
/**
* 同步保存ES
*/
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
@Override
public
void
saveOrgPerson
(
OrgPersonDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
if
(
OrgPersonVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
public
void
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
if
(
OrgPersonVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
@Override
public
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrVo
,
Long
id
)
throws
Exception
{
// 修改单位信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgUsrVo
.
getDynamicFormValue
());
/**
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
@Override
public
void
saveOrgPerson
(
OrgPersonDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
if
(
OrgPersonVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
public
void
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
if
(
OrgPersonVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
getDynamicFormValue
());
}
@Override
public
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrVo
,
Long
id
)
throws
Exception
{
// 修改单位信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgUsrVo
.
getDynamicFormValue
());
/**
* 同步保存ES
*/
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
@Override
public
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonVo
,
Long
id
)
throws
Exception
{
// 修改人员信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setSequenceNbr
(
id
);
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
oriOrgUsr
.
setAmosOrgCode
(
user
.
getRealName
());
oriOrgUsr
.
setAmosOrgId
(
user
.
getUserId
());
orgUsr
.
setAmosOrgCode
(
user
.
getRealName
());
orgUsr
.
setAmosOrgId
(
user
.
getUserId
());
}
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgPersonVo
.
getDynamicFormValue
());
}
@Override
public
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgUsrFormDto
orgUsrFormVo
=
new
OrgUsrFormDto
();
orgUsrFormVo
.
setDynamicFormAlert
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrFormVo
);
return
orgUsrFormVo
;
}
@Override
public
IPage
<
OrgUsr
>
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
<
OrgUsr
>();
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
<
OrgUsr
>
queryWrapper
=
new
QueryWrapper
<
OrgUsr
>();
queryWrapper
.
allEq
(
columnMap
);
queryWrapper
.
orderByAsc
(
"sequence_nbr"
);
return
page
(
pageBean
,
queryWrapper
);
}
@Override
public
void
saveDepartment
(
List
<
OrgDepartmentDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgDepartmentVo
.
get
(
i
).
getDynamicFormValue
());
}
}
}
@Override
public
void
saveCompany
(
List
<
OrgUsrDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getDynamicFormValue
());
}
}
@Override
public
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgPersonFormDto
orgPersonFormVo
=
new
OrgPersonFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
OrgUsr
parent
=
getById
(
orgUsr
.
getParentId
());
if
(!
ObjectUtils
.
isEmpty
(
parent
))
{
orgPersonFormVo
.
setParentName
(
parent
.
getBizOrgName
());
}
return
orgPersonFormVo
;
}
@Override
public
OrgPersonFormDto
selectPersonByIdDetail
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValueDetail
(
id
);
OrgPersonFormDto
orgPersonFormVo
=
new
OrgPersonFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
orgPersonFormVo
;
}
@Override
public
List
<
OrgMenuDto
>
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
<
OrgPersonDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
get
(
i
).
getDynamicFormValue
());
}
}
@Override
public
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_DEPARTMENT
);
if
(
OrgDepartmentVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgDepartmentVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgDepartmentVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgDepartmentVo
.
getDynamicFormValue
());
}
@Override
public
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentVo
,
Long
id
)
throws
Exception
{
// 修改部门信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgDepartmentVo
.
getDynamicFormValue
());
}
@Override
public
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgDepartmentFormDto
orgDepartmentFormVo
=
new
OrgDepartmentFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgDepartmentFormVo
);
return
orgDepartmentFormVo
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
selectForShowByListId
(
List
<
Long
>
ids
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
personResult
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
OrgUsr
orgUsr
=
getById
(
ids
.
get
(
i
));
Map
<
String
,
Object
>
result
=
selectForShowById
(
orgUsr
,
ids
.
get
(
i
));
personResult
.
add
(
result
);
}
return
personResult
;
}
@Override
public
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
)
{
if
(
null
==
pageNum
||
null
==
pageSize
)
{
pageNum
=
1
;
pageSize
=
Integer
.
MAX_VALUE
;
}
else
{
pageNum
=
(
pageNum
-
1
)
*
pageSize
;
}
return
orgUsrMapper
.
listContractDto
(
pageNum
,
pageSize
,
requestData
);
}
@Override
public
Integer
listContractDtoCount
(
RequestData
par
)
{
return
orgUsrMapper
.
listContractDtoCount
(
par
);
}
public
static
String
getOrgCodeStr
()
{
return
TreeParser
.
genTreeCode
();
}
public
void
importByExcel
(
List
<
OrgPersonExcelDto
>
list
)
{
list
.
forEach
(
item
->
{
OrgPersonDto
orgPersonDto
=
new
OrgPersonDto
();
orgPersonDto
=
Bean
.
toPo
(
item
,
orgPersonDto
);
List
<
DynamicFormInstance
>
alertFormValueList
=
new
ArrayList
<>();
if
(
item
.
getPersonNumber
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
102L
,
OrgPersonEnum
.
人员
.
getCode
(),
"员工编号"
,
"personNumber"
,
item
.
getPersonNumber
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificatesType
()
!=
null
)
{
String
certificatesType
=
item
.
getCertificatesType
();
String
[]
split
=
certificatesType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
23L
,
OrgPersonEnum
.
人员
.
getCode
(),
"证件类型"
,
"certificatesTypeCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getGender
()
!=
null
)
{
String
gender
=
item
.
getGender
();
String
[]
split
=
gender
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
22L
,
OrgPersonEnum
.
人员
.
getCode
(),
"性别"
,
"gender"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificatesNumber
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
100L
,
OrgPersonEnum
.
人员
.
getCode
(),
"证件号码"
,
"certificatesNumber"
,
item
.
getCertificatesNumber
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getTelephone
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
24L
,
OrgPersonEnum
.
人员
.
getCode
(),
"联系电话"
,
"telephone"
,
item
.
getTelephone
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getState
()
!=
null
)
{
String
state
=
item
.
getState
();
String
[]
split
=
state
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
25L
,
OrgPersonEnum
.
人员
.
getCode
(),
"人员状态"
,
"stateCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getSafetyTraining
()
!=
null
)
{
String
safetyTraining
=
item
.
getSafetyTraining
();
String
[]
split
=
safetyTraining
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
29L
,
OrgPersonEnum
.
人员
.
getCode
(),
"是否进行安全培训"
,
"safetyTraining"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getAdministrativePosition
()
!=
null
)
{
String
administrativePosition
=
item
.
getAdministrativePosition
();
String
[]
split
=
administrativePosition
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
28L
,
OrgPersonEnum
.
人员
.
getCode
(),
"行政职务"
,
"administrativePositionCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getInternalPosition
()
!=
null
)
{
String
internalPosition
=
item
.
getInternalPosition
();
String
[]
split
=
internalPosition
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
26L
,
OrgPersonEnum
.
人员
.
getCode
(),
"消防管理组织机构内部职务"
,
"internalPositionCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getFireManagementPost
()
!=
null
)
{
String
fireManagementPost
=
item
.
getFireManagementPost
();
String
[]
split
=
fireManagementPost
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
27L
,
OrgPersonEnum
.
人员
.
getCode
(),
"消防管理岗位"
,
"fireManagementPostCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getPositionType
()
!=
null
)
{
String
positionType
=
item
.
getPositionType
();
String
[]
split
=
positionType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
30L
,
OrgPersonEnum
.
人员
.
getCode
(),
"岗位类型"
,
"positionType"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificateType
()
!=
null
)
{
String
certificateType
=
item
.
getCertificateType
();
String
[]
split
=
certificateType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
31L
,
OrgPersonEnum
.
人员
.
getCode
(),
"持证类别"
,
"certificateType"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getHoldingTime
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
32L
,
OrgPersonEnum
.
人员
.
getCode
(),
"持证时间"
,
"holdingTime"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
item
.
getHoldingTime
()),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getAuditCycle
()
!=
null
)
{
String
auditCycle
=
item
.
getAuditCycle
();
String
[]
split
=
auditCycle
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
33L
,
OrgPersonEnum
.
人员
.
getCode
(),
"审核周期"
,
"auditCycle"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getPersonImg
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
34L
,
OrgPersonEnum
.
人员
.
getCode
(),
"人员照片"
,
"personImg"
,
item
.
getPersonImg
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificateImg
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
101L
,
OrgPersonEnum
.
人员
.
getCode
(),
"重点工种资质证书"
,
"certificateImg"
,
item
.
getCertificateImg
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
try
{
orgPersonDto
.
setDynamicFormValue
(
alertFormValueList
);
this
.
saveOrgPerson
(
orgPersonDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
});
}
public
List
<
OrgPersonExcelDto
>
queryOrgPersonDtoList
(
boolean
isDelete
)
{
List
<
OrgPersonExcelDto
>
excelOrgPersonDtoList
=
orgUsrMapper
.
queryOrgPersonDtoList
(
isDelete
);
return
excelOrgPersonDtoList
;
}
/**
* 根据id查询当前单位下的所有子单位、部门
*
* @param orgUserId
* @return
*/
public
List
<
OrgUsr
>
listOrgUserById
(
Long
orgUserId
)
{
return
this
.
baseMapper
.
listOrgUserById
(
orgUserId
);
}
public
List
<
CompanyPerson
>
returnCompanyPerson
(
List
<
Long
>
ids
)
{
if
(
ObjectUtils
.
isEmpty
(
ids
))
{
return
null
;
}
return
ids
.
stream
().
map
(
m
->
{
OrgUsr
org
=
getById
(
m
);
if
(
ObjectUtils
.
isEmpty
(
org
))
{
return
null
;
}
CompanyPerson
company
=
new
CompanyPerson
();
BeanUtils
.
copyProperties
(
org
,
company
);
company
.
setPersons
(
this
.
queryForListByParentIdAndOrgType
(
org
.
getSequenceNbr
(),
OrgPersonEnum
.
人员
.
getKey
()));
return
company
;
}).
filter
(
c
->
{
return
c
!=
null
;
}).
collect
(
Collectors
.
toList
());
}
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
)
{
return
this
.
queryForList
(
null
,
false
,
parentId
,
bizOrgType
);
}
public
OrgUsrDto
getOrg
(
String
amosUserId
)
{
OrgUsrDto
person
=
queryForListByParentIdAndOrgType
(
amosUserId
);
if
(
ObjectUtils
.
isEmpty
(
person
))
{
return
null
;
}
return
this
.
queryBySeq
(
Long
.
valueOf
(
person
.
getParentId
()));
}
public
OrgUsrDto
queryForListByParentIdAndOrgType
(
String
amosOrgId
)
{
return
this
.
queryModelByParams
(
amosOrgId
);
}
@Override
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
// TODO Auto-generated method stub
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
return
list
;
}
@Override
public
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
)
{
//获取所有单位
QueryWrapper
<
OrgUsr
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
in
(
"biz_org_type"
,
"DEPARTMENT"
,
"COMPANY"
);
wrapper
.
eq
(
"is_delete"
,
0
);
if
(
name
!=
null
&&!
""
.
equals
(
name
))
{
wrapper
.
like
(
"biz_org_name"
,
name
);
}
List
<
OrgUsr
>
list
=
this
.
list
(
wrapper
);
List
<
ESOrgUsrDto
>
lidataDtos
=
new
ArrayList
();
list
.
forEach
(
orgUsr
->{
ESOrgUsrDto
data
=
new
ESOrgUsrDto
();
data
.
setSequenceNbr
(
orgUsr
.
getSequenceNbr
());
data
.
setBizOrgName
(
orgUsr
.
getBizOrgName
());
lidataDtos
.
add
(
data
);
});
return
lidataDtos
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getparent
()
{
return
orgUsrMapper
.
getparent
();
}
@Override
public
List
<
OrgUsrExcelDto
>
exportToExcel
()
{
return
orgUsrMapper
.
exportToExcel
();
}
public
List
<
OrgUsr
>
getCompanyDetailTree
()
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
eSOrgUsrService
.
saveAlertCalledToES
(
orgUsr
);
}
@Override
public
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonVo
,
Long
id
)
throws
Exception
{
// 修改人员信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
orgUsr
.
setSequenceNbr
(
id
);
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
oriOrgUsr
.
setAmosOrgCode
(
user
.
getRealName
());
oriOrgUsr
.
setAmosOrgId
(
user
.
getUserId
());
orgUsr
.
setAmosOrgCode
(
user
.
getRealName
());
orgUsr
.
setAmosOrgId
(
user
.
getUserId
());
}
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgPersonVo
.
getDynamicFormValue
());
}
@Override
public
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgUsrFormDto
orgUsrFormVo
=
new
OrgUsrFormDto
();
orgUsrFormVo
.
setDynamicFormAlert
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrFormVo
);
return
orgUsrFormVo
;
}
@Override
public
IPage
<
OrgUsr
>
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
<
OrgUsr
>();
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
<
OrgUsr
>
queryWrapper
=
new
QueryWrapper
<
OrgUsr
>();
queryWrapper
.
allEq
(
columnMap
);
queryWrapper
.
orderByAsc
(
"sequence_nbr"
);
return
page
(
pageBean
,
queryWrapper
);
}
@Override
public
void
saveDepartment
(
List
<
OrgDepartmentDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgDepartmentVo
.
get
(
i
).
getDynamicFormValue
());
}
}
}
@Override
public
void
saveCompany
(
List
<
OrgUsrDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgUsrVo
.
get
(
i
).
getDynamicFormValue
());
}
}
@Override
public
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgPersonFormDto
orgPersonFormVo
=
new
OrgPersonFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
OrgUsr
parent
=
getById
(
orgUsr
.
getParentId
());
if
(!
ObjectUtils
.
isEmpty
(
parent
))
{
orgPersonFormVo
.
setParentName
(
parent
.
getBizOrgName
());
}
return
orgPersonFormVo
;
}
@Override
public
OrgPersonFormDto
selectPersonByIdDetail
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValueDetail
(
id
);
OrgPersonFormDto
orgPersonFormVo
=
new
OrgPersonFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgPersonFormVo
);
orgPersonFormVo
.
setParentName
(
getById
(
orgUsr
.
getParentId
()).
getBizOrgName
());
return
orgPersonFormVo
;
}
@Override
public
List
<
OrgMenuDto
>
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
<
OrgPersonDto
>
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
);
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgPersonVo
.
get
(
i
).
getDynamicFormValue
());
}
}
@Override
public
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
orgUsr
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_DEPARTMENT
);
if
(
OrgDepartmentVo
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
getById
(
OrgDepartmentVo
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
OrgDepartmentVo
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
getOrgCodeStr
());
}
saveOrgUsrDynamicFormInstance
(
orgUsr
,
OrgDepartmentVo
.
getDynamicFormValue
());
}
@Override
public
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentVo
,
Long
id
)
throws
Exception
{
// 修改部门信息
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgDepartmentVo
.
getDynamicFormValue
());
}
@Override
public
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
{
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
OrgDepartmentFormDto
orgDepartmentFormVo
=
new
OrgDepartmentFormDto
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgDepartmentFormVo
);
return
orgDepartmentFormVo
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
selectForShowByListId
(
List
<
Long
>
ids
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
personResult
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ids
.
size
();
i
++)
{
OrgUsr
orgUsr
=
getById
(
ids
.
get
(
i
));
Map
<
String
,
Object
>
result
=
selectForShowById
(
orgUsr
,
ids
.
get
(
i
));
personResult
.
add
(
result
);
}
return
personResult
;
}
@Override
public
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
)
{
if
(
null
==
pageNum
||
null
==
pageSize
)
{
pageNum
=
1
;
pageSize
=
Integer
.
MAX_VALUE
;
}
else
{
pageNum
=
(
pageNum
-
1
)
*
pageSize
;
}
return
orgUsrMapper
.
listContractDto
(
pageNum
,
pageSize
,
requestData
);
}
@Override
public
Integer
listContractDtoCount
(
RequestData
par
)
{
return
orgUsrMapper
.
listContractDtoCount
(
par
);
}
public
static
String
getOrgCodeStr
()
{
return
TreeParser
.
genTreeCode
();
}
public
void
importByExcel
(
List
<
OrgPersonExcelDto
>
list
)
{
list
.
forEach
(
item
->
{
OrgPersonDto
orgPersonDto
=
new
OrgPersonDto
();
orgPersonDto
=
Bean
.
toPo
(
item
,
orgPersonDto
);
List
<
DynamicFormInstance
>
alertFormValueList
=
new
ArrayList
<>();
if
(
item
.
getPersonNumber
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
102L
,
OrgPersonEnum
.
人员
.
getCode
(),
"员工编号"
,
"personNumber"
,
item
.
getPersonNumber
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificatesType
()
!=
null
)
{
String
certificatesType
=
item
.
getCertificatesType
();
String
[]
split
=
certificatesType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
23L
,
OrgPersonEnum
.
人员
.
getCode
(),
"证件类型"
,
"certificatesTypeCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getGender
()
!=
null
)
{
String
gender
=
item
.
getGender
();
String
[]
split
=
gender
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
22L
,
OrgPersonEnum
.
人员
.
getCode
(),
"性别"
,
"gender"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificatesNumber
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
100L
,
OrgPersonEnum
.
人员
.
getCode
(),
"证件号码"
,
"certificatesNumber"
,
item
.
getCertificatesNumber
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getTelephone
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
24L
,
OrgPersonEnum
.
人员
.
getCode
(),
"联系电话"
,
"telephone"
,
item
.
getTelephone
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getState
()
!=
null
)
{
String
state
=
item
.
getState
();
String
[]
split
=
state
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
25L
,
OrgPersonEnum
.
人员
.
getCode
(),
"人员状态"
,
"stateCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getSafetyTraining
()
!=
null
)
{
String
safetyTraining
=
item
.
getSafetyTraining
();
String
[]
split
=
safetyTraining
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
29L
,
OrgPersonEnum
.
人员
.
getCode
(),
"是否进行安全培训"
,
"safetyTraining"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getAdministrativePosition
()
!=
null
)
{
String
administrativePosition
=
item
.
getAdministrativePosition
();
String
[]
split
=
administrativePosition
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
28L
,
OrgPersonEnum
.
人员
.
getCode
(),
"行政职务"
,
"administrativePositionCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getInternalPosition
()
!=
null
)
{
String
internalPosition
=
item
.
getInternalPosition
();
String
[]
split
=
internalPosition
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
26L
,
OrgPersonEnum
.
人员
.
getCode
(),
"消防管理组织机构内部职务"
,
"internalPositionCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getFireManagementPost
()
!=
null
)
{
String
fireManagementPost
=
item
.
getFireManagementPost
();
String
[]
split
=
fireManagementPost
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
27L
,
OrgPersonEnum
.
人员
.
getCode
(),
"消防管理岗位"
,
"fireManagementPostCode"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getPositionType
()
!=
null
)
{
String
positionType
=
item
.
getPositionType
();
String
[]
split
=
positionType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
30L
,
OrgPersonEnum
.
人员
.
getCode
(),
"岗位类型"
,
"positionType"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificateType
()
!=
null
)
{
String
certificateType
=
item
.
getCertificateType
();
String
[]
split
=
certificateType
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
31L
,
OrgPersonEnum
.
人员
.
getCode
(),
"持证类别"
,
"certificateType"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getHoldingTime
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
32L
,
OrgPersonEnum
.
人员
.
getCode
(),
"持证时间"
,
"holdingTime"
,
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
format
(
item
.
getHoldingTime
()),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getAuditCycle
()
!=
null
)
{
String
auditCycle
=
item
.
getAuditCycle
();
String
[]
split
=
auditCycle
.
split
(
"@"
);
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
33L
,
OrgPersonEnum
.
人员
.
getCode
(),
"审核周期"
,
"auditCycle"
,
split
[
0
],
split
[
1
],
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getPersonImg
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
34L
,
OrgPersonEnum
.
人员
.
getCode
(),
"人员照片"
,
"personImg"
,
item
.
getPersonImg
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
if
(
item
.
getCertificateImg
()
!=
null
)
{
DynamicFormInstance
alertFormValue
=
new
DynamicFormInstance
(
101L
,
OrgPersonEnum
.
人员
.
getCode
(),
"重点工种资质证书"
,
"certificateImg"
,
item
.
getCertificateImg
(),
null
,
false
);
alertFormValueList
.
add
(
alertFormValue
);
}
try
{
orgPersonDto
.
setDynamicFormValue
(
alertFormValueList
);
this
.
saveOrgPerson
(
orgPersonDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
});
}
public
List
<
OrgPersonExcelDto
>
queryOrgPersonDtoList
(
boolean
isDelete
)
{
List
<
OrgPersonExcelDto
>
excelOrgPersonDtoList
=
orgUsrMapper
.
queryOrgPersonDtoList
(
isDelete
);
return
excelOrgPersonDtoList
;
}
/**
* 根据id查询当前单位下的所有子单位、部门
*
* @param orgUserId
* @return
*/
public
List
<
OrgUsr
>
listOrgUserById
(
Long
orgUserId
)
{
return
this
.
baseMapper
.
listOrgUserById
(
orgUserId
);
}
public
List
<
CompanyPerson
>
returnCompanyPerson
(
List
<
Long
>
ids
)
{
if
(
ObjectUtils
.
isEmpty
(
ids
))
{
return
null
;
}
return
ids
.
stream
().
map
(
m
->
{
OrgUsr
org
=
getById
(
m
);
if
(
ObjectUtils
.
isEmpty
(
org
))
{
return
null
;
}
CompanyPerson
company
=
new
CompanyPerson
();
BeanUtils
.
copyProperties
(
org
,
company
);
company
.
setPersons
(
this
.
queryForListByParentIdAndOrgType
(
org
.
getSequenceNbr
(),
OrgPersonEnum
.
人员
.
getKey
()));
return
company
;
}).
filter
(
c
->
{
return
c
!=
null
;
}).
collect
(
Collectors
.
toList
());
}
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
)
{
return
this
.
queryForList
(
null
,
false
,
parentId
,
bizOrgType
);
}
public
OrgUsrDto
getOrg
(
String
amosUserId
)
{
OrgUsrDto
person
=
queryForListByParentIdAndOrgType
(
amosUserId
);
if
(
ObjectUtils
.
isEmpty
(
person
))
{
return
null
;
}
return
this
.
queryBySeq
(
Long
.
valueOf
(
person
.
getParentId
()));
}
public
OrgUsrDto
queryForListByParentIdAndOrgType
(
String
amosOrgId
)
{
return
this
.
queryModelByParams
(
amosOrgId
);
}
@Override
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
// TODO Auto-generated method stub
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
return
list
;
}
@Override
public
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
)
{
//获取所有单位
QueryWrapper
<
OrgUsr
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
in
(
"biz_org_type"
,
"DEPARTMENT"
,
"COMPANY"
);
wrapper
.
eq
(
"is_delete"
,
0
);
if
(
name
!=
null
&&
!
""
.
equals
(
name
))
{
wrapper
.
like
(
"biz_org_name"
,
name
);
}
List
<
OrgUsr
>
list
=
this
.
list
(
wrapper
);
List
<
ESOrgUsrDto
>
lidataDtos
=
new
ArrayList
();
list
.
forEach
(
orgUsr
->
{
ESOrgUsrDto
data
=
new
ESOrgUsrDto
();
data
.
setSequenceNbr
(
orgUsr
.
getSequenceNbr
());
data
.
setBizOrgName
(
orgUsr
.
getBizOrgName
());
lidataDtos
.
add
(
data
);
});
return
lidataDtos
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getparent
()
{
return
orgUsrMapper
.
getparent
();
}
@Override
public
List
<
OrgUsrExcelDto
>
exportToExcel
()
{
return
orgUsrMapper
.
exportToExcel
();
}
@Override
public
UserUnitDto
getUserUnit
(
String
id
,
String
type
,
String
code
)
{
// 业主单位
List
<
UserUnitDto
>
list
=
orgUsrMapper
.
getUserUnit
(
id
,
type
,
null
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(
list
.
size
()
==
1
)
{
UserUnitDto
userUnitDto
=
list
.
get
(
0
);
String
companyId
=
userUnitDto
.
getCompanyId
();
if
(
StringUtils
.
isNotBlank
(
companyId
)
&&
StringUtils
.
isNotBlank
(
code
))
{
List
<
UserUnitDto
>
dtoList
=
orgUsrMapper
.
getUserUnit
(
null
,
code
,
companyId
);
if
(!
CollectionUtils
.
isEmpty
(
dtoList
))
{
userUnitDto
.
setCompanyId
(
dtoList
.
get
(
0
).
getPersonSeq
());
return
userUnitDto
;
}
throw
new
RuntimeException
(
"未获取人员业主单位!"
);
}
}
throw
new
RuntimeException
(
"人员绑定业主单位不唯一!"
);
}
throw
new
RuntimeException
(
"人员未绑定任何单位!"
);
}
public
List
<
OrgUsr
>
getCompanyDetailTree
()
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
}
@Override
public
List
<
OrgMenuDto
>
companyUserTreeByUser
(
AgencyUserModel
user
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
List
<
OrgUsr
>
companyDepartmentMsgList
=
this
.
baseMapper
.
selectList
(
wrapper
);
return
gettTreeByUser
(
user
,
companyDepartmentMsgList
);
}
@Override
public
List
<
OrgMenuDto
>
companyTreeByUser
(
AgencyUserModel
user
)
{
List
<
OrgUsr
>
companyDepartmentMsgList
=
selectCompanyDepartmentMsg
();
return
gettTreeByUser
(
user
,
companyDepartmentMsgList
);
}
;
@Override
public
List
<
OrgUsrTreeDto
>
companyListByUser
(
AgencyUserModel
user
)
{
List
<
OrgUsrTreeDto
>
list
=
new
ArrayList
<>();
// 需要角色为机场单位或管理员,其余角色返回空
String
code
=
UserRolesEnum
.
AIRPORTUNIT
.
getCode
();
String
codeAdmin
=
UserRolesEnum
.
ADMIN
.
getCode
();
String
roles
=
getRoles
(
user
,
code
);
if
(!
StringUtils
.
isEmpty
(
roles
))
{
List
<
OrgUsrTreeDto
>
companyList
=
this
.
baseMapper
.
getCompanyAndKeySite
(
null
);
if
(
roles
.
equals
(
codeAdmin
))
{
// 返回全部单位列表
return
companyAndKeySiteList
(
companyList
);
}
else
if
(
roles
.
equals
(
code
))
{
// } else {
// 人员与多个部门/公司关联
List
<
OrgUsr
>
orgUsrList
=
orgUsrList
(
user
);
if
(
ObjectUtils
.
isEmpty
(
orgUsrList
))
{
return
list
;
}
Set
<
Long
>
set
=
new
HashSet
<>();
orgUsrList
.
forEach
(
orgUsr
->
{
Long
parent
=
ObjectUtils
.
isEmpty
(
orgUsr
.
getParentId
())
?
0L
:
Long
.
parseLong
(
orgUsr
.
getParentId
());
if
(
set
.
add
(
parent
))
{
Long
companyIdByDto
=
getCompanyIdByDto
(
parent
,
companyList
);
List
<
OrgUsrTreeDto
>
orgUsrTreeDtoList
=
this
.
baseMapper
.
getCompanyAndKeySite
(
companyIdByDto
);
list
.
addAll
(
companyAndKeySiteList
(
orgUsrTreeDtoList
));
}
});
// 返回所在用户单位列表
return
list
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
}
return
list
;
}
/**
* 获取登陆人所在公司
*/
private
Long
getCompanyIdByDto
(
Long
parentId
,
List
<
OrgUsrTreeDto
>
companyDepartmentMsgList
)
{
Long
pid
=
null
;
for
(
OrgUsrTreeDto
orgUsr
:
companyDepartmentMsgList
)
{
if
(
orgUsr
.
getSequenceNbr
().
equals
(
parentId
))
{
if
(
orgUsr
.
getBizOrgType
().
equals
(
OrgPersonEnum
.
公司
.
getKey
())
&&
ObjectUtils
.
isEmpty
(
orgUsr
.
getParentId
()))
{
return
orgUsr
.
getSequenceNbr
();
}
else
{
pid
=
getCompanyIdByDto
(
Long
.
parseLong
(
orgUsr
.
getParentId
()),
companyDepartmentMsgList
);
}
}
}
return
pid
;
}
/**
* 查询单位列表
*/
private
List
<
OrgUsrTreeDto
>
companyAndKeySiteList
(
List
<
OrgUsrTreeDto
>
companyList
)
{
List
<
OrgUsrTreeDto
>
list
=
new
ArrayList
<>();
if
(
ObjectUtils
.
isEmpty
(
companyList
))
{
return
list
;
}
Map
<
Long
,
OrgUsrTreeDto
>
map
=
new
HashMap
<>(
companyList
.
size
());
companyList
.
forEach
(
e
->
map
.
put
(
e
.
getSequenceNbr
(),
e
));
Set
<?
extends
Map
.
Entry
<
Long
,
?
extends
OrgUsrTreeDto
>>
entries
=
map
.
entrySet
();
entries
.
parallelStream
().
forEach
(
entry
->
{
OrgUsrTreeDto
value
=
entry
.
getValue
();
if
(!
ObjectUtils
.
isEmpty
(
value
))
{
Long
parent
=
ObjectUtils
.
isEmpty
(
value
.
getParentId
())
?
0L
:
Long
.
parseLong
(
value
.
getParentId
());
OrgUsrTreeDto
orgUsrTreeDto
=
map
.
get
(
parent
);
if
(!
ObjectUtils
.
isEmpty
(
orgUsrTreeDto
))
{
int
num
=
orgUsrTreeDto
.
getNum
()
+
value
.
getNum
();
orgUsrTreeDto
.
setNum
(
num
);
}
else
{
if
(
value
.
getBizOrgType
().
equals
(
OrgPersonEnum
.
公司
.
getKey
()))
{
list
.
add
(
value
);
}
}
}
});
return
list
;
}
/**
* 获取树
*/
private
List
<
OrgMenuDto
>
gettTreeByUser
(
AgencyUserModel
user
,
List
<
OrgUsr
>
list
)
{
List
<
OrgMenuDto
>
treeList
=
new
ArrayList
<>();
// 需要角色为机场单位或管理员,其余角色返回空
String
code
=
UserRolesEnum
.
AIRPORTUNIT
.
getCode
();
String
codeAdmin
=
UserRolesEnum
.
ADMIN
.
getCode
();
String
roles
=
getRoles
(
user
,
code
);
if
(!
StringUtils
.
isEmpty
(
roles
))
{
// treeList = getDepartmentTreeByUser(user,list);
if
(
roles
.
equals
(
codeAdmin
))
{
// 返回全量树
treeList
=
buildTreeParallel
(
list
);
}
else
if
(
roles
.
equals
(
code
))
{
// 获取当前用户所在部门树
treeList
=
getDepartmentTreeByUser
(
user
,
list
);
}
}
return
treeList
;
}
/**
* 根基登陆人获取指定角色/最高角色,默认最高角色
*/
private
String
getRoles
(
AgencyUserModel
user
,
String
code
)
{
String
type
=
null
;
Map
<
Long
,
List
<
RoleModel
>>
orgRolesMap
=
user
.
getOrgRoles
();
if
(
ObjectUtils
.
isEmpty
(
orgRolesMap
))
{
return
null
;
}
for
(
Long
key
:
orgRolesMap
.
keySet
())
{
if
(!
ObjectUtils
.
isEmpty
(
orgRolesMap
.
get
(
key
)))
{
for
(
RoleModel
roleModel
:
orgRolesMap
.
get
(
key
))
{
String
roleType
=
roleModel
.
getRoleType
();
if
(
roleType
.
equals
(
code
))
{
type
=
code
;
}
if
(
roleType
.
equals
(
UserRolesEnum
.
ADMIN
.
getCode
()))
{
return
roleType
;
}
}
}
}
return
type
;
}
/**
* 获取当前用户所在部门/用户树
*/
private
List
<
OrgMenuDto
>
getDepartmentTreeByUser
(
AgencyUserModel
user
,
List
<
OrgUsr
>
companyDepartmentMsgList
)
{
List
<
OrgMenuDto
>
list
=
new
ArrayList
<>();
if
(
ObjectUtils
.
isEmpty
(
companyDepartmentMsgList
))
{
return
list
;
}
// 1.获取当前登陆用户关联人员
List
<
OrgUsr
>
orgUsrList
=
orgUsrList
(
user
);
if
(
ObjectUtils
.
isEmpty
(
orgUsrList
))
{
return
list
;
}
// 2.查询人员所属部门
List
<
OrgMenuDto
>
treeList
=
buildTreeParallel
(
companyDepartmentMsgList
);
Set
<
Long
>
set
=
new
HashSet
<>();
orgUsrList
.
forEach
(
orgUsr
->
{
Long
parentId
=
Long
.
parseLong
(
orgUsr
.
getParentId
());
getTreeChildre
(
list
,
treeList
,
parentId
,
set
,
companyDepartmentMsgList
);
});
return
list
;
}
/**
* 获取登陆人关联账号
*/
private
List
<
OrgUsr
>
orgUsrList
(
AgencyUserModel
user
)
{
String
userId
=
user
.
getUserId
();
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
wrapper
.
eq
(
OrgUsr:
:
getAmosOrgId
,
userId
);
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
OrgPersonEnum
.
人员
.
getKey
());
List
<
OrgUsr
>
orgUsrList
=
this
.
baseMapper
.
selectList
(
wrapper
);
return
orgUsrList
;
}
/**
* 组装树
*/
private
void
getTreeChildre
(
List
<
OrgMenuDto
>
list
,
List
<
OrgMenuDto
>
treeList
,
Long
parentId
,
Set
<
Long
>
set
,
List
<
OrgUsr
>
companyDepartmentMsgList
)
{
if
(
ObjectUtils
.
isEmpty
(
treeList
)
&&
ObjectUtils
.
isEmpty
(
companyDepartmentMsgList
))
{
return
;
}
// 获取登陆人所在公司
Long
pid
=
getCompanyId
(
parentId
,
companyDepartmentMsgList
);
if
(
set
.
add
(
pid
))
{
List
<
OrgMenuDto
>
list1
=
treeList
.
stream
().
filter
(
orgMenuDto
->
orgMenuDto
.
getKey
().
equals
(
pid
)).
collect
(
Collectors
.
toList
());
list
.
addAll
(
list1
);
}
}
/**
* 获取登陆人所在公司
*/
private
Long
getCompanyId
(
Long
parentId
,
List
<
OrgUsr
>
companyDepartmentMsgList
)
{
Long
pid
=
null
;
for
(
OrgUsr
orgUsr
:
companyDepartmentMsgList
)
{
if
(
orgUsr
.
getSequenceNbr
().
equals
(
parentId
))
{
if
(
orgUsr
.
getBizOrgType
().
equals
(
OrgPersonEnum
.
公司
.
getKey
())
&&
ObjectUtils
.
isEmpty
(
orgUsr
.
getParentId
()))
{
return
orgUsr
.
getSequenceNbr
();
}
else
{
pid
=
getCompanyId
(
Long
.
parseLong
(
orgUsr
.
getParentId
()),
companyDepartmentMsgList
);
}
}
}
return
pid
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/AlertCalledController.java
View file @
c19ca472
...
...
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.component.event.RestEventTrigger
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -27,7 +28,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -294,6 +294,7 @@ public class AlertCalledController extends BaseController {
@PostMapping
(
value
=
"/billsend"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备联动紧急响应"
,
notes
=
"启动所有消防队伍的警铃、广播,并自动开启所有车库门"
)
@Transactional
@RestEventTrigger
(
value
=
"opreateLogEventHandler"
)
public
ResponseModel
<
Boolean
>
controlEquip
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
controlEquip
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/event/OpreateLogEventHandler.java
0 → 100644
View file @
c19ca472
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
.
event
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.OperateLogModel
;
import
org.springframework.stereotype.Component
;
import
org.typroject.tyboot.component.event.RestEvent
;
import
org.typroject.tyboot.component.event.RestEventHandler
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
/**
*
* <pre>
* controller层操作日志事件监听
* </pre>
*
* @author gwb
* @version $Id: OpreateLogEventHandler.java, v 0.1 2021年8月19日 下午6:38:36 gwb Exp $
*/
@Component
(
"opreateLogEventHandler"
)
public
class
OpreateLogEventHandler
extends
RestEventHandler
{
static
ObjectMapper
objectMapper
=
new
ObjectMapper
();
@Override
protected
void
handleEvent
(
RestEvent
restEvent
)
throws
Exception
{
OperateLogModel
operateLogModel
=
new
OperateLogModel
();
operateLogModel
.
setMethodLabel
(
restEvent
.
getMethodLabel
());
operateLogModel
.
setMethodName
(
restEvent
.
getMethodName
());
operateLogModel
.
setParams
(
objectMapper
.
writeValueAsString
(
restEvent
.
getParams
()));
operateLogModel
.
setResult
(
objectMapper
.
writeValueAsString
(
restEvent
.
getSource
()));
operateLogModel
.
setUserId
(
restEvent
.
getRequestContextModel
().
getExcutedUserId
());
operateLogModel
.
setRemoteIp
(
restEvent
.
getRequestContextModel
().
getRequestIP
());
operateLogModel
.
setToken
(
restEvent
.
getRequestContextModel
().
getToken
());
operateLogModel
.
setTraceId
(
restEvent
.
getRequestContextModel
().
getTraceId
());
operateLogModel
.
setAgencyCode
(
restEvent
.
getRequestContextModel
().
getAgencyCode
());
operateLogModel
.
setAppCode
(
restEvent
.
getRequestContextModel
().
getAppKey
());
RequestContext
.
setAppKey
(
restEvent
.
getRequestContextModel
().
getAppKey
());
RequestContext
.
setProduct
(
restEvent
.
getRequestContextModel
().
getProduct
());
RequestContext
.
setToken
(
restEvent
.
getRequestContextModel
().
getToken
());
Systemctl
.
operateLogClient
.
create
(
operateLogModel
);
}
}
amos-boot-module/amos-boot-module-biz/pom.xml
View file @
c19ca472
...
...
@@ -13,7 +13,21 @@
<packaging>
pom
</packaging>
<dependencies>
<dependency>
<groupId>
org.typroject
</groupId>
<artifactId>
tyboot-component-event
</artifactId>
<version>
${tyboot-version}
</version>
<exclusions>
<exclusion>
<groupId>
org.typroject
</groupId>
<artifactId>
*
</artifactId>
</exclusion>
<exclusion>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<modules>
...
...
amos-boot-system-jcs/src/main/resources/application.properties
View file @
c19ca472
spring.application.name
=
JCS_chenhao
server.servlet.context-path
=
/jcs
spring.application.name
=
JCS_cz
server.port
=
11100
spring.profiles.active
=
dev
...
...
amos-boot-system-maintenance/src/main/resources/db/changelog/mt-sql-task.xml
View file @
c19ca472
...
...
@@ -24,6 +24,12 @@
end if;
END
</createProcedure>
</changeSet>
<changeSet
author=
"suhuiguang"
id=
"1629352951339-1"
runOnChange=
"true"
>
<sql>
DROP TRIGGER IF EXISTS `addPointConfig`;
DROP TRIGGER IF EXISTS `updatePointConfig`;
DROP TRIGGER IF EXISTS `updatePointConfig`;
</sql>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
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