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
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
858 additions
and
453 deletions
+858
-453
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
+51
-29
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
+89
-41
DynamicFormColumnServiceImpl.java
...common/biz/service/impl/DynamicFormColumnServiceImpl.java
+15
-0
FailureAuditServiceImpl.java
...dule/common/biz/service/impl/FailureAuditServiceImpl.java
+13
-28
FailureDetailsServiceImpl.java
...le/common/biz/service/impl/FailureDetailsServiceImpl.java
+70
-114
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
+258
-34
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,11 +37,14 @@ public class DynamicFormInitDto implements Serializable{
...
@@ -37,11 +37,14 @@ public class DynamicFormInitDto implements Serializable{
@ApiModelProperty
(
value
=
"提交表单附加字段"
)
@ApiModelProperty
(
value
=
"提交表单附加字段"
)
private
DynamicFormInstanceDto
formItemDescr
;
private
DynamicFormInstanceDto
formItemDescr
;
@ApiModelProperty
(
value
=
"
接口地址
"
)
@ApiModelProperty
(
value
=
"
配置
"
)
private
String
columnConfig
;
private
String
columnConfig
;
private
int
sort
;
private
int
sort
;
@ApiModelProperty
(
value
=
"接口地址"
)
private
String
url
;
public
DynamicFormInitDto
()
{
public
DynamicFormInitDto
()
{
super
();
super
();
...
...
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 {
...
@@ -24,7 +24,6 @@ public class FailureRepairlogDto extends BaseDto {
@ApiModelProperty
(
value
=
"流程处理人Id"
)
@ApiModelProperty
(
value
=
"流程处理人Id"
)
private
Integer
processAuditorId
;
private
Integer
processAuditorId
;
@ApiModelProperty
(
value
=
"处理人所属部门"
)
@ApiModelProperty
(
value
=
"处理人所属部门"
)
private
String
processDepartment
;
private
String
processDepartment
;
...
@@ -41,6 +40,6 @@ public class FailureRepairlogDto extends BaseDto {
...
@@ -41,6 +40,6 @@ public class FailureRepairlogDto extends BaseDto {
private
Long
faultId
;
private
Long
faultId
;
@ApiModelProperty
(
value
=
"流程处理人"
)
@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 {
...
@@ -62,6 +62,4 @@ public class FailureRepairlog extends BaseEntity {
@TableField
(
"fault_id"
)
@TableField
(
"fault_id"
)
private
Long
faultId
;
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
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
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
com.yeejoin.amos.boot.module.common.api.entity.FailureDetails
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -10,4 +19,28 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
...
@@ -10,4 +19,28 @@ import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
* @date 2021-08-04
* @date 2021-08-04
*/
*/
public
interface
FailureDetailsMapper
extends
BaseMapper
<
FailureDetails
>
{
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> {
...
@@ -63,4 +63,11 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
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
;
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.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
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.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
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
;
/**
/**
* 机构/部门/人员表 服务类
* 机构/部门/人员表 服务类
...
@@ -21,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...
@@ -21,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
public
interface
IOrgUsrService
{
public
interface
IOrgUsrService
{
/**
/**
* 查询上级单位
* 查询上级单位
*
* @param parent_id
* @param parent_id
* @return
* @return
*/
*/
...
@@ -28,6 +26,7 @@ public interface IOrgUsrService {
...
@@ -28,6 +26,7 @@ public interface IOrgUsrService {
/**
/**
* 获取父级
* 获取父级
*
* @param topId
* @param topId
* @param entityList
* @param entityList
* @param packageURL
* @param packageURL
...
@@ -44,6 +43,7 @@ public interface IOrgUsrService {
...
@@ -44,6 +43,7 @@ public interface IOrgUsrService {
/**
/**
* 获取子数据集合
* 获取子数据集合
*
* @param topId
* @param topId
* @param entityList
* @param entityList
* @param packageURL
* @param packageURL
...
@@ -60,6 +60,7 @@ public interface IOrgUsrService {
...
@@ -60,6 +60,7 @@ public interface IOrgUsrService {
/**
/**
* 组装融合调度单位人员信息
* 组装融合调度单位人员信息
*
* @param ids
* @param ids
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -68,6 +69,7 @@ public interface IOrgUsrService {
...
@@ -68,6 +69,7 @@ public interface IOrgUsrService {
/**
/**
* 获取动态表单数据
* 获取动态表单数据
*
* @param id
* @param id
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -76,17 +78,19 @@ public interface IOrgUsrService {
...
@@ -76,17 +78,19 @@ public interface IOrgUsrService {
/**
/**
* 保存 机构/部门/人员基本信息
* 保存 机构/部门/人员基本信息
*
* @param
* @param
* @throws Exception
* @throws Exception
*/
*/
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
;
void
saveOrgUsr
(
OrgUsr
orgUsr
,
OrgUsr
oriOrgUsr
)
throws
Exception
;
/**
/**
* 新增机构/部门/人员基本信息和动态表单数据
* 新增机构/部门/人员基本信息和动态表单数据
*
* @param orgUsr
* @param orgUsr
* @param alertFromValuelist
* @param alertFromValuelist
*/
*/
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
;
void
saveOrgUsrDynamicFormInstance
(
OrgUsr
orgUsr
,
List
<
DynamicFormInstance
>
alertFromValuelist
)
throws
Exception
;
/**
/**
* 更新机构/部门/人员基本信息和动态表单数据
* 更新机构/部门/人员基本信息和动态表单数据
...
@@ -95,32 +99,31 @@ public interface IOrgUsrService {
...
@@ -95,32 +99,31 @@ public interface IOrgUsrService {
* @param fromValueList 动态表单数据列表
* @param fromValueList 动态表单数据列表
* @throws Exception
* @throws Exception
*/
*/
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
throws
Exception
;
void
updateDynamicFormInstance
(
Long
instanceId
,
List
<
DynamicFormInstance
>
fromValueList
)
throws
Exception
;
/**
/**
*
* @param id
* @param id
* @throws Exception
* @throws Exception
*/
*/
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
;
Map
<
String
,
Object
>
selectForShowById
(
OrgUsr
orgUsr
,
Long
id
)
throws
Exception
;
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
List
<
OrgUsr
>
selectCompanyDepartmentMsg
();
void
saveOrgUsr
(
OrgUsrDto
OrgUsrDto
)
throws
Exception
;
void
saveOrgUsr
(
OrgUsrDto
OrgUsrDto
)
throws
Exception
;
void
saveOrgPerson
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
void
saveOrgPerson
(
OrgPersonDto
OrgPersonDto
)
throws
Exception
;
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgUsr
(
OrgUsrDto
OrgUsrDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgPerson
(
OrgPersonDto
OrgPersonDto
,
Long
id
)
throws
Exception
;
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
;
OrgUsrFormDto
selectCompanyById
(
Long
id
)
throws
Exception
;
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
;
IPage
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
String
bizOrgType
)
throws
Exception
;
void
saveDepartment
(
List
<
OrgDepartmentDto
>
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
void
saveDepartment
(
List
<
OrgDepartmentDto
>
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrDto
)
throws
Exception
;
void
saveCompany
(
List
<
OrgUsrDto
>
OrgUsrDto
)
throws
Exception
;
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
;
OrgPersonFormDto
selectPersonById
(
Long
id
)
throws
Exception
;
...
@@ -128,11 +131,11 @@ public interface IOrgUsrService {
...
@@ -128,11 +131,11 @@ public interface IOrgUsrService {
List
<
OrgMenuDto
>
selectPersonTree
()
throws
Exception
;
List
<
OrgMenuDto
>
selectPersonTree
()
throws
Exception
;
void
savePersonList
(
List
<
OrgPersonDto
>
OrgPersonDto
)
throws
Exception
;
void
savePersonList
(
List
<
OrgPersonDto
>
OrgPersonDto
)
throws
Exception
;
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
)
throws
Exception
;
void
saveOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
)
throws
Exception
;
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
void
updateByIdOrgDepartment
(
OrgDepartmentDto
OrgDepartmentDto
,
Long
id
)
throws
Exception
;
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
;
OrgDepartmentFormDto
selectDepartmentById
(
Long
id
)
throws
Exception
;
...
@@ -141,18 +144,19 @@ public interface IOrgUsrService {
...
@@ -141,18 +144,19 @@ public interface IOrgUsrService {
/**
/**
* * @param null
* * @param null
* @return
*
*
<PRE>
* @return
<PRE>
* author tw
* author tw
* date 2021/7/20
* date 2021/7/20
* </PRE>
* </PRE>
* 列表
* 列表
*/
*/
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
);
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
);
/**
/**
* * @param null
* * @param null
* @return
*
*
<PRE>
* @return
<PRE>
* author tw
* author tw
* date 2021/7/20
* date 2021/7/20
* </PRE>
* </PRE>
...
@@ -162,8 +166,8 @@ public interface IOrgUsrService {
...
@@ -162,8 +166,8 @@ public interface IOrgUsrService {
/**
/**
* * @param null
* * @param null
* @return
*
*
<PRE>
* @return
<PRE>
* author tw
* author tw
* date 2021/7/26
* date 2021/7/26
* </PRE>
* </PRE>
...
@@ -171,9 +175,27 @@ public interface IOrgUsrService {
...
@@ -171,9 +175,27 @@ public interface IOrgUsrService {
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
);
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
);
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
);
List
<
ESOrgUsrDto
>
selectByIddata
(
String
name
);
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
Map
<
String
,
Object
>>
getparent
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
List
<
OrgUsrExcelDto
>
exportToExcel
();
UserUnitDto
getUserUnit
(
String
id
,
String
type
,
String
code
);
/**
* 根据登陆人获取公司部门人员树
*/
List
<
OrgMenuDto
>
companyUserTreeByUser
(
AgencyUserModel
user
);
/**
* 根据登陆人获取公司部门树
*/
List
<
OrgMenuDto
>
companyTreeByUser
(
AgencyUserModel
user
);
/**
* 根据登陆人获取公司列表(关联重点部位)
*/
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"?>
<?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">
<!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"
>
<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>
</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 (
...
@@ -307,8 +307,28 @@ LEFT JOIN (
FROM important_companys
FROM important_companys
</select>
</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
id=
"exportToExcel"
resultType=
"com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto"
>
select
select
a.biz_org_name bizOrgName,
a.biz_org_name bizOrgName,
...
@@ -335,5 +355,49 @@ LEFT JOIN (
...
@@ -335,5 +355,49 @@ LEFT JOIN (
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null
on b.instance_id=a.sequence_nbr where a.biz_org_name is not null
</select>
</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>
</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 {
...
@@ -49,8 +49,6 @@ public class FailureAuditController extends BaseController {
}
}
}
}
/**
/**
* 根据sequenceNbr查询
* 根据sequenceNbr查询
*
*
...
@@ -64,35 +62,6 @@ public class FailureAuditController extends BaseController {
...
@@ -64,35 +62,6 @@ public class FailureAuditController extends BaseController {
return
ResponseHelper
.
buildResponse
(
failureAuditServiceImpl
.
queryBySeq
(
sequenceNbr
));
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 {
...
@@ -181,8 +181,8 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前状态任务数量"
,
notes
=
"查询当前状态任务数量"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前状态任务数量"
,
notes
=
"查询当前状态任务数量"
)
@GetMapping
(
value
=
"/list/count"
)
@GetMapping
(
value
=
"/list/count"
)
public
ResponseModel
<
List
<
FailureStatusCountDto
>>
selectStatusCount
(
@RequestParam
Integer
type
)
{
public
ResponseModel
<
Object
>
selectStatusCount
(
)
{
return
ResponseHelper
.
buildResponse
(
failureDetailsServiceImpl
.
queryStatusCount
(
type
));
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;
...
@@ -2,23 +2,23 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import
java.util.List
;
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
com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
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.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
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.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.FailureMaintainServiceImpl
;
...
@@ -59,71 +59,6 @@ public class FailureMaintainController extends BaseController {
...
@@ -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查询
*根据关联主表faultId查询
* @return
* @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
;
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.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -27,18 +8,25 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...
@@ -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.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
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.*
;
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.entity.OrgUsr
;
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.ESOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
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.Api
;
import
io.swagger.annotations.ApiOperation
;
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
;
/**
/**
...
@@ -106,7 +94,7 @@ public class OrgUsrController extends BaseController {
...
@@ -106,7 +94,7 @@ public class OrgUsrController extends BaseController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
return
ResponseHelper
.
buildResponse
(
null
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -135,48 +123,48 @@ public class OrgUsrController extends BaseController {
...
@@ -135,48 +123,48 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/selectByBizOrgType/{bizOrgType}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/selectByBizOrgType/{bizOrgType}"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据bizOrgType分页查询"
,
notes
=
"根据bizOrgType分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据bizOrgType分页查询"
,
notes
=
"根据bizOrgType分页查询"
)
public
ResponseModel
<
IPage
<
OrgUsr
>>
bizOrgTypeListPage
(
String
pageNum
,
String
pageSize
,
@PathVariable
String
bizOrgType
)
throws
Exception
{
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
* @param
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(key为物理主键)"
,
notes
=
"获取单位部门树(key为物理主键)\""
)
@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"
);
List
<
OrgMenuDto
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
/**
/**
*
* 获取单位部门树
* 获取单位部门树
*
* @param
* @param
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/orgTree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/orgTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(bizOrgCode为物理主键)"
,
notes
=
"获取单位部门树(bizOrgCode为物理主键)\""
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树(bizOrgCode为物理主键)"
,
notes
=
"获取单位部门树(bizOrgCode为物理主键)\""
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTreeCode
()
throws
Exception
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
selectCompanyTreeCode
()
throws
Exception
{
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyDepartmentMsg
());
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyDepartmentMsg
());
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
/**
/**
*
* 获取单位部门树
* 获取单位部门树
*
* @param
* @param
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/org/company/tree"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/org/company/tree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位树(bizOrgCode为物理主键)"
,
notes
=
"获取单位树(bizOrgCode为物理主键)"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位树(bizOrgCode为物理主键)"
,
notes
=
"获取单位树(bizOrgCode为物理主键)"
)
public
ResponseModel
<
List
<
OrgMenuDto
>>
getCompanyTree
()
{
public
ResponseModel
<
List
<
OrgMenuDto
>>
getCompanyTree
()
{
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyList
());
List
<
OrgMenuDto
>
menus
=
OrgUsrServiceImpl
.
buildTreeParallel
(
iOrgUsrService
.
selectCompanyList
());
return
ResponseHelper
.
buildResponse
(
menus
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
}
...
@@ -237,7 +225,7 @@ public class OrgUsrController extends BaseController {
...
@@ -237,7 +225,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/saveDepartment"
,
method
=
RequestMethod
.
POST
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"导入部门信息"
,
notes
=
"导入部门信息"
)
public
ResponseModel
<?>
saveDepartment
(
HttpServletRequest
request
,
@RequestBody
List
<
OrgDepartmentDto
>
OrgDepartmentVo
,
@PathVariable
Long
id
)
throws
Exception
{
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
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
...
@@ -263,8 +251,8 @@ public class OrgUsrController extends BaseController {
...
@@ -263,8 +251,8 @@ public class OrgUsrController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/{ids}/users"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{ids}/users"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>
>
selectUsersByOrgCode
(
HttpServletRequest
request
,
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectUsersByOrgCode
(
HttpServletRequest
request
,
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPersonMsg
(
ids
))
;
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPersonMsg
(
ids
));
}
}
/**
/**
...
@@ -277,13 +265,13 @@ public class OrgUsrController extends BaseController {
...
@@ -277,13 +265,13 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/company/{ids}/person"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/company/{ids}/person"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据id获取单位人员列表"
,
notes
=
"根据id获取单位人员列表"
)
public
ResponseModel
<
List
<
CompanyPerson
>>
selectCompanyPerson
(
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
public
ResponseModel
<
List
<
CompanyPerson
>>
selectCompanyPerson
(
@PathVariable
List
<
Long
>
ids
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPerson
(
ids
))
;
return
ResponseHelper
.
buildResponse
(
iOrgUsrService
.
returnCompanyPerson
(
ids
));
}
}
/**
/**
* 根据id获取单位人员列表
* 根据id获取单位人员列表
*
*
* @param
ids
* @param
amosUserId
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -296,7 +284,7 @@ public class OrgUsrController extends BaseController {
...
@@ -296,7 +284,7 @@ public class OrgUsrController extends BaseController {
/**
/**
* 根据名称模糊匹配
* 根据名称模糊匹配
*
*
* @param
id
* @param
name
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -309,7 +297,7 @@ public class OrgUsrController extends BaseController {
...
@@ -309,7 +297,7 @@ public class OrgUsrController extends BaseController {
/**
/**
* 根据名称模糊匹配
* 根据名称模糊匹配
*
*
* @param
id
* @param
name
* @return
* @return
*/
*/
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -320,7 +308,66 @@ public class OrgUsrController extends BaseController {
...
@@ -320,7 +308,66 @@ public class OrgUsrController extends BaseController {
}
}
/**
* 获取单位部门树
*
* @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
...
@@ -66,6 +66,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
QueryWrapper
<
DynamicFormColumn
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
DynamicFormColumn
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"group_code"
,
code
);
queryWrapper
.
eq
(
"group_code"
,
code
);
queryWrapper
.
eq
(
"is_delete"
,
false
);
queryWrapper
.
orderByAsc
(
"sort"
);
queryWrapper
.
orderByAsc
(
"sort"
);
List
<
DynamicFormColumn
>
dynamicFormColumn
=
this
.
list
(
queryWrapper
);
List
<
DynamicFormColumn
>
dynamicFormColumn
=
this
.
list
(
queryWrapper
);
List
<
DynamicFormInitDto
>
listForm
=
new
ArrayList
<
DynamicFormInitDto
>();
List
<
DynamicFormInitDto
>
listForm
=
new
ArrayList
<
DynamicFormInitDto
>();
...
@@ -161,6 +162,20 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
...
@@ -161,6 +162,20 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
vo
.
setSort
(
dynamicFormValue
.
getSort
());
vo
.
setSort
(
dynamicFormValue
.
getSort
());
listForm
.
add
(
vo
);
listForm
.
add
(
vo
);
break
;
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
:
default
:
vo
=
new
DynamicFormInitDto
(
dynamicForm
.
getFieldCode
(),
dynamicForm
.
getFieldName
(),
vo
=
new
DynamicFormInitDto
(
dynamicForm
.
getFieldCode
(),
dynamicForm
.
getFieldName
(),
dynamicForm
.
getFieldType
(),
new
SelectItems
(
new
ArrayList
<>()),
null
);
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
...
@@ -44,21 +44,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
@Autowired
FailureRepairlogServiceImpl
failureRepairlogService
;
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
...
@@ -75,23 +61,23 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDto
=
failureDetailsService
.
queryBySeq
(
model
.
getFaultId
());
int
auditResult
=
0
;
int
auditResult
=
0
;
Boolean
repairResult
=
null
;
//根据审核的结果进行业务操作
//根据审核的结果进行业务操作
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
()
&&
userInfo
.
getDepartment
().
getSequenceNbr
().
equals
(
failureDetailsDto
.
getBizCode
()))
{
auditResult
=
AuditResultEnum
.
AGREE
.
getCode
();
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
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
auditResult
=
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
()))
{
}
else
if
(
condition
==
(
AuditResultEnum
.
SEND_BACK
.
getCode
()))
{
auditResult
=
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
())
{
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
auditResult
=
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
(
"添加报修日志失败"
);
throw
new
Exception
(
"添加报修日志失败"
);
}
}
model
.
setAuditResult
(
auditResult
);
model
.
setAuditResult
(
auditResult
);
...
@@ -115,7 +101,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -115,7 +101,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
//当前角色部门id为维修部门的时候 修改状态
//当前角色部门id为维修部门的时候 修改状态
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setCurrentStatus
(
status
.
getCode
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
failureDetailsDto
.
setSequenceNbr
(
model
.
getFaultId
());
FailureDetailsDto
failureDetailsDtos
=
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
failureDetailsService
.
updateWithModel
(
failureDetailsDto
);
String
conditionText
;
String
conditionText
;
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
boolean
result
=
failureDetailsService
.
checkExcuteTaskAuth
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
);
...
@@ -124,19 +110,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -124,19 +110,18 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
Long
faultId
=
model
.
getFaultId
();
Long
faultId
=
model
.
getFaultId
();
Date
processTime
=
model
.
getAuditTime
();
Date
processTime
=
model
.
getAuditTime
();
String
processDepartment
=
model
.
getAuditDepartment
();
String
processDepartment
=
model
.
getAuditDepartment
();
// String processAuditor = model.getAuditor();
Integer
processAuditorId
=
Integer
.
parseInt
(
userInfo
.
getUserModel
().
getUserId
());
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
());
Long
auditDepartmentId
=
(
userInfo
.
getDepartment
().
getSequenceNbr
());
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
AGREE
.
getName
();
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
())
{
}
else
if
(
condition
==
AuditResultEnum
.
SEND_BACK
.
getCode
())
{
conditionText
=
AuditResultEnum
.
SEND_BACK
.
getName
();
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
())
{
}
else
if
(
condition
==
AuditResultEnum
.
REFUSE
.
getCode
())
{
conditionText
=
AuditResultEnum
.
REFUSE
.
getName
();
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
+
""
)){
if
(
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getProcessId
(),
userInfo
,
condition
+
""
)){
return
true
;
return
true
;
...
@@ -152,7 +137,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -152,7 +137,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
*/
*/
@Transactional
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
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
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
...
@@ -160,7 +145,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
...
@@ -160,7 +145,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
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;
...
@@ -2,23 +2,20 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Random
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
import
org.apache.commons.lang3.ObjectUtils
;
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.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -27,9 +24,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -27,9 +24,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
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.FailureDetails
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
import
com.yeejoin.amos.boot.module.common.api.entity.SourceFile
;
...
@@ -39,7 +33,6 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
...
@@ -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.IFailureDetailsService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.boot.module.common.biz.constats.Constants
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
/**
/**
* 服务实现类
* 服务实现类
...
@@ -72,43 +65,34 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -72,43 +65,34 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired
@Autowired
IFailureRepairlogService
failureRepairlog
;
IFailureRepairlogService
failureRepairlog
;
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交维修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureDetailsServiceImpl
.
class
);
public
static
String
EMERGENCY_COMMAND
=
"应急指挥科"
;
public
static
String
[]
PROCESS_NAME
=
{
"提交报修单"
,
"审核"
,
"维修"
,
"验收"
,
"维修中"
};
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_ALL
=
6
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_STATUS
=
7
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
public
static
Integer
SELECY_ISUBMIT
=
8
;
public
String
[]
roleName
=
{
""
,
""
};
/**
/**
* 分页查询
* 分页查询
*/
*/
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
public
IPage
<
FailureDetails
>
queryAllPage
(
long
size
,
long
current
)
{
/*QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
Page
pages
=
new
Page
<>(
current
,
size
);
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
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
IPage
iPage
=
page
(
pages
,
lambdaQueryWrapper
);
return
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
,
public
IPage
<
FailureDetails
>
queryForFailureDetailsPage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
,
Integer
type
)
{
Integer
type
)
{
if
(
type
.
equals
(
SELECY_ALL
))
{
if
(
type
.
equals
(
SELECY_ALL
))
{
return
this
.
queryAllPage
(
page
.
getSize
(),
page
.
getCurrent
()
);
return
this
.
baseMapper
.
selectAllPage
(
page
);
}
}
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
return
queryFor
Page
(
page
,
userInfo
.
getUserModel
().
getUserId
());
return
baseMapper
.
selectISub
Page
(
page
,
userInfo
.
getUserModel
().
getUserId
());
}
}
return
this
.
queryForWaitManage
(
page
,
userInfo
.
getUserModel
().
getUserId
()
);
return
this
.
queryForWaitManage
(
page
,
userInfo
);
}
}
/**
/**
...
@@ -118,15 +102,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -118,15 +102,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
submissionPid
==
null
)
{
if
(
submissionPid
==
null
)
{
return
null
;
return
null
;
}
}
/* QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
Page
pages
=
new
Page
<>(
page
.
getCurrent
(),
page
.
getSize
());
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
<
FailureDetails
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
();
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper
.
eq
(
FailureDetails:
:
getSubmissionPid
,
submissionPid
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
lambdaQueryWrapper
.
orderByDesc
(
FailureDetails:
:
getSubmissionTime
);
return
page
(
pages
,
lambdaQueryWrapper
);
return
page
(
pages
,
lambdaQueryWrapper
);
}
}
...
@@ -134,20 +112,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -134,20 +112,17 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
/**
* 待处理分页查询
* 待处理分页查询
*/
*/
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
String
submissionPid
)
{
public
IPage
<
FailureDetails
>
queryForWaitManage
(
Page
<
FailureDetails
>
page
,
ReginParams
userInfo
)
{
if
(
submissionPid
==
null
)
{
/* if (userInfo.getRole().getRoleName().equals())*/
/* if (submissionPid == null) {
return null;
return null;
}
}
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper
.
notIn
(
FailureDetails:
:
getCurrentStatus
,
FailureStatuEnum
.
REFUSE
.
getCode
(),
FailureStatuEnum
.
FINISH
.
getCode
()
lambdaQueryWrapper.notIn(FailureDetails::getCurrentStatus,
FailureStatuEnum.REFUSE.getCode(), FailureStatuEnum.FINISH.getCode()
).orderByDesc(FailureDetails::getSubmissionTime);
).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());
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return
baseMapper
.
selectPage
(
failureDetailsPage
,
lambdaQueryWrapper
);
return baseMapper.selectPage(failureDetailsPage, lambdaQueryWrapper);*/
return
baseMapper
.
selectInProcessing
(
page
);
}
}
...
@@ -187,77 +162,25 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -187,77 +162,25 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
if
(
currentStatus
.
equals
(
list
.
get
(
i
).
getCode
()))
{
status
=
list
.
get
(
i
).
getName
();
status
=
list
.
get
(
i
).
getName
();
}
}
;
}
}
/* FailureStatuEnum[] failureStatuEnums = new FailureStatuEnum []{}; */
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureDetails
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
queryWrapper
.
eq
(
"current_status"
,
status
).
orderByDesc
(
"submission_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
return
baseMapper
.
selectList
(
queryWrapper
);
}
}
/**
/**
* 查询任务状态数量
* 查询任务状态数量
*/
*/
public
List
<
FailureStatusCountDto
>
queryStatusCount
(
Integer
type
)
{
public
List
<
CurrentStatusDto
>
queryStatusCount
()
{
List
<
FailureDetailsDto
>
failureDetailsDtos
=
new
ArrayList
<>();
List
<
StatusDto
>
statusDtos
=
baseMapper
.
selectStatusCount
();
if
(
type
.
equals
(
SELECY_ALL
))
{
List
<
CurrentStatusDto
>
currentStatusDtoList
=
new
ArrayList
<>();
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
statusDtos
.
forEach
(
e
->{
}
CurrentStatusDto
currentStatusDto
=
new
CurrentStatusDto
();
if
(
type
.
equals
(
SELECY_ISUBMIT
))
{
currentStatusDto
.
setCutrentStatusCount
(
e
.
getCurrentStatusCount
());
failureDetailsDtos
=
this
.
queryForFailureDetailsList
();
currentStatusDto
.
setCutrentStatusName
(
Constants
.
currentStatusNameMap
.
get
(
e
.
getCurrentStatus
()));
}
currentStatusDtoList
.
add
(
currentStatusDto
);
int
auditStatus
=
0
;
});
int
submitStatus
=
0
;
return
currentStatusDtoList
;
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
;
}
}
/**
/**
...
@@ -267,6 +190,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -267,6 +190,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*/
*/
@Transactional
@Transactional
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
public
Object
savemodel
(
FailureDetailsDto
failureDetailsDto
,
ReginParams
userInfo
)
throws
Exception
{
if
(
null
!=
failureDetailsDto
.
getSequenceNbr
())
{
return
updatetoModel
(
failureDetailsDto
,
userInfo
);
}
String
businessKey
=
buildOrderNo
();
String
businessKey
=
buildOrderNo
();
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"businessKey"
,
businessKey
);
body
.
put
(
"businessKey"
,
businessKey
);
...
@@ -288,8 +215,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -288,8 +215,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 发起主表流程 并添加至报修日志
// 发起主表流程 并添加至报修日志
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setSubmissionTime
(
new
Date
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setFailureCode
(
buildOrderNo
());
failureDetailsDto
.
setSubmissionName
(
userInfo
.
getUserModel
().
getRealName
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureDetailsDto
.
setBizCode
(
userInfo
.
getDepartment
().
getSequenceNbr
());
failureDetailsDto
.
setIsDelete
(
false
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
model
=
this
.
createWithModel
(
failureDetailsDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureDetailsDto
.
getAttachment
()))
{
...
@@ -297,19 +224,49 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -297,19 +224,49 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto
.
getAttachment
());
failureDetailsDto
.
getAttachment
());
}
}
// 添加至报修日志
// 添加至报修日志
Long
faultId
=
model
.
getSequenceNbr
();
Long
faultId
=
model
.
getSequenceNbr
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
Integer
processAuditorId
=
model
.
getSubmissionPid
();
String
processResult
=
"提交报修单"
;
String
processResult
=
"提交报修单"
;
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
String
processDepartment
=
userInfo
.
getDepartment
().
getDepartmentName
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Long
departmentId
=
userInfo
.
getDepartment
().
getSequenceNbr
();
Date
processTime
=
model
.
getSubmissionTime
();
Date
processTime
=
model
.
getSubmissionTime
();
String
processAuditorCid
=
userInfo
.
getRole
().
getRoleName
();
String
processAuditorName
=
failureDetailsDto
.
getSubmissionName
();
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorCid
);
repairlog
(
faultId
,
processAuditorId
,
departmentId
,
processTime
,
processDepartment
,
processResult
,
processAuditorName
);
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
))
{
return
true
;
}
else
{
throw
new
Exception
(
"执行流程失败"
);
}
if
(
excuteTask
(
instance
.
getString
(
"id"
),
userInfo
,
null
)){
}
/**
* 更新故障保修单
*/
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
;
return
true
;
}
else
{
}
else
{
throw
new
Exception
(
"执行流程失败"
);
throw
new
Exception
(
"执行流程失败"
);
}
}
...
@@ -320,7 +277,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -320,7 +277,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*/
*/
@Transactional
@Transactional
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
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
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
failureRepairlogDto
.
setProcessAuditorId
(
processAuditorId
);
...
@@ -328,7 +285,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -328,7 +285,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditorCid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditorName
(
processAuditorName
);
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
FailureRepairlogDto
repairlogModel
=
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
if
(
ObjectUtils
.
isNotEmpty
(
repairlogModel
))
{
return
true
;
return
true
;
...
@@ -362,7 +319,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
...
@@ -362,7 +319,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
*
*
* @param sequenceNbr
* @param sequenceNbr
* @param userInfo
* @param userInfo
* @return
* @return
*/
*/
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
public
boolean
excuteTaskOnlyOperation
(
Long
sequenceNbr
,
ReginParams
userInfo
)
{
...
...
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,
...
@@ -76,8 +76,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
WorkflowFeignService
workflowFeignService
;
WorkflowFeignService
workflowFeignService
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
static
String
RECORE_TYPE
=
"维修记录"
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FailureMaintainServiceImpl
.
class
);
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
String
[]
MAINTENANCE_STATUS
=
{
"维修完成"
,
"维修中"
};
private
static
int
MAINTENANCE_COMPLETE
=
0
;
private
static
int
MAINTENANCE_COMPLETE
=
0
;
...
@@ -86,25 +84,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -86,25 +84,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
private
static
String
[]
PROCESS_RESULT
=
{
"验证通过"
,
"验证未通过"
};
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,
...
@@ -132,10 +112,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
String
processResult
=
MAINTENANCE_STATUS
[
1
];
// 维修中
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
failureMaintainDto
.
getAttachment
());
...
@@ -179,10 +159,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -179,10 +159,10 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
// 添加报修日志
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
String
processResult
=
MAINTENANCE_STATUS
[
0
];
// 维修完成
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
Integer
processAuditorId
=
Integer
.
parseInt
(
failureMaintainDto
.
getRecUserId
());
String
processAuditor
Cid
=
userInfo
.
getRole
().
getRole
Name
();
String
processAuditor
Name
=
userInfo
.
getUserModel
().
getReal
Name
();
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
repairlog
(
failureMaintainDto
.
getFaultId
(),
processAuditorId
,
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
userInfo
.
getDepartment
().
getSequenceNbr
(),
failureMaintainDto
.
getMaintainTime
(),
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Cid
);
failureMaintainDto
.
getDepartment
(),
processResult
,
processAuditor
Name
);
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureMaintainDto
.
getAttachment
()))
{
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
sourceFileServiceImpl
.
saveSourceFile
(
failureMaintainDto
.
getSequenceNbr
(),
failureMaintainDto
.
getAttachment
());
failureMaintainDto
.
getAttachment
());
...
@@ -195,55 +175,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -195,55 +175,6 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
return
true
;
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查询
* 根据FaultId查询
...
@@ -273,9 +204,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -273,9 +204,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
* 添加报修日志
* 添加报修日志
*/
*/
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
public
Boolean
repairlog
(
Long
faultId
,
Integer
processAuditorId
,
Long
departmentId
,
Date
processTime
,
Date
processTime
,
String
processDepartment
,
String
processResult
,
String
processAuditorName
)
{
String
processDepartment
,
String
processResult
,
String
processAuditorCid
)
{
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
FailureRepairlogDto
failureRepairlogDto
=
new
FailureRepairlogDto
();
failureRepairlogDto
.
setFaultId
(
faultId
);
failureRepairlogDto
.
setFaultId
(
faultId
);
...
@@ -284,7 +213,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
...
@@ -284,7 +213,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processAuditorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processAuditorName
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
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
...
@@ -66,33 +66,21 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
}
}
Boolean
repairResult
=
null
;
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
()))
{
if
(
condition
==
(
AuditResultEnum
.
REFUSE
.
getCode
()))
{
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
verifyResult
=
AuditResultEnum
.
REFUSE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
REFUSE
,
userInfo
,
condition
);
}
/*else if (condition == (AuditResultEnum.SEND_BACK.getCode())) {
}
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
verifyResult = AuditResultEnum.SEND_BACK.getCode();
Boolean repairResult = updateStatus(model, FailureStatuEnum.WAITING_SUBMIT, userInfo, condition);
} */
else
if
(
condition
==
AuditResultEnum
.
AGREE
.
getCode
())
{
verifyResult
=
AuditResultEnum
.
AGREE
.
getCode
();
verifyResult
=
AuditResultEnum
.
AGREE
.
getCode
();
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
repairResult
=
updateStatus
(
model
,
FailureStatuEnum
.
FINISH
,
userInfo
,
condition
);
}
}
model
.
setVerifyResult
(
verifyResult
);
model
.
setVerifyResult
(
verifyResult
);
List
<
FailureVerify
>
byfaultId
=
findByfaultId
(
failureDetailsDto
.
getSequenceNbr
());
/* if (byfaultId.size() == 0) {
this.createWithModel(model);
} else {*/
this
.
createWithModel
(
model
);
this
.
createWithModel
(
model
);
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
,
condition
+
""
))
{
if
(!
failureDetailsService
.
excuteTask
(
failureDetailsDto
.
getSequenceNbr
(),
userInfo
,
condition
+
""
))
{
throw
new
Exception
(
"执行流程失败"
);
throw
new
Exception
(
"执行流程失败"
);
}
}
/* }*/
return
true
;
return
true
;
}
}
...
@@ -154,7 +142,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -154,7 +142,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessTime
(
processTime
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessDepartment
(
processDepartment
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessResult
(
processResult
);
failureRepairlogDto
.
setProcessAuditor
Cid
(
processVerifyorCid
);
failureRepairlogDto
.
setProcessAuditor
Name
(
processVerifyorCid
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
failureRepairlogService
.
createWithModel
(
failureRepairlogDto
);
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
if
(
ObjectUtils
.
isNotEmpty
(
failureRepairlogDto
))
{
return
true
;
return
true
;
...
@@ -166,7 +154,6 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
...
@@ -166,7 +154,6 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
* 根据FaultId查询
* 根据FaultId查询
*/
*/
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
public
List
<
FailureVerify
>
findByfaultId
(
Long
faultId
)
{
Page
<
FailureVerify
>
page
=
new
Page
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
FailureVerify
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
queryWrapper
.
eq
(
"fault_id"
,
faultId
).
orderByDesc
(
"verify_time"
);
return
baseMapper
.
selectList
(
queryWrapper
);
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;
...
@@ -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.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
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.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.feign.SupervisionFeign
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
@@ -27,13 +30,7 @@ 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
javax.annotation.Resource
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.*
;
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.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -55,6 +52,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -55,6 +52,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
SupervisionFeign
supervisionFeign
;
SupervisionFeign
supervisionFeign
;
@Autowired
@Autowired
ESOrgUsrService
eSOrgUsrService
;
ESOrgUsrService
eSOrgUsrService
;
@Override
@Override
public
String
selectUpUnitByParam
(
String
id
)
{
public
String
selectUpUnitByParam
(
String
id
)
{
return
this
.
baseMapper
.
selectUpUnitByParam
(
id
);
return
this
.
baseMapper
.
selectUpUnitByParam
(
id
);
...
@@ -133,13 +131,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -133,13 +131,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// resultList.add(menu);
// resultList.add(menu);
// }
// }
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start******************************/
/* *******************topId与parentId的等值判断,修改人陈浩 on 2021/07/21---start******************************/
if
(
parentId
==
null
)
{
//topId与parentId的等值判断,修改人陈浩 on 2021/07/21
if
(
parentId
==
null
)
{
//topId与parentId的等值判断,修改人陈浩 on 2021/07/21
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
resultList
.
add
(
menu
);
resultList
.
add
(
menu
);
}
else
if
(
topId
!=
null
&&
topId
.
longValue
()
==
parentId
.
longValue
())
}
else
if
(
topId
!=
null
&&
topId
.
longValue
()
==
parentId
.
longValue
())
{
{
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
OrgMenuDto
menu
=
new
OrgMenuDto
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
...
@@ -444,11 +441,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -444,11 +441,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List
<
Long
>
deleteList
=
new
ArrayList
<>();
List
<
Long
>
deleteList
=
new
ArrayList
<>();
fromValueList
.
parallelStream
().
forEach
(
submitFormItem
->
{
fromValueList
.
parallelStream
().
forEach
(
submitFormItem
->
{
if
(
resourceMap
.
containsKey
(
submitFormItem
.
getFormColumnId
()))
{
if
(
resourceMap
.
containsKey
(
submitFormItem
.
getFormColumnId
()))
{
DynamicFormInstanceDto
oldForm
=
resourceMap
.
get
(
submitFormItem
.
getFormColumnId
());
DynamicFormInstanceDto
oldForm
=
resourceMap
.
get
(
submitFormItem
.
getFormColumnId
());
submitFormItem
.
setSequenceNbr
(
oldForm
.
getSequenceNbr
());
submitFormItem
.
setSequenceNbr
(
oldForm
.
getSequenceNbr
());
updateList
.
add
(
submitFormItem
);
updateList
.
add
(
submitFormItem
);
}
else
{
}
else
{
addList
.
add
(
submitFormItem
);
addList
.
add
(
submitFormItem
);
}
}
newResourceMap
.
put
(
submitFormItem
.
getFormColumnId
(),
submitFormItem
);
newResourceMap
.
put
(
submitFormItem
.
getFormColumnId
(),
submitFormItem
);
...
@@ -563,9 +560,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -563,9 +560,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
public
void
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
public
void
saveOrgPersonExcel
(
OrgUsrExcelDto
OrgPersonVo
)
throws
Exception
{
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
orgUsr
=
new
OrgUsr
();
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
...
@@ -580,7 +574,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -580,7 +574,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
OrgPersonVo
.
setAmosOrgCode
(
user
.
getRealName
());
...
@@ -771,9 +764,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -771,9 +764,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
}
@Override
@Override
public
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
)
{
public
List
<
CompanyDto
>
listContractDto
(
Integer
pageNum
,
Integer
pageSize
,
RequestData
requestData
)
{
if
(
null
==
pageNum
||
null
==
pageSize
)
{
if
(
null
==
pageNum
||
null
==
pageSize
)
{
...
@@ -787,14 +777,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -787,14 +777,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
@Override
public
Integer
listContractDtoCount
(
RequestData
par
)
{
public
Integer
listContractDtoCount
(
RequestData
par
)
{
return
orgUsrMapper
.
listContractDtoCount
(
par
);
return
orgUsrMapper
.
listContractDtoCount
(
par
);
}
}
public
static
String
getOrgCodeStr
()
{
public
static
String
getOrgCodeStr
()
{
return
TreeParser
.
genTreeCode
();
return
TreeParser
.
genTreeCode
();
}
}
...
@@ -949,7 +935,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -949,7 +935,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
}
}
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
)
{
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
)
{
return
this
.
queryForList
(
null
,
false
,
parentId
,
bizOrgType
);
return
this
.
queryForList
(
null
,
false
,
parentId
,
bizOrgType
);
}
}
...
@@ -961,14 +947,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -961,14 +947,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
this
.
queryBySeq
(
Long
.
valueOf
(
person
.
getParentId
()));
return
this
.
queryBySeq
(
Long
.
valueOf
(
person
.
getParentId
()));
}
}
public
OrgUsrDto
queryForListByParentIdAndOrgType
(
String
amosOrgId
)
{
public
OrgUsrDto
queryForListByParentIdAndOrgType
(
String
amosOrgId
)
{
return
this
.
queryModelByParams
(
amosOrgId
);
return
this
.
queryModelByParams
(
amosOrgId
);
}
}
@Override
@Override
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
public
List
<
OrgUsrzhDto
>
getOrgUsrzhDto
(
String
name
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
List
<
OrgUsrzhDto
>
list
=
orgUsrMapper
.
getOrgUsrzhDto
(
name
);
return
list
;
return
list
;
}
}
...
@@ -977,16 +963,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -977,16 +963,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
//获取所有单位
//获取所有单位
QueryWrapper
<
OrgUsr
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
OrgUsr
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
in
(
"biz_org_type"
,
"DEPARTMENT"
,
"COMPANY"
);
wrapper
.
in
(
"biz_org_type"
,
"DEPARTMENT"
,
"COMPANY"
);
wrapper
.
eq
(
"is_delete"
,
0
);
wrapper
.
eq
(
"is_delete"
,
0
);
if
(
name
!=
null
&&
!
""
.
equals
(
name
))
{
if
(
name
!=
null
&&
!
""
.
equals
(
name
))
{
wrapper
.
like
(
"biz_org_name"
,
name
);
wrapper
.
like
(
"biz_org_name"
,
name
);
}
}
List
<
OrgUsr
>
list
=
this
.
list
(
wrapper
);
List
<
OrgUsr
>
list
=
this
.
list
(
wrapper
);
List
<
ESOrgUsrDto
>
lidataDtos
=
new
ArrayList
();
List
<
ESOrgUsrDto
>
lidataDtos
=
new
ArrayList
();
list
.
forEach
(
orgUsr
->
{
list
.
forEach
(
orgUsr
->
{
ESOrgUsrDto
data
=
new
ESOrgUsrDto
();
ESOrgUsrDto
data
=
new
ESOrgUsrDto
();
data
.
setSequenceNbr
(
orgUsr
.
getSequenceNbr
());
data
.
setSequenceNbr
(
orgUsr
.
getSequenceNbr
());
data
.
setBizOrgName
(
orgUsr
.
getBizOrgName
());
data
.
setBizOrgName
(
orgUsr
.
getBizOrgName
());
lidataDtos
.
add
(
data
);
lidataDtos
.
add
(
data
);
...
@@ -1004,13 +990,251 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
...
@@ -1004,13 +990,251 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
orgUsrMapper
.
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
()
{
public
List
<
OrgUsr
>
getCompanyDetailTree
()
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<
OrgUsr
>();
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
wrapper
.
eq
(
OrgUsr:
:
getBizOrgType
,
"COMPANY"
);
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
wrapper
.
eq
(
OrgUsr:
:
getIsDelete
,
false
);
return
this
.
baseMapper
.
selectList
(
wrapper
);
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;
...
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
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.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -27,7 +28,6 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -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.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
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.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -294,6 +294,7 @@ public class AlertCalledController extends BaseController {
...
@@ -294,6 +294,7 @@ public class AlertCalledController extends BaseController {
@PostMapping
(
value
=
"/billsend"
)
@PostMapping
(
value
=
"/billsend"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备联动紧急响应"
,
notes
=
"启动所有消防队伍的警铃、广播,并自动开启所有车库门"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"设备联动紧急响应"
,
notes
=
"启动所有消防队伍的警铃、广播,并自动开启所有车库门"
)
@Transactional
@Transactional
@RestEventTrigger
(
value
=
"opreateLogEventHandler"
)
public
ResponseModel
<
Boolean
>
controlEquip
()
throws
Exception
{
public
ResponseModel
<
Boolean
>
controlEquip
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iAlertCalledService
.
controlEquip
());
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 @@
...
@@ -13,7 +13,21 @@
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<dependencies>
<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>
</dependencies>
<modules>
<modules>
...
...
amos-boot-system-jcs/src/main/resources/application.properties
View file @
c19ca472
spring.application.name
=
JCS_chenhao
spring.application.name
=
JCS_cz
server.servlet.context-path
=
/jcs
server.port
=
11100
server.port
=
11100
spring.profiles.active
=
dev
spring.profiles.active
=
dev
...
...
amos-boot-system-maintenance/src/main/resources/db/changelog/mt-sql-task.xml
View file @
c19ca472
...
@@ -24,6 +24,12 @@
...
@@ -24,6 +24,12 @@
end if;
end if;
END
END
</createProcedure>
</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>
</changeSet>
</databaseChangeLog>
</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