Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
138a4d88
Commit
138a4d88
authored
Jun 25, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
3e8de69d
fbd64cc4
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
3128 additions
and
2085 deletions
+3128
-2085
BusinessTypeEnum.java
...join/amos/boot/module/hygf/api/Enum/BusinessTypeEnum.java
+44
-0
FlowStatusEnum.java
...eejoin/amos/boot/module/hygf/api/Enum/FlowStatusEnum.java
+88
-0
TaskStatusEnum.java
...eejoin/amos/boot/module/hygf/api/Enum/TaskStatusEnum.java
+107
-0
TaskModelDto.java
...m/yeejoin/amos/boot/module/hygf/api/dto/TaskModelDto.java
+110
-0
HouseholdContract.java
...n/amos/boot/module/hygf/api/entity/HouseholdContract.java
+4
-0
JsonUtils.java
...com/yeejoin/amos/boot/module/hygf/api/util/JsonUtils.java
+40
-0
FinancingInfoMapper.xml
...i/src/main/resources/mapper/mysql/FinancingInfoMapper.xml
+6
-3
HouseholdContractMapper.xml
...c/main/resources/mapper/mysql/HouseholdContractMapper.xml
+39
-32
pom.xml
amos-boot-system-jxiop/amos-boot-module-hygf-biz/pom.xml
+5
-0
AmosHygfApplication.java
...z/src/main/java/com/yeejoin/amos/AmosHygfApplication.java
+1
-2
DataSourceConfiguration.java
.../boot/module/hygf/biz/config/DataSourceConfiguration.java
+118
-73
MysqlServerConfig.java
...n/amos/boot/module/hygf/biz/config/MysqlServerConfig.java
+6
-5
TDengineServerConfig.java
...mos/boot/module/hygf/biz/config/TDengineServerConfig.java
+23
-1
TaskV2FeignService.java
...n/amos/boot/module/hygf/biz/feign/TaskV2FeignService.java
+78
-0
AcceptanceRectificationOrderServiceImpl.java
...service/impl/AcceptanceRectificationOrderServiceImpl.java
+2
-1
AcceptanceServiceImpl.java
...t/module/hygf/biz/service/impl/AcceptanceServiceImpl.java
+2
-1
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+38
-2
CommonServiceImpl.java
.../boot/module/hygf/biz/service/impl/CommonServiceImpl.java
+365
-0
FinancingInfoServiceImpl.java
...odule/hygf/biz/service/impl/FinancingInfoServiceImpl.java
+144
-107
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+2
-1
SurveyInformationServiceImpl.java
...e/hygf/biz/service/impl/SurveyInformationServiceImpl.java
+603
-601
UnitInfoServiceImpl.java
...oot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
+17
-14
WorkOrderServiceImpl.java
...ot/module/hygf/biz/service/impl/WorkOrderServiceImpl.java
+1
-2
WorkflowImpl.java
.../amos/boot/module/hygf/biz/service/impl/WorkflowImpl.java
+1
-0
application-dev.properties
...le-hygf-biz/src/main/resources/application-dev.properties
+11
-3
application.properties
...module-hygf-biz/src/main/resources/application.properties
+5
-4
file.conf
...op/amos-boot-module-hygf-biz/src/main/resources/file.conf
+1
-1
logback-dev.xml
...s-boot-module-hygf-biz/src/main/resources/logback-dev.xml
+8
-8
PersonBasicMapper.java
.../amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
+27
-23
PersonBasicMapper.xml
...jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
+18
-0
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+6
-4
PersonQrCodeController.java
...t/module/jxiop/biz/controller/PersonQrCodeController.java
+19
-11
StationCacheInfoDto.java
...n/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
+2
-0
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+4
-2
MonitorServiceImpl.java
...oot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
+8
-3
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+5
-3
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+847
-862
pom.xml
pom.xml
+323
-316
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/BusinessTypeEnum.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
/**
* 业务类型枚举
*
* @author Administrator
*/
public
enum
BusinessTypeEnum
{
/**
* 业务类型枚举
*/
HYGF_JXS_SH
(
"JXS_SH"
,
"经销商审核"
),
HYGF_DZ_SH
(
"hygf_10001"
,
"电站审核"
),
HYGF_BWYS
(
"hygf_bwys"
,
"并网验收"
),
HYGF_DZTRRZ
(
"StationFinancing"
,
"电站投融资流程"
);
private
final
String
code
;
private
final
String
name
;
BusinessTypeEnum
(
String
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByType
(
String
code
)
{
String
name
=
null
;
for
(
BusinessTypeEnum
enumOne
:
BusinessTypeEnum
.
values
())
{
if
(
enumOne
.
getCode
().
equals
(
code
))
{
name
=
enumOne
.
getName
();
break
;
}
}
return
name
;
}
public
String
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/FlowStatusEnum.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
lombok.Getter
;
/**
* 流程办理状态统一枚举
*/
@Getter
public
enum
FlowStatusEnum
{
/**
* 已转办
*/
TO_BE_TRANSFER
(
6621
,
"已转办"
),
/**
* 待提交
*/
TO_BE_SUBMITTED
(
6610
,
"待提交"
),
/**
* 检测检测专用 已废弃 勿删
* */
@Deprecated
TO_SUBMITTED
(
6611
,
"待受理"
),
/**
* 待受理
*/
TO_BE_PROCESSED
(
6612
,
"待受理"
),
/**
* 已驳回
*/
REJECTED
(
6614
,
"已驳回"
),
/**
* 已撤回
*/
ROLLBACK
(
6615
,
"已撤回"
),
/**
* 已完成
*/
TO_BE_FINISHED
(
6616
,
"已完成"
),
/**
* 已作废
*/
TO_BE_DISCARD
(
6617
,
"已作废"
);
private
final
int
code
;
private
final
String
name
;
FlowStatusEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByType
(
Long
code
)
{
String
name
=
null
;
for
(
FlowStatusEnum
enumOne
:
FlowStatusEnum
.
values
())
{
if
(
enumOne
.
getCode
()
==
code
)
{
name
=
enumOne
.
getName
();
break
;
}
}
return
name
;
}
public
static
FlowStatusEnum
getEumByCode
(
int
code
)
{
for
(
FlowStatusEnum
statusEnum
:
FlowStatusEnum
.
values
())
{
if
(
statusEnum
.
getCode
()
==
code
)
{
return
statusEnum
;
}
}
return
null
;
}
public
static
FlowStatusEnum
getEumByName
(
String
name
)
{
for
(
FlowStatusEnum
statusEnum
:
FlowStatusEnum
.
values
())
{
if
(
statusEnum
.
getName
().
equals
(
name
))
{
return
statusEnum
;
}
}
return
null
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/TaskStatusEnum.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <pre>
* 任务状态枚举
* </pre>
* @author my
*
*/
public
enum
TaskStatusEnum
{
UNDERWAY
(
"处理中"
,
0
),
FINISHED
(
"已完成"
,
1
),
CANCEL
(
"已取消"
,
2
),
OVERTIME
(
"已超时"
,
3
);
/**
* 名称
*/
private
String
name
;
/**
* 值
*/
private
int
value
;
private
TaskStatusEnum
(
String
name
,
int
value
)
{
this
.
name
=
name
;
this
.
value
=
value
;
}
public
static
String
getName
(
int
value
)
{
for
(
TaskStatusEnum
c
:
TaskStatusEnum
.
values
())
{
if
(
c
.
getValue
()
==
value
)
{
return
c
.
name
;
}
}
return
null
;
}
public
static
int
getValue
(
String
name
)
{
for
(
TaskStatusEnum
c
:
TaskStatusEnum
.
values
())
{
if
(
c
.
getName
().
equals
(
name
))
{
return
c
.
value
;
}
}
return
-
1
;
}
public
static
TaskStatusEnum
getEnum
(
int
value
)
{
for
(
TaskStatusEnum
c
:
TaskStatusEnum
.
values
())
{
if
(
c
.
getValue
()
==
value
)
{
return
c
;
}
}
return
null
;
}
public
static
TaskStatusEnum
getEnum
(
String
name
)
{
for
(
TaskStatusEnum
c
:
TaskStatusEnum
.
values
())
{
if
(
c
.
getName
().
equals
(
name
))
{
return
c
;
}
}
return
null
;
}
public
static
List
<
Map
<
String
,
String
>>
getEnumList
()
{
List
<
Map
<
String
,
String
>>
nameList
=
new
ArrayList
<>();
for
(
TaskStatusEnum
c:
TaskStatusEnum
.
values
())
{
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
map
.
put
(
"name"
,
c
.
getName
());
map
.
put
(
"value"
,
c
.
getValue
()
+
""
);
nameList
.
add
(
map
);
}
return
nameList
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getValue
()
{
return
value
;
}
public
void
setValue
(
int
value
)
{
this
.
value
=
value
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/TaskModelDto.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
* @author Administrator
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
TaskModelDto
{
/**
* 工作流创建时间
*/
private
Date
flowCreateDate
;
/**
* 工作流返回节点名称
*/
private
String
taskName
;
/**
* 任务编号 可以使用申请单编号
*/
private
String
taskCode
;
/**
* 流程任务ID
*/
private
String
flowCode
;
/**
* 统一定义的枚举code 例如 6612 待受理
*/
private
Integer
flowStatus
;
/**
* 统一定义的枚举code 例如 6612 待受理
*/
private
String
flowStatusLabel
;
/**
* 摘要-来源
*/
private
String
taskContent
;
/**
* 描述-非必输
*/
private
String
taskDesc
;
/**
* 任务类型 从BusinessTypeEnum中获取自己对应类型code
**/
private
String
taskType
;
/**
* 任务类型名称 汉字 从BusinessTypeEnum中获取自己对应类型名称
**/
private
String
taskTypeLabel
;
/***
* 关联id 传工作流实例id
* */
private
String
relationId
;
/**
* 执行人id 从工作流中获取
**/
private
String
executeUserIds
;
/**
* 任务状态 操作名称 0 待处理 1驳回 2通过 3重新提交
*/
private
Integer
taskStatus
;
/**
* 任务状态 操作名称 0 待处理 1驳回 2通过 3重新提交
*/
private
String
taskStatusLabel
;
/**
* 任务发起人id 不变 第一次提交的人
* 从业务表中 created_uesr_id
*/
private
String
startUserId
;
/**
* 任务发起人名称 不变
* 名字
*/
private
String
startUser
;
/**
* 任务发起人所在单位 不变
*/
private
String
startUserCompanyName
;
/**
* 任务发起人发起时间 不变
*/
private
Date
startDate
;
/**
* 跳转路径
*/
private
String
routePath
;
/**
* 当前业务实体对象
*/
private
Object
model
;
/**
* 下一节点执行角色
*/
private
String
nextExecuteUser
;
/**
* 是否跳转编辑页面
* */
private
String
pageType
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/HouseholdContract.java
View file @
138a4d88
...
...
@@ -253,4 +253,8 @@ public class HouseholdContract extends BaseEntity {
//合同填充字段值
@TableField
(
exist
=
false
)
List
<
ContractFillData
>
contractFillData
;
//查询一个农户拥有的合同是否全是已废弃
@TableField
(
exist
=
false
)
private
Boolean
isAllDisuse
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/JsonUtils.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.core.io.Resource
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
alibaba
.
fastjson
.
JSON
.
parseArray
;
public
class
JsonUtils
{
//将json文件转化为Map<list<Map<>>>
public
static
Map
getResourceJson
(
Resource
resource
)
{
String
json
=
null
;
try
{
json
=
IOUtils
.
toString
(
resource
.
getInputStream
(),
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
resource
+
"json文件转化失败"
);
}
return
JSONObject
.
parseObject
(
json
,
Map
.
class
);
}
//将json文件转化为List<Map>
public
static
List
<
Map
>
getResourceList
(
Resource
resource
)
{
String
json
=
null
;
try
{
json
=
IOUtils
.
toString
(
resource
.
getInputStream
(),
String
.
valueOf
(
StandardCharsets
.
UTF_8
));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
resource
+
"json文件转化失败"
);
}
List
<
Map
>
list
=
parseArray
(
json
,
Map
.
class
);
return
list
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/FinancingInfoMapper.xml
View file @
138a4d88
...
...
@@ -35,12 +35,15 @@
<if
test=
"params.type == 3 "
>
and info.status in ('待整改','整改未完成')
</if>
<if
test=
"params.status != null and params.status != ''"
>
and info.status = #{params.status}
</if>
</where>
ORDER BY
info.rec_date DESC ,hph.sequence_nbr ASC ) as sta
<where>
<if
test=
"params.status != null and params.status != ''"
>
and sta.status = #{params.status}
</if>
</where>
</select>
<select
id=
"selectDataInfo"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto"
>
SELECT
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/HouseholdContractMapper.xml
View file @
138a4d88
...
...
@@ -4,38 +4,45 @@
<select
id=
"selectPage"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract"
>
select
*
from hygf_household_contract
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<where>
<if
test=
"dto.name != null and dto.name !='' "
>
and hygf_household_contract.name like concat('%',#{dto.name},'%')
</if>
<if
test=
"dto.contractNumber != null and dto.contractNumber !=''"
>
and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%')
</if>
<if
test=
"dto.initiateStatus != null and dto.initiateStatus !='' "
>
and hygf_household_contract.initiate_status = #{dto.initiateStatus}
</if>
<if
test=
"dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''"
>
and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId}
</if>
<if
test=
"dto.dealerId != null and dto.dealerId !=''"
>
and hygf_household_contract.dealer_id = #{dto.dealerId}
</if>
<if
test=
"dto.surveyStatus != null and dto.surveyStatus !=''"
>
and hygf_household_contract.survey_status = #{dto.surveyStatus}
</if>
<if
test=
"dto.signStatus != null and dto.signStatus !=''"
>
and hygf_household_contract.sign_status = #{dto.signStatus}
</if>
<if
test=
"dto.userId != null and dto.userId !=''"
>
and hygf_household_contract.project_user_id = #{dto.userId}
</if>
<if
test=
"dto.partyA != null and dto.partyA !=''"
>
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%')
</if>
</where>
select
*,
(SELECT CASE WHEN SUM( CASE WHEN hhc.`status` = '已作废' THEN 1 ELSE 0 END ) = COUNT(*) THEN 'true' ELSE 'false'
END FROM hygf_household_contract AS hhc
WHERE
hhc.peasant_household_id = hygf_household_contract.peasant_household_id
) AS isAllDisuse
from hygf_household_contract
LEFT JOIN hygf_peasant_household php ON php.sequence_nbr = hygf_household_contract.peasant_household_id
<where>
<if
test=
"dto.name != null and dto.name !='' "
>
and hygf_household_contract.name like concat('%',#{dto.name},'%')
</if>
<if
test=
"dto.contractNumber != null and dto.contractNumber !=''"
>
and hygf_household_contract.contract_number like concat('%',#{dto.contractNumber},'%')
</if>
<if
test=
"dto.initiateStatus != null and dto.initiateStatus !='' "
>
and hygf_household_contract.initiate_status = #{dto.initiateStatus}
</if>
<if
test=
"dto.peasantHouseholdId != null and dto.peasantHouseholdId !=''"
>
and hygf_household_contract.peasant_household_id = #{dto.peasantHouseholdId}
</if>
<if
test=
"dto.dealerId != null and dto.dealerId !=''"
>
and hygf_household_contract.dealer_id = #{dto.dealerId}
</if>
<if
test=
"dto.surveyStatus != null and dto.surveyStatus !=''"
>
and hygf_household_contract.survey_status = #{dto.surveyStatus}
</if>
<if
test=
"dto.signStatus != null and dto.signStatus !=''"
>
and hygf_household_contract.sign_status = #{dto.signStatus}
</if>
<if
test=
"dto.userId != null and dto.userId !=''"
>
and hygf_household_contract.project_user_id = #{dto.userId}
</if>
<if
test=
"dto.partyA != null and dto.partyA !=''"
>
and hygf_household_contract.party_a like concat('%',#{dto.partyA},'%')
</if>
</where>
<if
test=
"dto.orderBy == null "
>
ORDER BY hygf_household_contract.rec_date DESC
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/pom.xml
View file @
138a4d88
...
...
@@ -26,6 +26,11 @@
<!-- <version>${amos-biz-boot.version}</version>-->
<!-- </dependency>-->
<dependency>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<version>
2.6
</version>
</dependency>
<dependency>
<groupId>
org.typroject
</groupId>
<artifactId>
tyboot-component-emq
</artifactId>
<version>
1.1.20
</version>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/AmosHygfApplication.java
View file @
138a4d88
...
...
@@ -43,8 +43,7 @@ import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.tdenginemapper"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
})
"com.yeejoin.amos.boot.module.**.api.tdenginemapper"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
{
GlobalExceptionHandler
.
class
}))
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/config/DataSourceConfiguration.java
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
config
;
import
com.baomidou.mybatisplus.core.config.GlobalConfig
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
com.yeejoin.amos.boot.biz.config.MetaHandler
;
import
com.yeejoin.amos.boot.biz.config.MybatisSqlInjector
;
import
com.zaxxer.hikari.HikariDataSource
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
javax.sql.DataSource
;
import
org.apache.ibatis.plugin.Interceptor
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
/**
* 数据源代理
*
* @author LiuLin
*/
@Configuration
public
class
DataSourceConfiguration
{
@Autowired
private
DataSourceProperties
dsp
;
@Bean
(
name
=
"hikariDataSource"
)
public
HikariDataSource
hikariDataSource
()
{
HikariDataSource
hds
=
new
HikariDataSource
();
hds
.
setSchema
(
dsp
.
getSchema
().
get
(
0
));
hds
.
setUsername
(
dsp
.
getUsername
());
hds
.
setPassword
(
dsp
.
getPassword
());
hds
.
setJdbcUrl
(
dsp
.
getUrl
());
hds
.
setDriverClassName
(
dsp
.
getDriverClassName
());
hds
.
setConnectionTimeout
(
3000
);
hds
.
setMaximumPoolSize
(
30
);
hds
.
setMinimumIdle
(
10
);
return
hds
;
}
@Primary
@Bean
(
"dataSource"
)
public
DataSourceProxy
dataSourceProxy
(
@Qualifier
(
"dataSource"
)
DataSource
hikariDataSource
)
{
return
new
DataSourceProxy
(
hikariDataSource
);
}
@Bean
(
name
=
"sqlSessionFactory"
)
@Autowired
public
SqlSessionFactory
sqlSessionFactoryBean
(
@Qualifier
(
"dataSource"
)
DataSource
dataSourceProxy
,
PaginationInterceptor
paginationInterceptor
,
MetaHandler
metaHandler
)
throws
Exception
{
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSourceProxy
);
ResourcePatternResolver
resolver
=
new
PathMatchingResourcePatternResolver
();
bean
.
setMapperLocations
(
resolver
.
getResources
(
"classpath*:mapper/*.xml"
));
GlobalConfig
globalConfig
=
new
GlobalConfig
();
globalConfig
.
setSqlInjector
(
new
MybatisSqlInjector
());
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
Interceptor
[]
plugins
=
{
paginationInterceptor
};
bean
.
setPlugins
(
plugins
);
return
bean
.
getObject
();
}
@Bean
public
MetaHandler
metaHandler
()
{
return
new
MetaHandler
();
}
}
//package com.yeejoin.amos.workflow.config;
//
//import com.baomidou.mybatisplus.core.config.GlobalConfig;
//import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
//import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
//import com.github.pagehelper.PageInterceptor;
//import com.yeejoin.amos.boot.biz.config.MetaHandler;
//import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpowerInterceptor;
//import com.zaxxer.hikari.HikariDataSource;
//import io.seata.rm.datasource.DataSourceProxy;
//import org.apache.ibatis.plugin.Interceptor;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.boot.jdbc.DataSourceBuilder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//import org.springframework.core.io.support.ResourcePatternResolver;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource;
//import java.util.Properties;
//
///**
// * 数据源代理
// *
// * @author LiuLin
// */
//@Configuration
//public class DataSourceConfiguration {
// @Autowired
// MetaHandler metaHandler;
// private static final String MAPPER_LOCATION = "classpath*:mapper/mysql/*.xml";
//
// @Autowired
// private DataSourceProperties dsp;
//
// @Bean(name = "mysqlDataSource")
// @Primary
// public DataSource mysqlDataSource() {
// HikariDataSource hds = new HikariDataSource();
// hds.setUsername(dsp.getUsername());
// hds.setPassword(dsp.getPassword());
// hds.setJdbcUrl(dsp.getUrl());
// hds.setDriverClassName(dsp.getDriverClassName());
// hds.setConnectionTimeout(3000);
// hds.setMaximumPoolSize(30);
// hds.setMinimumIdle(10);
// return hds;
// }
//
// @Bean("mysqlDataSourceProxy")
// public DataSourceProxy dataSourceProxy(DataSource hikariDataSource) {
// return new DataSourceProxy(hikariDataSource);
// }
//
// @Bean(name = "mysqlSqlSessionFactory")
// @Primary
// public SqlSessionFactory mysqlSqlSessionFactory(@Qualifier("mysqlDataSourceProxy") DataSource dataSource, GlobalConfig globalConfig) throws Exception {
// //注意这里一定要用MybatisSqlSessionFactoryBean,如果用SqlSessionFactory,配置无效
// MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
// bean.setDataSource(dataSource);
// bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MAPPER_LOCATION));
// globalConfig.setMetaObjectHandler(metaHandler);
// bean.setGlobalConfig(globalConfig);
// //分页插件
// Interceptor interceptor = new PageInterceptor();
// Properties properties = new Properties();
// properties.setProperty("helperDialect", "mysql");
// properties.setProperty("offsetAsPageNum", "true");
// properties.setProperty("rowBoundsWithCount", "true");
// properties.setProperty("reasonable", "true");
// properties.setProperty("supportMethodsArguments","true");
// properties.setProperty("params","pageNum=current;pageSize=size" +
// "" +
// ";");
// interceptor.setProperties(properties);
// bean.setPlugins(new Interceptor[] {interceptor,
// userEmpowerInterceptor(),
// paginationInterceptor()
// });
// return bean.getObject();
// }
//
// @Bean(name = "mysqlTransactionManager")
// @Primary
// public DataSourceTransactionManager mysqlTransactionManager(@Qualifier("mysqlDataSource") DataSource dataSource) {
// return new DataSourceTransactionManager(dataSource);
// }
//
// @Bean(name = "mysqlSqlSessionTemplate")
// @Primary
// public SqlSessionTemplate mysqlSqlSessionTemplate(@Qualifier("mysqlSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception {
// return new SqlSessionTemplate(sqlSessionFactory);
// }
//
// @Bean
// public PaginationInterceptor paginationInterceptor() {
// PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// paginationInterceptor.setDialectType("mysql");
// return paginationInterceptor;
// }
//
//
// @Bean
// public UserEmpowerInterceptor userEmpowerInterceptor() {
// UserEmpowerInterceptor userEmpowerInterceptor = new UserEmpowerInterceptor();
//
// return userEmpowerInterceptor;
// }
//
//
//}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/config/MysqlServerConfig.java
View file @
138a4d88
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import
com.github.pagehelper.PageInterceptor
;
import
com.yeejoin.amos.boot.biz.config.MetaHandler
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserEmpowerInterceptor
;
import
io.seata.rm.datasource.DataSourceProxy
;
import
org.apache.ibatis.plugin.Interceptor
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.SqlSessionTemplate
;
...
...
@@ -43,16 +44,18 @@ public class MysqlServerConfig {
return
DataSourceBuilder
.
create
().
build
();
}
@Bean
(
"mysqlDataSourceProxy"
)
public
DataSourceProxy
dataSourceProxy
(
@Qualifier
(
"mysqlDataSource"
)
DataSource
hikariDataSource
)
{
return
new
DataSourceProxy
(
hikariDataSource
);
}
@Bean
(
name
=
"mysqlSqlSessionFactory"
)
@Primary
public
SqlSessionFactory
mysqlSqlSessionFactory
(
@Qualifier
(
"mysqlDataSource"
)
DataSource
dataSource
,
GlobalConfig
globalConfig
)
throws
Exception
{
public
SqlSessionFactory
mysqlSqlSessionFactory
(
@Qualifier
(
"mysqlDataSource
Proxy
"
)
DataSource
dataSource
,
GlobalConfig
globalConfig
)
throws
Exception
{
//注意这里一定要用MybatisSqlSessionFactoryBean,如果用SqlSessionFactory,配置无效
MybatisSqlSessionFactoryBean
bean
=
new
MybatisSqlSessionFactoryBean
();
bean
.
setDataSource
(
dataSource
);
bean
.
setMapperLocations
(
new
PathMatchingResourcePatternResolver
().
getResources
(
MAPPER_LOCATION
));
globalConfig
.
setMetaObjectHandler
(
metaHandler
);
bean
.
setGlobalConfig
(
globalConfig
);
//分页插件
...
...
@@ -67,8 +70,6 @@ public class MysqlServerConfig {
""
+
";"
);
interceptor
.
setProperties
(
properties
);
bean
.
setPlugins
(
new
Interceptor
[]
{
interceptor
,
userEmpowerInterceptor
(),
paginationInterceptor
()
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/config/TDengineServerConfig.java
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
config
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
com.github.pagehelper.PageInterceptor
;
...
...
@@ -9,6 +10,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
import
org.mybatis.spring.SqlSessionTemplate
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -29,14 +31,34 @@ import java.util.Properties;
@MapperScan
(
basePackages
=
"com.yeejoin.amos.boot.module.hygf.api.tdenginemapper"
,
sqlSessionTemplateRef
=
"tdengineSqlSessionTemplate"
)
public
class
TDengineServerConfig
{
@Value
(
"${spring.datasource.tdengine-service.jdbc-url}"
)
private
String
dbUrl
;
@Value
(
"${spring.datasource.tdengine-service.username}"
)
private
String
username
;
@Value
(
"${spring.datasource.tdengine-service.password}"
)
private
String
password
;
@Value
(
"${spring.datasource.tdengine-service.driver-class-name}"
)
private
String
driverClassName
;
@Value
(
"${spring.datasource.tdengine-service.type}"
)
private
String
dbType
;
private
static
final
String
MAPPER_LOCATION
=
"classpath*:mapper/tdengine/*.xml"
;
@Bean
(
name
=
"tdengineDataSource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource.tdengine-service"
)
public
DataSource
tdengineDataSource
()
{
return
DataSourceBuilder
.
create
().
build
();
// DruidDataSource datasource = new DruidDataSource();
// datasource.setUrl(this.dbUrl);
// datasource.setUsername(username);
// datasource.setPassword(password);
// datasource.setDriverClassName(driverClassName);
// datasource.setDbType(dbType);
// return datasource;
return
DataSourceBuilder
.
create
().
build
();
}
@Bean
(
name
=
"tdengineSqlSessionFactory"
)
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/feign/TaskV2FeignService.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
feign
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
org.springframework.cloud.openfeign.FeignClient
;
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
java.util.List
;
/**
* @author LiuLin
* @apiNote 待办Feign调用
* @date 2024-05-16
*/
@FeignClient
(
name
=
"AMOS-API-PRIVILEGE"
,
path
=
"/systemctl/v2/task"
,
configuration
=
{
XidFeignConfiguration
.
class
})
public
interface
TaskV2FeignService
{
/**
* 批量新增任务
*
* @param modelList 新增待办
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/batch/add"
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
List
<
TaskV2Model
>>
batchAdd
(
@RequestBody
List
<
TaskV2Model
>
modelList
)
throws
InnerInvokException
;
/**
* 更新任务
*
* @param model 待办信息
* @param sequenceNbr 主键
* @return TaskV2Model
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/{sequenceNbr}"
,
method
=
RequestMethod
.
PUT
)
FeignClientResult
<
TaskV2Model
>
update
(
@RequestBody
TaskV2Model
model
,
@PathVariable
(
"sequenceNbr"
)
Long
sequenceNbr
)
throws
InnerInvokException
;
/**
* 创建任务
*
* @param model 待办
* @return
* @throws InnerInvokException
*/
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
FeignClientResult
<
TaskV2Model
>
create
(
@RequestBody
TaskV2Model
model
)
throws
InnerInvokException
;
/**
* 批量删除任务
*
* @param ids 主键
* @return Long
* @throws InnerInvokException e
*/
@RequestMapping
(
value
=
"/{ids}"
,
method
=
RequestMethod
.
DELETE
)
FeignClientResult
<
List
<
Long
>>
delete
(
@PathVariable
(
"ids"
)
String
ids
)
throws
InnerInvokException
;
/**
* 查询指定任务
*
* @param relationId 关联Id
* @return List<TaskV2Model>
* @throws InnerInvokException
*/
@RequestMapping
(
value
=
"/queryByRelationId/{relationId}"
,
method
=
RequestMethod
.
GET
)
FeignClientResult
<
List
<
TaskV2Model
>>
selectListByRelationId
(
@PathVariable
(
"relationId"
)
String
relationId
)
throws
InnerInvokException
;
/**
* 批量修改任务
*/
@RequestMapping
(
value
=
"/batch/update"
,
method
=
RequestMethod
.
PUT
)
FeignClientResult
<
List
<
TaskV2Model
>>
batchUpdate
(
@RequestBody
List
<
TaskV2Model
>
modelList
)
throws
InnerInvokException
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/AcceptanceRectificationOrderServiceImpl.java
View file @
138a4d88
...
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceRectificationOrder
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceRectificationOrderService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -98,7 +99,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
* 提交整改并触发工作流
*/
@Transactional
@
Global
Transactional
public
AcceptanceRectificationOrderDto
updateAndDriveWorkflow
(
AcceptanceRectificationOrderDto
model
,
String
userId
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/AcceptanceServiceImpl.java
View file @
138a4d88
...
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.AcceptanceMapper;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceService
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -109,7 +110,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
return
Optional
.
ofNullable
(
item
).
orElse
(
new
AcceptanceCheckItem
());
}
@Override
@Transactional
@
Global
Transactional
public
void
checkAccept
(
Long
basicGridAcceptanceId
,
String
userId
){
BasicGridAcceptance
basicGridAcceptanc
=
basicGridAcceptanceMapper
.
selectById
(
basicGridAcceptanceId
);
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
待投融验收
.
getCode
());
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
View file @
138a4d88
...
...
@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
;
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -47,6 +48,8 @@ public class BasicGridAcceptanceServiceImpl
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
private
CommonServiceImpl
commonService
;
private
final
String
OK
=
"0"
;
private
final
String
PASS
=
"5"
;
...
...
@@ -88,7 +91,7 @@ public class BasicGridAcceptanceServiceImpl
return
grid
;
}
@Transactional
@
Global
Transactional
public
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
...
...
@@ -127,9 +130,42 @@ public class BasicGridAcceptanceServiceImpl
onGridMapper
.
insert
(
grid
);
}
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
//发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
return
grid
;
}
private
List
<
TaskModelDto
>
buildBWYSTaskModel
(
HygfOnGrid
grid
,
BasicGridAcceptance
basicGridAcceptance
)
{
List
<
TaskModelDto
>
taskModelDtoList
=
new
ArrayList
<>();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
taskModelDto
.
setFlowCode
(
basicGridAcceptance
.
getNextTaskId
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskModelDto
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskModelDto
.
setPageType
(
null
);
taskModelDto
.
setExecuteUserIds
(
basicGridAcceptance
.
getNextExecuteUserIds
());
taskModelDto
.
setModel
(
grid
);
taskModelDto
.
setRelationId
(
basicGridAcceptance
.
getInstanceId
());
taskModelDto
.
setRoutePath
(
null
);
taskModelDto
.
setStartUserId
(
basicGridAcceptance
.
getRecUserId
());
taskModelDto
.
setStartUser
(
basicGridAcceptance
.
getRecUserName
());
taskModelDto
.
setStartDate
(
basicGridAcceptance
.
getRecDate
());
taskModelDto
.
setStartUserCompanyName
(
null
);
taskModelDto
.
setTaskName
(
basicGridAcceptance
.
getNextNodeName
());
taskModelDto
.
setTaskCode
(
String
.
valueOf
(
basicGridAcceptance
.
getWorkOrderId
()));
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
HYGF_BWYS
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
HYGF_BWYS
.
getName
());
taskModelDto
.
setTaskStatus
(
TaskStatusEnum
.
UNDERWAY
.
getValue
());
taskModelDto
.
setTaskStatusLabel
(
TaskStatusEnum
.
UNDERWAY
.
getName
());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto
.
setNextExecuteUser
(
basicGridAcceptance
.
getNextExecutorIds
());
taskModelDtoList
.
add
(
taskModelDto
);
return
taskModelDtoList
;
}
public
HygfOnGrid
modifyEntity
(
HygfOnGrid
grid
)
{
onGridMapper
.
updateById
(
grid
);
return
grid
;
...
...
@@ -157,7 +193,7 @@ public class BasicGridAcceptanceServiceImpl
return
bool
;
}
@Transactional
@
Global
Transactional
public
void
execute
(
AcceptanceCheckItem
dto
,
String
userId
)
{
// 查询并网审批信息
BasicGridAcceptance
basicGridAcceptanc
=
basicGridAcceptanceMapper
.
selectById
(
dto
.
getBasicGridAcceptanceId
());
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/CommonServiceImpl.java
0 → 100644
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.hygf.api.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.TaskV2FeignService
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.io.UnsupportedEncodingException
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 公共服务实现类
*
* @author hzz
* @date 2024-06-20
*/
@Service
@Slf4j
public
class
CommonServiceImpl
{
@Autowired
private
TaskV2FeignService
taskV2FeignService
;
@Autowired
private
RedisUtils
redisUtils
;
@Value
(
"classpath:/json/urlInfo.json"
)
private
Resource
urlInfo
;
private
static
String
toQueryParams2
(
JSONObject
jsonObject
)
{
StringBuilder
sb
=
new
StringBuilder
();
Set
<
String
>
keys
=
jsonObject
.
keySet
();
keys
.
forEach
(
key
->
{
Object
value
=
jsonObject
.
get
(
key
);
if
(
sb
.
length
()
>
0
)
{
sb
.
append
(
'&'
);
}
try
{
if
(
value
!=
null
&&
!
""
.
equals
(
value
))
{
sb
.
append
(
URLEncoder
.
encode
(
key
,
"UTF-8"
))
.
append
(
'='
)
.
append
(
URLEncoder
.
encode
(
value
.
toString
(),
"UTF-8"
));
}
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
});
return
sb
.
toString
();
}
public
void
deleteTaskModel
(
String
id
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
id
).
getResult
();
if
(!
result
.
isEmpty
())
{
List
<
Long
>
idList
=
result
.
stream
().
map
(
TaskV2Model:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
String
ids
=
idList
.
stream
().
map
(
Object:
:
toString
).
collect
(
Collectors
.
joining
(
","
));
taskV2FeignService
.
delete
(
ids
);
}
}
/**
* 待办新增接口
**/
public
void
buildTaskModel
(
List
<
TaskModelDto
>
list
)
{
List
<
TaskV2Model
>
taskV2Models
=
new
ArrayList
<>();
for
(
TaskModelDto
obj
:
list
)
{
// 判断是否是暂存 新增若无下一节点执行人即为暂存
boolean
flag
=
StringUtils
.
isEmpty
(
obj
.
getNextExecuteUser
());
if
(
flag
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
obj
.
getRelationId
()).
getResult
();
if
(
CollectionUtil
.
isNotEmpty
(
result
)
&&
!
result
.
isEmpty
())
{
break
;
}
}
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
TaskV2Model
model
=
new
TaskV2Model
();
BeanUtil
.
copyProperties
(
obj
,
model
);
String
urlParams
=
""
;
try
{
urlParams
=
"&"
+
toQueryParams
(
obj
.
getModel
());
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
// 获取暂存的可编辑页面url
if
(
flag
&&
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"draft"
))
{
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
()
+
urlParams
);
break
;
}
// 其他逻辑均按详情页面获取
else
if
(
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
null
==
obj
.
getPageType
()
?
"look"
:
obj
.
getPageType
()))
{
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
getNextExecuteUser
())
+
urlParams
+
"&nextExecuteUserIds="
+
model
.
getExecuteUserIds
());
break
;
}
}
// 是true则为暂存 除公共部分统一处理
if
(
flag
)
{
model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
());
model
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
());
model
.
setStartUserId
(
RequestContext
.
getExeUserId
());
model
.
setStartUser
(
reginParams
.
getUserModel
().
getRealName
());
model
.
setStartUserCompanyName
(
reginParams
.
getCompany
().
getCompanyName
());
model
.
setStartDate
(
new
Date
());
model
.
setExecuteUserIds
(
RequestContext
.
getExeUserId
());
model
.
setFlowCreateDate
(
new
Date
());
model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
());
model
.
setTaskTitle
(
"有一条待提交的草稿"
);
model
.
setTaskName
(
BusinessTypeEnum
.
getNameByType
(
obj
.
getTaskType
()));
model
.
setTaskTypeLabel
(
BusinessTypeEnum
.
getNameByType
(
obj
.
getTaskType
()));
// model.setTaskContent("【申请单号:"+obj.getTaskCode()+"】待提交");
}
else
{
model
.
setTaskStatus
(
0
);
model
.
setTaskTitle
(
obj
.
getStartUser
()
+
"发起了"
+
obj
.
getTaskName
());
}
model
.
setFlowInstanceId
(
model
.
getRelationId
());
model
.
setTaskSource
(
"workFlow"
);
model
.
setExtras
(
JSON
.
toJSONString
(
obj
.
getModel
()));
// model.setTerminal(params.getOrDefault("terminal","WEB").toString());
model
.
setCreateDate
(
new
Date
());
model
.
setRecUserId
(
RequestContext
.
getExeUserId
());
model
.
setAgencyCode
(
RequestContext
.
getAgencyCode
());
taskV2Models
.
add
(
model
);
}
taskV2FeignService
.
batchAdd
(
taskV2Models
);
}
/**
* 待办编辑接口
* 参数
* taskStatus
* taskStatusLabel 操作名称 6614驳回 6616已完成 6612待受理
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public
TaskV2Model
updateTaskModel
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
collect
.
isEmpty
())
{
return
null
;
}
collect
.
get
(
0
).
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
collect
.
get
(
0
).
setFlowStatusLabel
(
params
.
get
(
"flowStatusLabel"
).
toString
());
collect
.
get
(
0
).
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
collect
.
get
(
0
).
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
collect
.
get
(
0
).
setEndUserId
(
exeUserId
);
collect
.
get
(
0
).
setEndDate
(
new
Date
());
// String[] roleIds = model.getRoutePath().split("roleIds=");
// String[] userIds = roleIds[1].split("&userId");
// String url = roleIds[0]+"roleIds="+"55555"+"&userId"+ userIds[1];
// String tarUrl = url.replaceFirst("&executeUserIds=", "");
// tarUrl+"&executeUserIds="
// model.setRoutePath( roleIds[0]+"roleIds="+"55555"+"&userId"+userIds[1]);
// 当流程完成时将所有待办状态统一修改为已完成
if
(
collect
.
get
(
0
).
getFlowStatusLabel
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()))
{
String
urlParams
=
""
;
try
{
urlParams
=
"&"
+
toQueryParams
(
params
.
get
(
"model"
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
collect
.
get
(
0
).
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
))
{
urlParams
=
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
""
)
+
urlParams
+
"&taskStatus"
+
collect
.
get
(
0
).
getTaskStatus
()
+
"&nextExecuteUserIds="
;
break
;
}
}
collect
.
get
(
0
).
setRoutePath
(
urlParams
);
for
(
TaskV2Model
taskV2Model
:
collect
)
{
taskV2Model
.
setTaskStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
taskV2Model
.
setFlowStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
}
taskV2FeignService
.
batchUpdate
(
collect
);
}
else
{
collect
.
get
(
0
).
setRoutePath
(
collect
.
get
(
0
).
getRoutePath
().
replace
(
"roleIds="
,
"roleIds=55555&fq="
));
taskV2FeignService
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
}
// 修改model并返回 用于组装新待办
collect
.
get
(
0
).
setEndUserId
(
null
);
collect
.
get
(
0
).
setTaskStatus
(
null
);
collect
.
get
(
0
).
setEndDate
(
null
);
collect
.
get
(
0
).
setSequenceNbr
(
null
);
collect
.
get
(
0
).
setCreateDate
(
new
Date
());
collect
.
get
(
0
).
setStartDate
(
new
Date
());
return
collect
.
get
(
0
);
}
/**
* 待办编辑接口 【如果没有代办直接返回空,业务判断】 ---- 在用,误删
* 参数
* taskStatus
* taskStatusLabel 操作名称 1驳回 2通过 3重新提交
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public
TaskV2Model
updateTaskModelNew
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
// TaskV2Model model = result.stream().filter(e->e.getFlowCode().equals(params.get("flowCode").toString())).sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r2.getSequenceNbr())) // 按时间降序排序
// .findFirst()
// .orElse(null);
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
null
==
collect
||
collect
.
size
()
==
0
)
{
TaskV2Model
model
=
new
TaskV2Model
();
model
.
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
model
.
setFlowStatusLabel
(
params
.
get
(
"flowStatusLabel"
).
toString
());
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
return
model
;
}
collect
.
get
(
0
).
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
collect
.
get
(
0
).
setFlowStatusLabel
(
params
.
get
(
"flowStatusLabel"
).
toString
());
collect
.
get
(
0
).
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
collect
.
get
(
0
).
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
collect
.
get
(
0
).
setEndUserId
(
exeUserId
);
collect
.
get
(
0
).
setEndDate
(
new
Date
());
// 当流程完成时将所有待办状态统一修改为已完成
if
(
collect
.
get
(
0
).
getFlowStatusLabel
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()))
{
String
urlParams
=
""
;
try
{
urlParams
=
"&"
+
toQueryParams
(
params
.
get
(
"model"
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
collect
.
get
(
0
).
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
))
{
urlParams
=
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
""
)
+
urlParams
+
"&nextExecuteUserIds="
;
break
;
}
}
collect
.
get
(
0
).
setRoutePath
(
urlParams
);
for
(
TaskV2Model
taskV2Model
:
collect
)
{
taskV2Model
.
setTaskStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
taskV2Model
.
setFlowStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
}
taskV2FeignService
.
batchUpdate
(
collect
);
}
else
{
collect
.
get
(
0
).
setRoutePath
(
collect
.
get
(
0
).
getRoutePath
().
replace
(
"roleIds="
,
"roleIds=55555&fq="
));
taskV2FeignService
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
}
collect
.
get
(
0
).
setEndUserId
(
null
);
collect
.
get
(
0
).
setTaskStatus
(
null
);
collect
.
get
(
0
).
setEndDate
(
null
);
collect
.
get
(
0
).
setSequenceNbr
(
null
);
collect
.
get
(
0
).
setCreateDate
(
new
Date
());
collect
.
get
(
0
).
setStartDate
(
new
Date
());
return
collect
.
get
(
0
);
}
/**
* 待办 撤回
*
* @param id 工作流实例id
* @param obj 自己的实体:taskType为BusinessTypeEnum code;nextExecuteUser
*/
public
void
rollbackTask
(
String
id
,
JSONObject
obj
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
id
).
getResult
();
List
<
TaskV2Model
>
list
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
TaskV2Model
model
=
list
.
get
(
0
);
taskV2FeignService
.
delete
(
String
.
valueOf
(
model
.
getSequenceNbr
()));
String
urlParams
=
""
;
urlParams
=
"&"
+
toQueryParams2
(
obj
);
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
if
(
list
.
size
()
>
1
)
{
TaskV2Model
lastTaskModel
=
list
.
get
(
1
);
lastTaskModel
.
setEndUserId
(
null
);
lastTaskModel
.
setEndDate
(
null
);
lastTaskModel
.
setTaskStatus
(
FlowStatusEnum
.
TO_SUBMITTED
.
getCode
());
lastTaskModel
.
setTaskStatusLabel
(
"重新提交"
);
lastTaskModel
.
setFlowCode
(
obj
.
get
(
"nextTaskId"
).
toString
());
if
(
obj
.
get
(
"flowStatus"
)
!=
null
)
{
lastTaskModel
.
setFlowStatus
(
Integer
.
valueOf
(
obj
.
get
(
"flowStatus"
).
toString
()));
}
if
(
obj
.
get
(
"flowStatusLabel"
)
!=
null
)
{
lastTaskModel
.
setFlowStatusLabel
(
obj
.
get
(
"flowStatusLabel"
).
toString
());
}
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
obj
.
get
(
"taskType"
))
&&
map
.
get
(
"pageType"
).
equals
(
obj
.
getOrDefault
(
"pageType"
,
"edit"
)))
{
lastTaskModel
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
get
(
"nextExecuteUser"
).
toString
())
+
urlParams
);
break
;
}
}
taskV2FeignService
.
update
(
lastTaskModel
,
lastTaskModel
.
getSequenceNbr
());
}
else
if
(
list
.
size
()
==
1
)
{
model
.
setExecuteUserIds
(
model
.
getStartUserId
());
model
.
setTaskStatusLabel
(
"重新提交"
);
model
.
setTaskStatus
(
FlowStatusEnum
.
TO_SUBMITTED
.
getCode
());
model
.
setSequenceNbr
(
null
);
if
(
obj
.
get
(
"flowStatus"
)
!=
null
)
{
model
.
setFlowStatus
(
Integer
.
valueOf
(
obj
.
get
(
"flowStatus"
).
toString
()));
}
if
(
obj
.
get
(
"flowStatusLabel"
)
!=
null
)
{
model
.
setFlowStatusLabel
(
obj
.
get
(
"flowStatusLabel"
).
toString
());
}
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
obj
.
get
(
"taskType"
))
&&
map
.
get
(
"pageType"
).
equals
(
"edit"
))
{
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
get
(
"nextExecuteUser"
).
toString
())
+
urlParams
);
break
;
}
}
taskV2FeignService
.
create
(
model
);
}
}
public
<
T
>
String
toQueryParams
(
T
obj
)
throws
UnsupportedEncodingException
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
Class
<?>
clazz
=
obj
.
getClass
();
!
clazz
.
equals
(
Object
.
class
);
clazz
=
clazz
.
getSuperclass
())
{
Field
[]
fields
=
clazz
.
getDeclaredFields
();
for
(
Field
field
:
fields
)
{
if
(!
Modifier
.
isStatic
(
field
.
getModifiers
()))
{
field
.
setAccessible
(
true
);
try
{
Object
value
=
field
.
get
(
obj
);
if
(
value
!=
null
&&
!
""
.
equals
(
value
))
{
String
encodedValue
=
URLEncoder
.
encode
(
value
.
toString
(),
"UTF-8"
);
sb
.
append
(
field
.
getName
()).
append
(
'='
).
append
(
encodedValue
).
append
(
'&'
);
}
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
return
sb
.
length
()
>
0
?
sb
.
substring
(
0
,
sb
.
length
()
-
1
)
:
""
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/FinancingInfoServiceImpl.java
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FinancingAuditEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.TaskStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingAuditingDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRectificationOrder
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.StdUserEmpower
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingInfoMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IFinancingInfoService
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingRectificationOrderServiceImpl
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.*
;
...
...
@@ -46,7 +50,10 @@ import java.util.*;
* @date 2024-04-01
*/
@Service
public
class
FinancingInfoServiceImpl
extends
BaseService
<
FinancingInfoDto
,
FinancingInfo
,
FinancingInfoMapper
>
implements
IFinancingInfoService
{
public
class
FinancingInfoServiceImpl
extends
BaseService
<
FinancingInfoDto
,
FinancingInfo
,
FinancingInfoMapper
>
implements
IFinancingInfoService
{
private
static
String
PROCESSKEY
=
"StationFinancing"
;
@Autowired
RedisUtils
redisUtils
;
/**
* 分页查询
*/
...
...
@@ -55,29 +62,26 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
private
WorkflowImpl
workflow
;
private
WorkflowImpl
workflow
;
@Autowired
private
FinancingAuditingServiceImpl
financingAuditingService
;
@Autowired
private
FinancingRectificationOrderServiceImpl
financingRectificationOrderService
;
@Autowired
RedisUtils
redisUtils
;
private
static
String
PROCESSKEY
=
"StationFinancing"
;
private
CommonServiceImpl
commonService
;
@UserLimits
public
Page
<
Map
<
String
,
Object
>>
queryForFinancingInfoPage
(
Page
<
Map
<
String
,
Object
>>
page
,
String
type
,
String
status
,
String
regionalCompaniesCode
,
String
ownersName
)
{
StdUserEmpower
orgCode
=
(
StdUserEmpower
)
redisUtils
.
get
(
"Emp_"
+
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()));
public
Page
<
Map
<
String
,
Object
>>
queryForFinancingInfoPage
(
Page
<
Map
<
String
,
Object
>>
page
,
String
type
,
String
status
,
String
regionalCompaniesCode
,
String
ownersName
)
{
StdUserEmpower
orgCode
=
(
StdUserEmpower
)
redisUtils
.
get
(
"Emp_"
+
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()));
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
String
>
amosOrgCodes
=
orgCode
.
getAmosOrgCode
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"ownersName"
,
ownersName
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"regionalCompaniesCode"
,
regionalCompaniesCode
);
params
.
put
(
"type"
,
type
);
params
.
put
(
"ownersName"
,
ownersName
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"regionalCompaniesCode"
,
regionalCompaniesCode
);
params
.
put
(
"type"
,
type
);
// 1 投融人员 2.融资 3经销商管理员
switch
(
type
){
switch
(
type
)
{
case
"1"
:
break
;
case
"2"
:
...
...
@@ -85,15 +89,15 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
params
.
put
(
"financingCompaniesSeq"
,
String
.
valueOf
(
sequenceNbr
));
break
;
default
:
amosOrgCodes
=
Arrays
.
asList
(
orgCode
.
getAdminRegionalCompaniesCode
().
split
(
","
));
amosOrgCodes
=
Arrays
.
asList
(
orgCode
.
getAdminRegionalCompaniesCode
().
split
(
","
));
}
PageHelper
.
startPage
((
int
)
page
.
getCurrent
(),(
int
)
page
.
getSize
());
List
<
Map
<
String
,
Object
>>
list
=
financingInfoMapper
.
getStationFinancingInfoList
(
params
,
amosOrgCodes
);
list
.
forEach
(
e
->
{
if
(
null
!=
e
.
get
(
"instanceId"
)
&&
e
.
get
(
"instanceId"
).
toString
().
contains
(
","
)){
PageHelper
.
startPage
((
int
)
page
.
getCurrent
(),
(
int
)
page
.
getSize
());
List
<
Map
<
String
,
Object
>>
list
=
financingInfoMapper
.
getStationFinancingInfoList
(
params
,
amosOrgCodes
);
list
.
forEach
(
e
->
{
if
(
null
!=
e
.
get
(
"instanceId"
)
&&
e
.
get
(
"instanceId"
).
toString
().
contains
(
","
))
{
String
[]
instanceIds
=
e
.
get
(
"instanceId"
).
toString
().
split
(
","
);
e
.
put
(
"instanceId"
,
instanceIds
[
0
]);
e
.
put
(
"nodeRouting"
,
instanceIds
[
1
]);
e
.
put
(
"instanceId"
,
instanceIds
[
0
]);
e
.
put
(
"nodeRouting"
,
instanceIds
[
1
]);
}
});
PageInfo
<
Map
<
String
,
Object
>>
infos
=
new
PageInfo
<>(
list
);
...
...
@@ -105,34 +109,34 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
/**
* 列表查询 示例
*/
public
List
<
FinancingInfoDto
>
queryForFinancingInfoList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
FinancingInfoDto
>
queryForFinancingInfoList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Transactional
@
Global
Transactional
public
FinancingInfoDto
saveModel
(
FinancingInfoDto
model
)
{
List
<
String
>
ids
;
List
<
String
>
ids
;
if
(
model
.
getPeasantHouseholdIds
().
contains
(
","
))
{
ids
=
Arrays
.
asList
(
model
.
getPeasantHouseholdIds
().
split
(
","
));
}
else
{
ids
=
Arrays
.
asList
(
new
String
[]{
model
.
getPeasantHouseholdIds
()});
ids
=
Arrays
.
asList
(
model
.
getPeasantHouseholdIds
().
split
(
","
));
}
else
{
ids
=
Arrays
.
asList
(
new
String
[]{
model
.
getPeasantHouseholdIds
()});
}
Map
<
String
,
Object
>
orgInfo
=
this
.
getBaseMapper
().
selectRZOrgInfo
(
model
.
getFinancingCompaniesSeq
());
model
.
setFinancingCompaniesCode
(
orgInfo
.
getOrDefault
(
"ORG_CODE"
,
""
).
toString
());
model
.
setFinancingCompaniesName
(
orgInfo
.
getOrDefault
(
"COMPANY_NAME"
,
""
).
toString
());
ids
.
stream
().
forEach
(
e
->
{
model
.
setFinancingCompaniesCode
(
orgInfo
.
getOrDefault
(
"ORG_CODE"
,
""
).
toString
());
model
.
setFinancingCompaniesName
(
orgInfo
.
getOrDefault
(
"COMPANY_NAME"
,
""
).
toString
());
ids
.
stream
().
forEach
(
e
->
{
LambdaQueryWrapper
<
FinancingInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
Long
.
valueOf
(
e
));
queryWrapper
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
Long
.
valueOf
(
e
));
FinancingInfo
financingInfos
=
this
.
getBaseMapper
().
selectOne
(
queryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
financingInfos
)){
if
(
ObjectUtils
.
isEmpty
(
financingInfos
))
{
model
.
setStatus
(
FinancingAuditEnum
.
待融资审核
.
getName
());
model
.
setPeasantHouseholdId
(
Long
.
valueOf
(
e
));
FinancingInfoDto
financingInfoDto
=
new
FinancingInfoDto
();
BeanUtils
.
copyProperties
(
model
,
financingInfoDto
);
BeanUtils
.
copyProperties
(
model
,
financingInfoDto
);
financingInfoDto
.
setSequenceNbr
(
null
);
this
.
createWithModel
(
financingInfoDto
);
}
else
{
}
else
{
financingInfos
.
setStatus
(
FinancingAuditEnum
.
待融资审核
.
getName
());
this
.
updateById
(
financingInfos
);
}
...
...
@@ -142,39 +146,71 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESSKEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
Date
date
=
new
Date
();
dto
.
setBusinessKey
(
String
.
valueOf
(
date
.
getTime
()));
dto
.
setCompleteFirstTask
(
true
);
//工作流程图第一步执行后存在互斥网关 isFlag为表达式 默认为1执行到融资审核
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"isFlag"
,
"0"
);
map
.
put
(
"isFlag"
,
"0"
);
dto
.
setVariables
(
map
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
FinancingAuditingDto
financingAuditingDto
=
new
FinancingAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
financingAuditingDto
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
financingAuditingDto
);
financingAuditingDto
.
setPeasantHouseholdId
(
Long
.
valueOf
(
e
));
financingAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
financingAuditingService
.
createWithModel
(
financingAuditingDto
);
//发起待办
// commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date));
});
return
model
;
}
private
List
<
TaskModelDto
>
buildDZTRZTaskModel
(
FinancingInfoDto
model
,
WorkflowResultDto
workflowResultDto
,
Date
startDate
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
TaskModelDto
>
taskModelDtoList
=
new
ArrayList
<>();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
taskModelDto
.
setFlowCode
(
workflowResultDto
.
getNextTaskId
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskModelDto
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskModelDto
.
setPageType
(
null
);
taskModelDto
.
setExecuteUserIds
(
workflowResultDto
.
getNextExecuteUserIds
());
taskModelDto
.
setModel
(
model
);
taskModelDto
.
setRelationId
(
workflowResultDto
.
getInstanceId
());
taskModelDto
.
setRoutePath
(
null
);
taskModelDto
.
setStartUserId
(
reginParams
.
getUserModel
().
getUserId
());
taskModelDto
.
setStartUser
(
reginParams
.
getUserModel
().
getUserName
());
taskModelDto
.
setStartDate
(
startDate
);
taskModelDto
.
setStartUserCompanyName
(
null
);
taskModelDto
.
setTaskName
(
workflowResultDto
.
getNextNodeName
());
taskModelDto
.
setTaskCode
(
workflowResultDto
.
getNextNodeCode
());
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
HYGF_DZTRRZ
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
HYGF_DZTRRZ
.
getName
());
taskModelDto
.
setTaskStatus
(
TaskStatusEnum
.
UNDERWAY
.
getValue
());
taskModelDto
.
setTaskStatusLabel
(
TaskStatusEnum
.
UNDERWAY
.
getName
());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorIds
());
taskModelDtoList
.
add
(
taskModelDto
);
return
taskModelDtoList
;
}
@Override
@GlobalTransactional
public
void
rollback
(
String
processId
,
String
peasantHouseholdId
)
{
workFlowService
.
stopProcess
(
processId
);
LambdaQueryWrapper
<
FinancingInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
queryWrapper
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
List
<
FinancingInfo
>
financingInfos
=
this
.
getBaseMapper
().
selectList
(
queryWrapper
);
if
(!
CollectionUtils
.
isEmpty
(
financingInfos
)){
if
(!
CollectionUtils
.
isEmpty
(
financingInfos
))
{
FinancingInfo
financingInfo
=
financingInfos
.
get
(
0
);
financingInfo
.
setStatus
(
"待推送"
);
financingInfo
.
setFinancingCompaniesCode
(
null
);
...
...
@@ -192,7 +228,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
}
@Override
@Transactional
@
Global
Transactional
public
void
execueFlow
(
Map
<
String
,
Object
>
params
)
{
LambdaQueryWrapper
<
FinancingAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
FinancingAuditing:
:
getInstanceId
,
params
.
get
(
"instanceId"
).
toString
());
...
...
@@ -211,8 +247,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
if
(
params
.
containsKey
(
"isFlag"
))
{
task
.
setResultCode
(
"isFlag"
);
map
.
put
(
"isFlag"
,
params
.
get
(
"isFlag"
));
if
(
params
.
get
(
"isFlag"
).
equals
(
"1"
))
{
params
.
put
(
"comments"
,
"退回整改"
);
if
(
params
.
get
(
"isFlag"
).
equals
(
"1"
))
{
params
.
put
(
"comments"
,
"退回整改"
);
}
}
else
{
task
.
setResultCode
(
"approvalStatus"
);
...
...
@@ -220,70 +256,70 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto,Finan
}
task
.
setComment
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
task
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
financingAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
financingAuditingDto
);
financingAuditingDto
.
setPeasantHouseholdId
(
financingAuditing
.
getPeasantHouseholdId
());
financingAuditingDto
.
setPromoter
(
financingAuditing
.
getPromoter
());
if
(
null
==
financingAuditingDto
.
getInstanceId
())
{
financingAuditingDto
.
setInstanceId
(
financingAuditing
.
getInstanceId
());
}
financingAuditingDto
.
setStatus
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
financingAuditingDto
.
setNodeRouting
(
FinancingAuditEnum
.
getNodeByCode
(
workflowResultDto
.
getNextNodeKey
()));
financingAuditingService
.
createWithModel
(
financingAuditingDto
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
financingAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
financingAuditingDto
);
financingAuditingDto
.
setPeasantHouseholdId
(
financingAuditing
.
getPeasantHouseholdId
());
financingAuditingDto
.
setPromoter
(
financingAuditing
.
getPromoter
());
if
(
null
==
financingAuditingDto
.
getInstanceId
())
{
financingAuditingDto
.
setInstanceId
(
financingAuditing
.
getInstanceId
());
}
financingAuditingDto
.
setStatus
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
financingAuditingDto
.
setNodeRouting
(
FinancingAuditEnum
.
getNodeByCode
(
workflowResultDto
.
getNextNodeKey
()));
financingAuditingService
.
createWithModel
(
financingAuditingDto
);
String
nameByCode
=
FinancingAuditEnum
.
getNameByCode
(
workflowResultDto
.
getNextNodeKey
());
String
statusName
=
nameByCode
==
null
||
nameByCode
.
equals
(
""
)
?
"放款完成"
:
nameByCode
;
String
nameByCode
=
FinancingAuditEnum
.
getNameByCode
(
workflowResultDto
.
getNextNodeKey
());
String
statusName
=
nameByCode
==
null
||
nameByCode
.
equals
(
""
)
?
"放款完成"
:
nameByCode
;
LambdaQueryWrapper
<
FinancingInfo
>
info
=
new
LambdaQueryWrapper
<>();
info
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
financingAuditing
.
getPeasantHouseholdId
());
FinancingInfo
financingInfo
=
this
.
getBaseMapper
().
selectOne
(
info
);
if
(
params
.
containsKey
(
"financingCompaniesSeq"
))
{
financingInfo
.
setFinancingCompaniesSeq
(
Long
.
valueOf
(
params
.
get
(
"financingCompaniesSeq"
).
toString
()));
}
//标识对于整改待推送状态
if
(
params
.
containsKey
(
"isZG"
))
{
financingInfo
.
setStatus
(
"整改待推送"
);
}
else
{
financingInfo
.
setStatus
(
statusName
);
}
this
.
updateById
(
financingInfo
);
LambdaQueryWrapper
<
FinancingInfo
>
info
=
new
LambdaQueryWrapper
<>();
info
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
financingAuditing
.
getPeasantHouseholdId
());
FinancingInfo
financingInfo
=
this
.
getBaseMapper
().
selectOne
(
info
);
if
(
params
.
containsKey
(
"financingCompaniesSeq"
))
{
financingInfo
.
setFinancingCompaniesSeq
(
Long
.
valueOf
(
params
.
get
(
"financingCompaniesSeq"
).
toString
()));
}
//标识对于整改待推送状态
if
(
params
.
containsKey
(
"isZG"
))
{
financingInfo
.
setStatus
(
"整改待推送"
);
}
else
{
financingInfo
.
setStatus
(
statusName
);
}
this
.
updateById
(
financingInfo
);
//节点为待整改时生成整改单
if
(
params
.
containsKey
(
"isFlag"
)
&&
params
.
get
(
"isFlag"
).
equals
(
"1"
)
&&
workflowResultDto
.
getNextNodeKey
().
equals
(
FinancingAuditEnum
.
待整改
.
getCode
()))
{
//节点为待整改时生成整改单
if
(
params
.
containsKey
(
"isFlag"
)
&&
params
.
get
(
"isFlag"
).
equals
(
"1"
)
&&
workflowResultDto
.
getNextNodeKey
().
equals
(
FinancingAuditEnum
.
待整改
.
getCode
()))
{
LambdaQueryWrapper
<
FinancingRectificationOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
FinancingRectificationOrder:
:
getPeasantHouseholdId
,
financingInfo
.
getPeasantHouseholdId
());
queryWrapper
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
queryWrapper
.
last
(
"limit 1"
);
FinancingRectificationOrder
oldData
=
financingRectificationOrderService
.
getBaseMapper
().
selectOne
(
queryWrapper
);
LambdaQueryWrapper
<
FinancingRectificationOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
FinancingRectificationOrder:
:
getPeasantHouseholdId
,
financingInfo
.
getPeasantHouseholdId
());
queryWrapper
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
queryWrapper
.
last
(
"limit 1"
);
FinancingRectificationOrder
oldData
=
financingRectificationOrderService
.
getBaseMapper
().
selectOne
(
queryWrapper
);
FinancingRectificationOrder
financingRectificationOrder
=
new
FinancingRectificationOrder
();
//若存在历史整改单 将历史整改单数据同步至新整改单 便于修改
if
(
ObjectUtils
.
isNotEmpty
(
oldData
))
{
BeanUtils
.
copyProperties
(
oldData
,
financingRectificationOrder
);
financingRectificationOrder
.
setSequenceNbr
(
null
);
financingRectificationOrder
.
setCompleteDate
(
null
);
financingRectificationOrder
.
setRectificationPhoto
(
null
);
}
financingRectificationOrder
.
setRectificationOrderCode
(
String
.
valueOf
(
new
Date
().
getTime
()));
financingRectificationOrder
.
setRectificationStatus
(
"待整改"
);
financingRectificationOrder
.
setProblemDescription
(
params
.
getOrDefault
(
"problemDescription"
,
""
).
toString
());
financingRectificationOrder
.
setPeasantHouseholdName
(
params
.
getOrDefault
(
"peasantHouseholdName"
,
""
).
toString
());
financingRectificationOrder
.
setRectificationDescription
(
params
.
getOrDefault
(
"rectificationDescription"
,
""
).
toString
());
financingRectificationOrder
.
setPeasantHouseholdId
(
financingInfo
.
getPeasantHouseholdId
());
financingRectificationOrder
.
setResponsibleUserName
(
params
.
getOrDefault
(
"responsibleUserName"
,
""
).
toString
());
financingRectificationOrder
.
setResponsibleUserPhone
(
params
.
getOrDefault
(
"responsibleUserPhone"
,
""
).
toString
());
financingRectificationOrderService
.
save
(
financingRectificationOrder
);
FinancingRectificationOrder
financingRectificationOrder
=
new
FinancingRectificationOrder
();
//若存在历史整改单 将历史整改单数据同步至新整改单 便于修改
if
(
ObjectUtils
.
isNotEmpty
(
oldData
))
{
BeanUtils
.
copyProperties
(
oldData
,
financingRectificationOrder
);
financingRectificationOrder
.
setSequenceNbr
(
null
);
financingRectificationOrder
.
setCompleteDate
(
null
);
financingRectificationOrder
.
setRectificationPhoto
(
null
);
}
financingRectificationOrder
.
setRectificationOrderCode
(
String
.
valueOf
(
new
Date
().
getTime
()));
financingRectificationOrder
.
setRectificationStatus
(
"待整改"
);
financingRectificationOrder
.
setProblemDescription
(
params
.
getOrDefault
(
"problemDescription"
,
""
).
toString
());
financingRectificationOrder
.
setPeasantHouseholdName
(
params
.
getOrDefault
(
"peasantHouseholdName"
,
""
).
toString
());
financingRectificationOrder
.
setRectificationDescription
(
params
.
getOrDefault
(
"rectificationDescription"
,
""
).
toString
());
financingRectificationOrder
.
setPeasantHouseholdId
(
financingInfo
.
getPeasantHouseholdId
());
financingRectificationOrder
.
setResponsibleUserName
(
params
.
getOrDefault
(
"responsibleUserName"
,
""
).
toString
());
financingRectificationOrder
.
setResponsibleUserPhone
(
params
.
getOrDefault
(
"responsibleUserPhone"
,
""
).
toString
());
financingRectificationOrderService
.
save
(
financingRectificationOrder
);
}
}
public
List
<
Map
<
String
,
Object
>>
selectOrgList
()
{
return
this
.
getBaseMapper
().
selectOrgList
();
public
List
<
Map
<
String
,
Object
>>
selectOrgList
()
{
return
this
.
getBaseMapper
().
selectOrgList
();
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationServiceImpl.java
View file @
138a4d88
...
...
@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.formula.functions.T
;
...
...
@@ -232,7 +233,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
}
@Override
@Transactional
@
Global
Transactional
public
String
powerStationExamine
(
long
pageId
,
String
nodeCode
,
String
stationId
,
String
taskId
,
String
planInstanceId
,
Map
<
String
,
Object
>
kv
)
{
String
meg
=
""
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/SurveyInformationServiceImpl.java
View file @
138a4d88
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.component.robot.AmosRequestContext;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -50,326 +51,326 @@ import java.util.stream.Stream;
@Service
@Slf4j
public
class
SurveyInformationServiceImpl
extends
BaseService
<
SurveyInformationDto
,
SurveyInformation
,
SurveyInformationMapper
>
implements
ISurveyInformationService
{
@Autowired
SurveyDetailsServiceImpl
surveyDetailsService
;
@Autowired
InformationServiceImpl
informationService
;
@Autowired
ExtendedInformationServiceImpl
extendedInformationService
;
@Autowired
CommercialServiceImpl
commercialService
;
@Autowired
PeasantHouseholdServiceImpl
peasantHouseholdServiceImpl
;
@Autowired
DesignInformationServiceImpl
designInformationService
;
@Autowired
WorkflowFeignClient
workflowFeignClient
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
IdxFeginService
idxFeginService
;
@Autowired
RegionalCompaniesMapper
regionalCompaniesMapper
;
@Autowired
IPowerStationService
powerStationService
;
@Autowired
ToDoTasksMapper
toDoTasksMapper
;
@Autowired
UserMessageMapper
userMessageMapper
;
@Value
(
"${power.station.examine.pageId}"
)
private
long
pageId
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Value
(
"${power.station.examine.planId}"
)
private
String
planId
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
WorkOrderMapper
workOrderMapper
;
@Autowired
HygfOnGridMapper
hygfOnGridMapper
;
@Autowired
ConstructionRecordsServiceImpl
constructionRecordsServiceImpl
;
@Autowired
ConstructionRecordsMapper
constructionRecordsMapper
;
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
SurveyInformationMapper
surveyInformationMapper
;
@Autowired
PowerStationConstructionDataMapper
powerStationConstructionDataMapper
;
@Autowired
PowerStationEngineeringInfoMapper
powerStationEngineeringInfoMapper
;
@Autowired
WorkOrderPowerStationMapper
workOrderPowerStationMapper
;
@Autowired
AmosRequestContext
requestContext
;
@Autowired
WorkflowImpl
workflow
;
/**
* 分页查询
*/
public
Page
<
SurveyInformationDto
>
queryForSurveyInformationPage
(
Page
<
SurveyInformationDto
>
page
)
{
return
this
.
queryForPage
(
page
,
"rec_date"
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
SurveyInformationDto
>
queryForSurveyInformationList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@
Transactional
public
SurveyInfoAllDto
saveSurveyInfo
(
SurveyInfoAllDto
surveyInfoAllDto
,
String
operationType
)
{
try
{
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
// 更新勘察基本信息
SurveyInformation
surveyInformation
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getSurveyInformation
(),
SurveyInformation
.
class
);
surveyInformation
.
setReview
(
0
);
if
(
OPERATION_TYPE_APPLY
.
equals
(
operationType
)
&&
null
==
surveyInformation
.
getCreatorTime
())
{
surveyInformation
.
setCreatorTime
(
new
Date
());
}
this
.
saveOrUpdate
(
surveyInformation
);
// 更新扩展信息
ExtendedInformation
extendedInformation
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getExtendedInformation
(),
ExtendedInformation
.
class
);
extendedInformation
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
extendedInformationService
.
saveOrUpdate
(
extendedInformation
,
new
LambdaQueryWrapper
<
ExtendedInformation
>()
.
eq
(
ExtendedInformation:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//extendedInformationService.saveOrUpdate(extendedInformation);
// 更新勘察明细信息
SurveyDetailsDto
oldSurveyDetails
=
surveyInfoAllDto
.
getSurveyDetails
();
SurveyDetails
surveyDetails
=
BeanDtoUtils
.
convert
(
oldSurveyDetails
,
SurveyDetails
.
class
);
surveyDetails
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
surveyDetailsService
.
saveOrUpdate
(
surveyDetails
,
new
LambdaQueryWrapper
<
SurveyDetails
>()
.
eq
(
SurveyDetails:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//surveyDetailsService.saveOrUpdate(surveyDetails);
// 更新商务信息
CommercialDto
oldCommercial
=
surveyInfoAllDto
.
getCommercial
();
Commercial
commercial
=
BeanDtoUtils
.
convert
(
oldCommercial
,
Commercial
.
class
);
// 处理省市县
String
paddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
paddressName
=
paddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
commercial
.
setProjectAddressName
(
paddressName
.
substring
(
0
,
paddressName
.
length
()
-
1
));
commercial
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
commercialService
.
saveOrUpdate
(
commercial
,
new
LambdaQueryWrapper
<
Commercial
>()
.
eq
(
Commercial:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//commercialService.saveOrUpdate(commercial);
// 勘察后,更新状态
QueryWrapper
<
PeasantHousehold
>
peasantHouseholdQueryWrapper
=
new
QueryWrapper
<>();
peasantHouseholdQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformation
.
getSequenceNbr
());
PeasantHousehold
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
()
.
selectOne
(
peasantHouseholdQueryWrapper
);
// 更新资料归档信息
Information
information
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getInformation
(),
Information
.
class
);
information
.
setHouseProve
(
null
==
commercial
?
null
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getRealEstateLegal
())
?
commercial
.
getRealEstateLegal
()
:
null
));
information
.
setCardFile
(
null
==
commercial
?
null
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getIdCardCredit
())
?
commercial
.
getIdCardCredit
()
:
null
));
information
.
setCardFile
(
commercial
.
getAgentLegal
());
information
.
setArchivesNumber
(
this
.
getNo
(
CodeEnum
.
档案
.
getCode
(),
peasantHousehold
.
getRegionalCompaniesSeq
()));
information
.
setFileNumber
(
this
.
getNo
(
CodeEnum
.
文件
.
getCode
(),
peasantHousehold
.
getRegionalCompaniesSeq
()));
information
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
informationService
.
saveOrUpdate
(
information
,
new
LambdaQueryWrapper
<
Information
>()
.
eq
(
Information:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//informationService.saveOrUpdate(information);
peasantHousehold
.
setOwnersName
(
surveyInfoAllDto
.
getSurveyInformation
().
getOwnersName
());
peasantHousehold
.
setTelephone
(
surveyInfoAllDto
.
getSurveyInformation
().
getTelephone
());
peasantHousehold
.
setIdCard
(
surveyInfoAllDto
.
getSurveyInformation
().
getIdCard
());
peasantHousehold
.
setMailbox
(
surveyInfoAllDto
.
getSurveyInformation
().
getMailbox
());
peasantHousehold
.
setProjectAddress
(
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
());
peasantHousehold
.
setProjectAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddressDetail
());
peasantHousehold
.
setPermanentAddress
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddress
());
peasantHousehold
.
setPermanentAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddressDetail
());
peasantHousehold
.
setPermanentAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddressDetail
());
// 处理项目地址
String
projectAddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
projectAddressName
=
projectAddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
peasantHousehold
.
setProjectAddressName
(
projectAddressName
.
substring
(
0
,
projectAddressName
.
length
()
-
1
));
// 常住地址
String
permanentAddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
permanentAddressName
=
permanentAddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
peasantHousehold
.
setPermanentAddressName
(
permanentAddressName
.
substring
(
0
,
permanentAddressName
.
length
()
-
1
));
if
(
OPERATION_TYPE_SUBMIT
.
equals
(
operationType
))
{
// peasantHousehold.setSurveyOrNot(1);
}
else
if
(
OPERATION_TYPE_APPLY
.
equals
(
operationType
))
{
// 提交审核
submitExamine
(
peasantHousehold
);
LambdaQueryWrapper
<
ToDoTasks
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
ToDoTasks:
:
getType
,
TaskTypeStationEnum
.
电站勘察
.
getCode
());
wrapper
.
eq
(
ToDoTasks:
:
getState
,
"待办"
);
wrapper
.
eq
(
ToDoTasks:
:
getBusinessId
,
peasantHousehold
.
getSequenceNbr
());
ToDoTasks
doTasks
=
toDoTasksMapper
.
selectOne
(
wrapper
);
if
(
doTasks
!=
null
)
{
doTasks
.
setState
(
"已办"
);
doTasks
.
setCompleteTime
(
new
Date
());
toDoTasksMapper
.
updateById
(
doTasks
);
emqKeeper
.
getMqttClient
().
publish
(
"TASK_MESSAGE"
,
JSON
.
toJSONString
(
doTasks
).
getBytes
(),
2
,
false
);
UserMessage
userMessage
=
new
UserMessage
(
doTasks
.
getType
(),
doTasks
.
getBusinessId
(),
doTasks
.
getAmosUserId
(),
new
Date
(),
doTasks
.
getTaskName
()
+
"已完成"
,
doTasks
.
getAmosOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
}
peasantHouseholdServiceImpl
.
saveOrUpdate
(
peasantHousehold
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"系统异常"
);
}
return
surveyInfoAllDto
;
}
public
String
getNo
(
String
type
,
Long
sequenceNbr
)
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()
==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司编号为空, 请设置编号"
);
}
if
(
da
.
getRegionalAddress
()
==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司省市区为空, 请设置省市区"
);
}
String
code
=
NumberUtil
.
getCode
(
type
,
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
return
code
;
}
private
void
submitExamine
(
PeasantHousehold
peasantHousehold
)
{
PowerStation
powerStation
=
powerStationService
.
getObjByNhId
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()),
PowerStationProcessStateEnum
.
作废
.
getCode
());
String
taskId
=
null
;
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>(
1
);
objectMap
.
put
(
"describe"
,
"经销商已上传信息"
);
// 保存并审核
try
{
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
if
(
ObjectUtils
.
isNotEmpty
(
powerStation
))
{
// 工作流执行一步
// taskId = powerStation.getTaskId();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setResult
(
"0"
);
standardDto
.
setTaskId
(
powerStation
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
"0"
);
standardDto
.
setVariable
(
variable
);
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
requestContext
.
getUserId
());
}
else
{
// 第一步启动工作流
// 发起工作流
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setBusinessKey
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
processDto
.
setProcessDefinitionKey
(
"hygf_10001"
);
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
process
.
add
(
processDto
);
startProcessDto
.
setProcess
(
process
);
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
requestContext
.
getUserId
());
powerStation
=
new
PowerStation
();
}
peasantHousehold
.
setSurveyOrNot
(
2
);
peasantHousehold
.
setReview
(
1
);
// 插入记录表
powerStation
.
setPlanInstanceId
(
planId
);
powerStation
.
setPowerStationCode
(
peasantHousehold
.
getPeasantHouseholdNo
());
powerStation
.
setOwnersName
(
peasantHousehold
.
getOwnersName
());
powerStation
.
setProjectAddress
(
peasantHousehold
.
getProjectAddressName
());
powerStation
.
setPeasantHouseholdId
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
powerStation
.
setProcessStatus
(
PowerStationProcessStateEnum
.
进行中
.
getName
());
powerStation
.
setServiceAgent
(
peasantHousehold
.
getDeveloperName
());
// 获取流程信息
powerStation
.
setTaskId
(
basicGridAcceptance
.
getNextTaskId
());
powerStation
.
setProcessInstanceId
(
basicGridAcceptance
.
getInstanceId
());
powerStation
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
powerStation
.
setNodeRole
(
basicGridAcceptance
.
getNextExecutorIds
());
powerStation
.
setNodeRouting
(
PowerStationEnum
.
getNodeByKey
(
basicGridAcceptance
.
getNextNodeKey
()));
powerStation
.
setNextProcessNode
(
PowerStationNodeEnum
.
设计审核
.
getCode
());
powerStation
.
setPromoter
(
basicGridAcceptance
.
getPromoter
());
powerStation
.
setNextExecuteUserIds
(
basicGridAcceptance
.
getNextExecuteUserIds
());
powerStation
.
setNextNodeName
(
basicGridAcceptance
.
getNextNodeName
());
powerStationService
.
savePowerStation
(
powerStation
,
true
,
powerStation
.
getOwnersName
(),
""
);
//
peasantHousehold
.
setConstructionState
(
ArrivalStateeEnum
.
勘察中
.
getCode
());
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
勘察中
.
getCode
());
long
idsk
=
peasantHousehold
.
getSequenceNbr
();
up
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
idsk
);
peasantHouseholdMapper
.
update
(
null
,
up
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
extends
BaseService
<
SurveyInformationDto
,
SurveyInformation
,
SurveyInformationMapper
>
implements
ISurveyInformationService
{
@Autowired
SurveyDetailsServiceImpl
surveyDetailsService
;
@Autowired
InformationServiceImpl
informationService
;
@Autowired
ExtendedInformationServiceImpl
extendedInformationService
;
@Autowired
CommercialServiceImpl
commercialService
;
@Autowired
PeasantHouseholdServiceImpl
peasantHouseholdServiceImpl
;
@Autowired
DesignInformationServiceImpl
designInformationService
;
@Autowired
WorkflowFeignClient
workflowFeignClient
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
IdxFeginService
idxFeginService
;
@Autowired
RegionalCompaniesMapper
regionalCompaniesMapper
;
@Autowired
IPowerStationService
powerStationService
;
@Autowired
ToDoTasksMapper
toDoTasksMapper
;
@Autowired
UserMessageMapper
userMessageMapper
;
@Value
(
"${power.station.examine.pageId}"
)
private
long
pageId
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Value
(
"${power.station.examine.planId}"
)
private
String
planId
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
WorkOrderMapper
workOrderMapper
;
@Autowired
HygfOnGridMapper
hygfOnGridMapper
;
@Autowired
ConstructionRecordsServiceImpl
constructionRecordsServiceImpl
;
@Autowired
ConstructionRecordsMapper
constructionRecordsMapper
;
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
SurveyInformationMapper
surveyInformationMapper
;
@Autowired
PowerStationConstructionDataMapper
powerStationConstructionDataMapper
;
@Autowired
PowerStationEngineeringInfoMapper
powerStationEngineeringInfoMapper
;
@Autowired
WorkOrderPowerStationMapper
workOrderPowerStationMapper
;
@Autowired
AmosRequestContext
requestContext
;
@Autowired
WorkflowImpl
workflow
;
/**
* 分页查询
*/
public
Page
<
SurveyInformationDto
>
queryForSurveyInformationPage
(
Page
<
SurveyInformationDto
>
page
)
{
return
this
.
queryForPage
(
page
,
"rec_date"
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
SurveyInformationDto
>
queryForSurveyInformationList
()
{
return
this
.
queryForList
(
""
,
false
);
}
@Global
Transactional
public
SurveyInfoAllDto
saveSurveyInfo
(
SurveyInfoAllDto
surveyInfoAllDto
,
String
operationType
)
{
try
{
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
// 更新勘察基本信息
SurveyInformation
surveyInformation
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getSurveyInformation
(),
SurveyInformation
.
class
);
surveyInformation
.
setReview
(
0
);
if
(
OPERATION_TYPE_APPLY
.
equals
(
operationType
)
&&
null
==
surveyInformation
.
getCreatorTime
())
{
surveyInformation
.
setCreatorTime
(
new
Date
());
}
this
.
saveOrUpdate
(
surveyInformation
);
// 更新扩展信息
ExtendedInformation
extendedInformation
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getExtendedInformation
(),
ExtendedInformation
.
class
);
extendedInformation
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
extendedInformationService
.
saveOrUpdate
(
extendedInformation
,
new
LambdaQueryWrapper
<
ExtendedInformation
>()
.
eq
(
ExtendedInformation:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//extendedInformationService.saveOrUpdate(extendedInformation);
// 更新勘察明细信息
SurveyDetailsDto
oldSurveyDetails
=
surveyInfoAllDto
.
getSurveyDetails
();
SurveyDetails
surveyDetails
=
BeanDtoUtils
.
convert
(
oldSurveyDetails
,
SurveyDetails
.
class
);
surveyDetails
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
surveyDetailsService
.
saveOrUpdate
(
surveyDetails
,
new
LambdaQueryWrapper
<
SurveyDetails
>()
.
eq
(
SurveyDetails:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//surveyDetailsService.saveOrUpdate(surveyDetails);
// 更新商务信息
CommercialDto
oldCommercial
=
surveyInfoAllDto
.
getCommercial
();
Commercial
commercial
=
BeanDtoUtils
.
convert
(
oldCommercial
,
Commercial
.
class
);
// 处理省市县
String
paddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
paddressName
=
paddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
commercial
.
setProjectAddressName
(
paddressName
.
substring
(
0
,
paddressName
.
length
()
-
1
));
commercial
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
commercialService
.
saveOrUpdate
(
commercial
,
new
LambdaQueryWrapper
<
Commercial
>()
.
eq
(
Commercial:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//commercialService.saveOrUpdate(commercial);
// 勘察后,更新状态
QueryWrapper
<
PeasantHousehold
>
peasantHouseholdQueryWrapper
=
new
QueryWrapper
<>();
peasantHouseholdQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformation
.
getSequenceNbr
());
PeasantHousehold
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
()
.
selectOne
(
peasantHouseholdQueryWrapper
);
// 更新资料归档信息
Information
information
=
BeanDtoUtils
.
convert
(
surveyInfoAllDto
.
getInformation
(),
Information
.
class
);
information
.
setHouseProve
(
null
==
commercial
?
null
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getRealEstateLegal
())
?
commercial
.
getRealEstateLegal
()
:
null
));
information
.
setCardFile
(
null
==
commercial
?
null
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getIdCardCredit
())
?
commercial
.
getIdCardCredit
()
:
null
));
information
.
setCardFile
(
commercial
.
getAgentLegal
());
information
.
setArchivesNumber
(
this
.
getNo
(
CodeEnum
.
档案
.
getCode
(),
peasantHousehold
.
getRegionalCompaniesSeq
()));
information
.
setFileNumber
(
this
.
getNo
(
CodeEnum
.
文件
.
getCode
(),
peasantHousehold
.
getRegionalCompaniesSeq
()));
information
.
setSurveyInformationId
(
surveyInformation
.
getSequenceNbr
());
// 避免生成多份数据
informationService
.
saveOrUpdate
(
information
,
new
LambdaQueryWrapper
<
Information
>()
.
eq
(
Information:
:
getSurveyInformationId
,
surveyInformation
.
getSequenceNbr
()));
//informationService.saveOrUpdate(information);
peasantHousehold
.
setOwnersName
(
surveyInfoAllDto
.
getSurveyInformation
().
getOwnersName
());
peasantHousehold
.
setTelephone
(
surveyInfoAllDto
.
getSurveyInformation
().
getTelephone
());
peasantHousehold
.
setIdCard
(
surveyInfoAllDto
.
getSurveyInformation
().
getIdCard
());
peasantHousehold
.
setMailbox
(
surveyInfoAllDto
.
getSurveyInformation
().
getMailbox
());
peasantHousehold
.
setProjectAddress
(
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
());
peasantHousehold
.
setProjectAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddressDetail
());
peasantHousehold
.
setPermanentAddress
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddress
());
peasantHousehold
.
setPermanentAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddressDetail
());
peasantHousehold
.
setPermanentAddressDetail
(
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddressDetail
());
// 处理项目地址
String
projectAddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getProjectAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
projectAddressName
=
projectAddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
peasantHousehold
.
setProjectAddressName
(
projectAddressName
.
substring
(
0
,
projectAddressName
.
length
()
-
1
));
// 常住地址
String
permanentAddressName
=
""
;
for
(
Integer
reg
:
surveyInfoAllDto
.
getSurveyInformation
().
getPermanentAddress
())
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
reg
)))
{
permanentAddressName
=
permanentAddressName
+
re
.
getRegionName
()
+
"/"
;
}
}
}
peasantHousehold
.
setPermanentAddressName
(
permanentAddressName
.
substring
(
0
,
permanentAddressName
.
length
()
-
1
));
if
(
OPERATION_TYPE_SUBMIT
.
equals
(
operationType
))
{
// peasantHousehold.setSurveyOrNot(1);
}
else
if
(
OPERATION_TYPE_APPLY
.
equals
(
operationType
))
{
// 提交审核
submitExamine
(
peasantHousehold
);
LambdaQueryWrapper
<
ToDoTasks
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
ToDoTasks:
:
getType
,
TaskTypeStationEnum
.
电站勘察
.
getCode
());
wrapper
.
eq
(
ToDoTasks:
:
getState
,
"待办"
);
wrapper
.
eq
(
ToDoTasks:
:
getBusinessId
,
peasantHousehold
.
getSequenceNbr
());
ToDoTasks
doTasks
=
toDoTasksMapper
.
selectOne
(
wrapper
);
if
(
doTasks
!=
null
)
{
doTasks
.
setState
(
"已办"
);
doTasks
.
setCompleteTime
(
new
Date
());
toDoTasksMapper
.
updateById
(
doTasks
);
emqKeeper
.
getMqttClient
().
publish
(
"TASK_MESSAGE"
,
JSON
.
toJSONString
(
doTasks
).
getBytes
(),
2
,
false
);
UserMessage
userMessage
=
new
UserMessage
(
doTasks
.
getType
(),
doTasks
.
getBusinessId
(),
doTasks
.
getAmosUserId
(),
new
Date
(),
doTasks
.
getTaskName
()
+
"已完成"
,
doTasks
.
getAmosOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
}
peasantHouseholdServiceImpl
.
saveOrUpdate
(
peasantHousehold
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"系统异常"
);
}
return
surveyInfoAllDto
;
}
public
String
getNo
(
String
type
,
Long
sequenceNbr
)
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()
==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司编号为空, 请设置编号"
);
}
if
(
da
.
getRegionalAddress
()
==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司省市区为空, 请设置省市区"
);
}
String
code
=
NumberUtil
.
getCode
(
type
,
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
return
code
;
}
private
void
submitExamine
(
PeasantHousehold
peasantHousehold
)
{
PowerStation
powerStation
=
powerStationService
.
getObjByNhId
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()),
PowerStationProcessStateEnum
.
作废
.
getCode
());
String
taskId
=
null
;
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>(
1
);
objectMap
.
put
(
"describe"
,
"经销商已上传信息"
);
// 保存并审核
try
{
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
if
(
ObjectUtils
.
isNotEmpty
(
powerStation
))
{
// 工作流执行一步
// taskId = powerStation.getTaskId();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setResult
(
"0"
);
standardDto
.
setTaskId
(
powerStation
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
"0"
);
standardDto
.
setVariable
(
variable
);
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
requestContext
.
getUserId
());
}
else
{
// 第一步启动工作流
// 发起工作流
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setBusinessKey
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
processDto
.
setProcessDefinitionKey
(
"hygf_10001"
);
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
process
.
add
(
processDto
);
startProcessDto
.
setProcess
(
process
);
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
requestContext
.
getUserId
());
powerStation
=
new
PowerStation
();
}
peasantHousehold
.
setSurveyOrNot
(
2
);
peasantHousehold
.
setReview
(
1
);
// 插入记录表
powerStation
.
setPlanInstanceId
(
planId
);
powerStation
.
setPowerStationCode
(
peasantHousehold
.
getPeasantHouseholdNo
());
powerStation
.
setOwnersName
(
peasantHousehold
.
getOwnersName
());
powerStation
.
setProjectAddress
(
peasantHousehold
.
getProjectAddressName
());
powerStation
.
setPeasantHouseholdId
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
powerStation
.
setProcessStatus
(
PowerStationProcessStateEnum
.
进行中
.
getName
());
powerStation
.
setServiceAgent
(
peasantHousehold
.
getDeveloperName
());
// 获取流程信息
powerStation
.
setTaskId
(
basicGridAcceptance
.
getNextTaskId
());
powerStation
.
setProcessInstanceId
(
basicGridAcceptance
.
getInstanceId
());
powerStation
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
powerStation
.
setNodeRole
(
basicGridAcceptance
.
getNextExecutorIds
());
powerStation
.
setNodeRouting
(
PowerStationEnum
.
getNodeByKey
(
basicGridAcceptance
.
getNextNodeKey
()));
powerStation
.
setNextProcessNode
(
PowerStationNodeEnum
.
设计审核
.
getCode
());
powerStation
.
setPromoter
(
basicGridAcceptance
.
getPromoter
());
powerStation
.
setNextExecuteUserIds
(
basicGridAcceptance
.
getNextExecuteUserIds
());
powerStation
.
setNextNodeName
(
basicGridAcceptance
.
getNextNodeName
());
powerStationService
.
savePowerStation
(
powerStation
,
true
,
powerStation
.
getOwnersName
(),
""
);
//
peasantHousehold
.
setConstructionState
(
ArrivalStateeEnum
.
勘察中
.
getCode
());
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
勘察中
.
getCode
());
long
idsk
=
peasantHousehold
.
getSequenceNbr
();
up
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
idsk
);
peasantHouseholdMapper
.
update
(
null
,
up
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
// PowerStation powerStation = powerStationService.getObjByNhId(String.valueOf(peasantHousehold.getSequenceNbr()), PowerStationProcessStateEnum.作废.getCode());
//
...
...
@@ -417,285 +418,285 @@ public class SurveyInformationServiceImpl
// e.printStackTrace();
// throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
// }
}
public
SurveyInfoAllDto
querySurveyInfo
(
String
surveyInformationId
,
String
peasantHouseholdId
,
String
processInstanceId
,
AgencyUserModel
userInfo
)
{
SurveyInfoAllDto
surveyInfoAllDto
=
new
SurveyInfoAllDto
();
PeasantHousehold
peasantHousehold
=
new
PeasantHousehold
();
if
(!
StringUtils
.
isEmpty
(
peasantHouseholdId
))
{
LambdaQueryWrapper
<
PeasantHousehold
>
peasantHouseholdWrapper
=
new
LambdaQueryWrapper
<>();
peasantHouseholdWrapper
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
peasantHouseholdId
);
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
().
selectOne
(
peasantHouseholdWrapper
);
surveyInformationId
=
String
.
valueOf
(
peasantHousehold
.
getSurveyInformationId
());
}
else
{
QueryWrapper
<
PeasantHousehold
>
peasantHouseholdQueryWrapper
=
new
QueryWrapper
<>();
peasantHouseholdQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
().
selectOne
(
peasantHouseholdQueryWrapper
);
}
// 勘察基本信息
LambdaQueryWrapper
<
SurveyInformation
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SurveyInformation:
:
getSequenceNbr
,
surveyInformationId
);
SurveyInformation
surveyInformation
=
this
.
baseMapper
.
selectOne
(
queryWrapper
);
surveyInfoAllDto
.
setSurveyInformation
(
BeanDtoUtils
.
convert
(
surveyInformation
,
SurveyInformationDto
.
class
));
// 农户信息
// 获取用户所在经销商单位
UserUnitInformationDto
userUnitInformationDto
=
personnelBusinessMapper
.
getUserUnitInformationDto
(
peasantHousehold
.
getDeveloperUserId
());
BeanUtils
.
copyProperties
(
peasantHousehold
,
surveyInfoAllDto
.
getSurveyInformation
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperName
(
userUnitInformationDto
.
getAmosDealerName
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperCode
(
userUnitInformationDto
.
getAmosDealerOrgCode
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperId
(
userUnitInformationDto
.
getAmosDealerId
());
if
(
surveyInfoAllDto
.
getSurveyInformation
().
getSalesmanId
()
==
null
)
{
surveyInfoAllDto
.
getSurveyInformation
().
setSalesmanId
(
peasantHousehold
.
getDeveloperUserId
());
surveyInfoAllDto
.
getSurveyInformation
().
setSalesman
(
peasantHousehold
.
getDeveloper
());
surveyInfoAllDto
.
getSurveyInformation
().
setCreator
(
peasantHousehold
.
getDeveloper
());
}
if
(!
StringUtils
.
isEmpty
(
peasantHousehold
.
getProjectAddressName
()))
{
surveyInfoAllDto
.
getSurveyInformation
()
.
setProjectAddressText
(
Arrays
.
asList
(
peasantHousehold
.
getProjectAddressName
().
split
(
"/"
)));
}
if
(!
StringUtils
.
isEmpty
(
peasantHousehold
.
getPermanentAddressName
()))
{
surveyInfoAllDto
.
getSurveyInformation
()
.
setPermanentAddressText
(
Arrays
.
asList
(
peasantHousehold
.
getPermanentAddressName
().
split
(
"/"
)));
}
if
(
peasantHousehold
.
getPermanentAddress
()
==
null
)
{
surveyInfoAllDto
.
getSurveyInformation
().
setPermanentAddress
(
peasantHousehold
.
getProjectAddress
());
surveyInfoAllDto
.
getSurveyInformation
().
setIsPermanent
(
"1"
);
}
surveyInfoAllDto
.
getSurveyInformation
().
setSequenceNbr
(
surveyInformation
.
getSequenceNbr
());
// 制单时间
surveyInfoAllDto
.
getSurveyInformation
().
setCreatorTime
(
surveyInformation
.
getCreatorTime
());
QueryWrapper
<
SurveyDetails
>
surveyDetailsQueryWrapper
=
new
QueryWrapper
<>();
surveyDetailsQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
SurveyDetails
surveyDetails
=
surveyDetailsService
.
getBaseMapper
().
selectOne
(
surveyDetailsQueryWrapper
);
if
(
surveyDetails
==
null
)
{
surveyInfoAllDto
.
setSurveyDetails
(
new
SurveyDetailsDto
());
}
else
{
surveyInfoAllDto
.
setSurveyDetails
(
BeanDtoUtils
.
convert
(
surveyDetails
,
SurveyDetailsDto
.
class
));
}
QueryWrapper
<
Information
>
informationQueryWrapper
=
new
QueryWrapper
<>();
informationQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
Information
information
=
informationService
.
getBaseMapper
().
selectOne
(
informationQueryWrapper
);
QueryWrapper
<
Commercial
>
commercialQueryWrapper
=
new
QueryWrapper
<>();
commercialQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
Commercial
commercial
=
commercialService
.
getBaseMapper
().
selectOne
(
commercialQueryWrapper
);
if
(
commercial
==
null
)
{
commercial
=
new
Commercial
();
}
if
(
information
==
null
)
{
surveyInfoAllDto
.
setInformation
(
new
InformationDto
());
}
else
{
information
.
setHouseProve
(
null
==
commercial
?
new
ArrayList
<>()
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getRealEstateLegal
())
?
commercial
.
getRealEstateLegal
()
:
new
ArrayList
<>()));
information
.
setCardFile
(
null
==
commercial
?
new
ArrayList
<>()
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getIdCardCredit
())
?
commercial
.
getIdCardCredit
()
:
new
ArrayList
<>()));
surveyInfoAllDto
.
setInformation
(
BeanDtoUtils
.
convert
(
information
,
InformationDto
.
class
));
}
commercial
.
setApplicant
(
peasantHousehold
.
getOwnersName
());
commercial
.
setIdCard
(
peasantHousehold
.
getIdCard
());
commercial
.
setTelephone
(
peasantHousehold
.
getTelephone
());
commercial
.
setProjectAddress
(
peasantHousehold
.
getProjectAddress
());
commercial
.
setProjectAddressName
(
peasantHousehold
.
getProjectAddressName
());
commercial
.
setProjectAddressDetail
(
peasantHousehold
.
getProjectAddressDetail
());
commercial
.
setLegalContactTelephone
(
peasantHousehold
.
getTelephone
());
List
<
Object
>
list
=
new
ArrayList
<>();
if
(
null
!=
surveyDetails
)
{
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getSurroundingHouseSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getSurroundingHouseSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getOverallHousingSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getOverallHousingSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getPanoramaSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getPanoramaSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getPlanSketchSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getPlanSketchSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getAzimuthSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getAzimuthSurvey
());
}
}
commercial
.
setSurveyPhotosWeb
(
list
);
if
(
information
==
null
)
{
CommercialDto
commercialDto
=
BeanDtoUtils
.
convert
(
commercial
,
CommercialDto
.
class
);
commercialDto
.
setType
(
"zrr"
);
commercialDto
.
setLegalType
(
"zjdnhw"
);
surveyInfoAllDto
.
setCommercial
(
commercialDto
);
}
else
{
surveyInfoAllDto
.
setCommercial
(
BeanDtoUtils
.
convert
(
commercial
,
CommercialDto
.
class
));
if
(
commercial
!=
null
&&
!
StringUtils
.
isEmpty
(
commercial
.
getProjectAddressName
()))
{
surveyInfoAllDto
.
getCommercial
()
.
setProjectAddressText
(
Arrays
.
asList
(
commercial
.
getProjectAddressName
().
split
(
"/"
)));
}
}
QueryWrapper
<
ExtendedInformation
>
extendedInformationQueryWrapper
=
new
QueryWrapper
<>();
extendedInformationQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
ExtendedInformation
extendedInformation
=
extendedInformationService
.
getBaseMapper
()
.
selectOne
(
extendedInformationQueryWrapper
);
if
(
information
==
null
)
{
surveyInfoAllDto
.
setExtendedInformation
(
new
ExtendedInformationDto
());
}
else
{
surveyInfoAllDto
.
setExtendedInformation
(
BeanDtoUtils
.
convert
(
extendedInformation
,
ExtendedInformationDto
.
class
));
}
QueryWrapper
<
DesignInformation
>
designInformationQueryWrapper
=
new
QueryWrapper
<>();
designInformationQueryWrapper
.
eq
(
"peasant_household_id"
,
peasantHousehold
.
getSequenceNbr
());
DesignInformation
designInformation
=
designInformationService
.
getBaseMapper
()
.
selectOne
(
designInformationQueryWrapper
);
if
(
designInformation
==
null
)
{
surveyInfoAllDto
.
setDesignInformation
(
new
DesignInformationDto
());
}
else
{
surveyInfoAllDto
.
setDesignInformation
(
BeanDtoUtils
.
convert
(
designInformation
,
DesignInformationDto
.
class
));
}
LambdaQueryWrapper
<
WorkOrderPowerStation
>
up1
=
new
LambdaQueryWrapper
();
up1
.
eq
(
WorkOrderPowerStation:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
WorkOrderPowerStation
workOrderPowerStation
=
workOrderPowerStationMapper
.
selectOne
(
up1
);
if
(
workOrderPowerStation
!=
null
)
{
Long
workOrderId
=
workOrderPowerStation
.
getWorkOrderId
();
Long
workOrderPowerStationId
=
workOrderPowerStation
.
getSequenceNbr
();
// 派工单信息
LambdaQueryWrapper
<
WorkOrder
>
upl
=
new
LambdaQueryWrapper
();
upl
.
eq
(
WorkOrder:
:
getSequenceNbr
,
workOrderId
);
WorkOrder
workOrder
=
workOrderMapper
.
selectOne
(
upl
);
// 施工信息
LambdaQueryWrapper
<
PowerStationConstructionData
>
up2
=
new
LambdaQueryWrapper
();
up2
.
eq
(
PowerStationConstructionData:
:
getWorkOrderId
,
workOrderId
);
up2
.
eq
(
PowerStationConstructionData:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
PowerStationConstructionData
powerStationConstructionData
=
powerStationConstructionDataMapper
.
selectOne
(
up2
);
// 工程信息
LambdaQueryWrapper
<
PowerStationEngineeringInfo
>
up3
=
new
LambdaQueryWrapper
();
up3
.
eq
(
PowerStationEngineeringInfo:
:
getWorkOrderId
,
workOrderId
);
up3
.
eq
(
PowerStationEngineeringInfo:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
PowerStationEngineeringInfo
powerStationEngineeringInfo
=
powerStationEngineeringInfoMapper
.
selectOne
(
up3
);
if
(
powerStationConstructionData
!=
null
)
{
powerStationEngineeringInfo
=
powerStationEngineeringInfo
!=
null
?
powerStationEngineeringInfo
:
new
PowerStationEngineeringInfo
();
powerStationEngineeringInfo
.
setConstructionComponentInfo
(
powerStationConstructionData
.
getConstructionComponentInfo
());
powerStationEngineeringInfo
.
setConstructionInverterInfo
(
powerStationConstructionData
.
getConstructionInverterInfo
());
powerStationEngineeringInfo
.
setConstructionCollectorBoxInfo
(
powerStationConstructionData
.
getConstructionCollectorBoxInfo
());
powerStationEngineeringInfo
.
setConstructionGridBoxInfo
(
powerStationConstructionData
.
getConstructionGridBoxInfo
());
powerStationEngineeringInfo
.
setProjectRegionManager
(
workOrder
.
getProjectRegionManager
());
powerStationEngineeringInfo
.
setProjectRegionManagerPhone
(
workOrder
.
getProjectRegionManagerPhone
());
powerStationEngineeringInfo
.
setConstructionRegionManager
(
workOrder
.
getConstructionRegionManager
());
powerStationEngineeringInfo
.
setConstructionRegionManagerPhone
(
workOrder
.
getConstructionRegionManagerPhone
());
}
// 并网信息
LambdaQueryWrapper
<
HygfOnGrid
>
up4
=
new
LambdaQueryWrapper
();
up4
.
eq
(
HygfOnGrid:
:
getWorkOrderId
,
workOrderId
);
up4
.
eq
(
HygfOnGrid:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
HygfOnGrid
hygfOnGrid
=
hygfOnGridMapper
.
selectOne
(
up4
);
surveyInfoAllDto
.
setHygfOnGrid
(
hygfOnGrid
!=
null
?
hygfOnGrid
:
new
HygfOnGrid
());
surveyInfoAllDto
.
setPowerStationConstructionData
(
powerStationConstructionData
!=
null
?
powerStationConstructionData
:
new
PowerStationConstructionData
());
surveyInfoAllDto
.
setPowerStationEngineeringInfo
(
powerStationEngineeringInfo
!=
null
?
powerStationEngineeringInfo
:
new
PowerStationEngineeringInfo
());
surveyInfoAllDto
.
setWorkOrder
(
workOrder
!=
null
?
workOrder
:
new
WorkOrder
());
}
else
{
surveyInfoAllDto
.
setHygfOnGrid
(
new
HygfOnGrid
());
surveyInfoAllDto
.
setPowerStationConstructionData
(
new
PowerStationConstructionData
());
surveyInfoAllDto
.
setPowerStationEngineeringInfo
(
new
PowerStationEngineeringInfo
());
surveyInfoAllDto
.
setWorkOrder
(
new
WorkOrder
());
}
if
(!
StringUtils
.
isEmpty
(
processInstanceId
))
{
try
{
Map
<
String
,
Object
>
flowLoggerMap
=
workflowFeignClient
.
getFlowLogger
(
processInstanceId
).
getResult
();
List
<
LinkedHashMap
>
flowLogger
=
(
List
<
LinkedHashMap
>)
flowLoggerMap
.
get
(
"flowLogger"
);
if
(
flowLogger
.
size
()
>
0
)
{
Collections
.
reverse
(
flowLogger
);
}
List
<
LinkedHashMap
>
flowLoggernew
=
new
ArrayList
<>();
for
(
LinkedHashMap
linkedHashMap
:
flowLogger
)
{
if
(
linkedHashMap
.
get
(
"operateDate"
)
!=
null
&&
!
linkedHashMap
.
get
(
"operateDate"
).
toString
().
isEmpty
())
{
LinkedHashMap
linke
=
new
LinkedHashMap
();
linke
.
put
(
"approvalStatue"
,
linkedHashMap
.
get
(
"approvalStatue"
).
toString
());
// 审核意见
List
<
LinkedHashMap
>
approvalSuggestion
=
(
List
<
LinkedHashMap
>)
linkedHashMap
.
get
(
"approvalSuggestion"
);
if
(
approvalSuggestion
!=
null
&&
!
approvalSuggestion
.
isEmpty
())
{
linke
.
put
(
"approvalSuggestion"
,
approvalSuggestion
.
get
(
0
).
get
(
"message"
));
}
linke
.
put
(
"taskName"
,
linkedHashMap
.
get
(
"taskName"
).
toString
());
linke
.
put
(
"operator"
,
linkedHashMap
.
get
(
"operator"
).
toString
());
linke
.
put
(
"operateDate"
,
linkedHashMap
.
get
(
"operateDate"
).
toString
());
flowLoggernew
.
add
(
linke
);
}
}
LoggerDto
loggerDto
=
new
LoggerDto
();
loggerDto
.
setLogger
(
flowLoggernew
);
surveyInfoAllDto
.
setOrderTracking
(
loggerDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
surveyInfoAllDto
;
}
public
JSONArray
getRegionName
()
{
JSONArray
jsonArray
=
new
JSONArray
();
if
(
redisUtils
.
hasKey
(
regionRedis
))
{
jsonArray
=
JSONArray
.
parseArray
(
redisUtils
.
get
(
regionRedis
).
toString
());
}
else
{
Collection
<
RegionModel
>
regionChild
=
new
ArrayList
<>();
RegionModel
regionModel1
=
new
RegionModel
();
regionChild
.
add
(
regionModel1
);
FeignClientResult
<
Collection
<
RegionModel
>>
collectionFeignClientResult
=
Systemctl
.
regionClient
.
queryForTreeParent
(
610000L
);
Collection
<
RegionModel
>
result
=
collectionFeignClientResult
.
getResult
();
for
(
RegionModel
regionModel
:
result
)
{
if
(
regionModel
.
getChildren
()
!=
null
&&
!
regionModel
.
getChildren
().
isEmpty
())
{
for
(
RegionModel
child
:
regionModel
.
getChildren
())
{
if
(
child
.
getChildren
()
!=
null
&&
!
child
.
getChildren
().
isEmpty
())
{
for
(
RegionModel
childChild
:
child
.
getChildren
())
{
jsonArray
.
add
(
childChild
);
}
child
.
setChildren
(
regionChild
);
jsonArray
.
add
(
child
);
}
}
}
regionModel
.
setChildren
(
regionChild
);
jsonArray
.
add
(
regionModel
);
}
redisUtils
.
set
(
regionRedis
,
jsonArray
);
}
return
jsonArray
;
}
}
public
SurveyInfoAllDto
querySurveyInfo
(
String
surveyInformationId
,
String
peasantHouseholdId
,
String
processInstanceId
,
AgencyUserModel
userInfo
)
{
SurveyInfoAllDto
surveyInfoAllDto
=
new
SurveyInfoAllDto
();
PeasantHousehold
peasantHousehold
=
new
PeasantHousehold
();
if
(!
StringUtils
.
isEmpty
(
peasantHouseholdId
))
{
LambdaQueryWrapper
<
PeasantHousehold
>
peasantHouseholdWrapper
=
new
LambdaQueryWrapper
<>();
peasantHouseholdWrapper
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
peasantHouseholdId
);
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
().
selectOne
(
peasantHouseholdWrapper
);
surveyInformationId
=
String
.
valueOf
(
peasantHousehold
.
getSurveyInformationId
());
}
else
{
QueryWrapper
<
PeasantHousehold
>
peasantHouseholdQueryWrapper
=
new
QueryWrapper
<>();
peasantHouseholdQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
peasantHousehold
=
peasantHouseholdServiceImpl
.
getBaseMapper
().
selectOne
(
peasantHouseholdQueryWrapper
);
}
// 勘察基本信息
LambdaQueryWrapper
<
SurveyInformation
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SurveyInformation:
:
getSequenceNbr
,
surveyInformationId
);
SurveyInformation
surveyInformation
=
this
.
baseMapper
.
selectOne
(
queryWrapper
);
surveyInfoAllDto
.
setSurveyInformation
(
BeanDtoUtils
.
convert
(
surveyInformation
,
SurveyInformationDto
.
class
));
// 农户信息
// 获取用户所在经销商单位
UserUnitInformationDto
userUnitInformationDto
=
personnelBusinessMapper
.
getUserUnitInformationDto
(
peasantHousehold
.
getDeveloperUserId
());
BeanUtils
.
copyProperties
(
peasantHousehold
,
surveyInfoAllDto
.
getSurveyInformation
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperName
(
userUnitInformationDto
.
getAmosDealerName
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperCode
(
userUnitInformationDto
.
getAmosDealerOrgCode
());
surveyInfoAllDto
.
getSurveyInformation
().
setDeveloperId
(
userUnitInformationDto
.
getAmosDealerId
());
if
(
surveyInfoAllDto
.
getSurveyInformation
().
getSalesmanId
()
==
null
)
{
surveyInfoAllDto
.
getSurveyInformation
().
setSalesmanId
(
peasantHousehold
.
getDeveloperUserId
());
surveyInfoAllDto
.
getSurveyInformation
().
setSalesman
(
peasantHousehold
.
getDeveloper
());
surveyInfoAllDto
.
getSurveyInformation
().
setCreator
(
peasantHousehold
.
getDeveloper
());
}
if
(!
StringUtils
.
isEmpty
(
peasantHousehold
.
getProjectAddressName
()))
{
surveyInfoAllDto
.
getSurveyInformation
()
.
setProjectAddressText
(
Arrays
.
asList
(
peasantHousehold
.
getProjectAddressName
().
split
(
"/"
)));
}
if
(!
StringUtils
.
isEmpty
(
peasantHousehold
.
getPermanentAddressName
()))
{
surveyInfoAllDto
.
getSurveyInformation
()
.
setPermanentAddressText
(
Arrays
.
asList
(
peasantHousehold
.
getPermanentAddressName
().
split
(
"/"
)));
}
if
(
peasantHousehold
.
getPermanentAddress
()
==
null
)
{
surveyInfoAllDto
.
getSurveyInformation
().
setPermanentAddress
(
peasantHousehold
.
getProjectAddress
());
surveyInfoAllDto
.
getSurveyInformation
().
setIsPermanent
(
"1"
);
}
surveyInfoAllDto
.
getSurveyInformation
().
setSequenceNbr
(
surveyInformation
.
getSequenceNbr
());
// 制单时间
surveyInfoAllDto
.
getSurveyInformation
().
setCreatorTime
(
surveyInformation
.
getCreatorTime
());
QueryWrapper
<
SurveyDetails
>
surveyDetailsQueryWrapper
=
new
QueryWrapper
<>();
surveyDetailsQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
SurveyDetails
surveyDetails
=
surveyDetailsService
.
getBaseMapper
().
selectOne
(
surveyDetailsQueryWrapper
);
if
(
surveyDetails
==
null
)
{
surveyInfoAllDto
.
setSurveyDetails
(
new
SurveyDetailsDto
());
}
else
{
surveyInfoAllDto
.
setSurveyDetails
(
BeanDtoUtils
.
convert
(
surveyDetails
,
SurveyDetailsDto
.
class
));
}
QueryWrapper
<
Information
>
informationQueryWrapper
=
new
QueryWrapper
<>();
informationQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
Information
information
=
informationService
.
getBaseMapper
().
selectOne
(
informationQueryWrapper
);
QueryWrapper
<
Commercial
>
commercialQueryWrapper
=
new
QueryWrapper
<>();
commercialQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
Commercial
commercial
=
commercialService
.
getBaseMapper
().
selectOne
(
commercialQueryWrapper
);
if
(
commercial
==
null
)
{
commercial
=
new
Commercial
();
}
if
(
information
==
null
)
{
surveyInfoAllDto
.
setInformation
(
new
InformationDto
());
}
else
{
information
.
setHouseProve
(
null
==
commercial
?
new
ArrayList
<>()
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getRealEstateLegal
())
?
commercial
.
getRealEstateLegal
()
:
new
ArrayList
<>()));
information
.
setCardFile
(
null
==
commercial
?
new
ArrayList
<>()
:
(
CollectionUtil
.
isNotEmpty
(
commercial
.
getIdCardCredit
())
?
commercial
.
getIdCardCredit
()
:
new
ArrayList
<>()));
surveyInfoAllDto
.
setInformation
(
BeanDtoUtils
.
convert
(
information
,
InformationDto
.
class
));
}
commercial
.
setApplicant
(
peasantHousehold
.
getOwnersName
());
commercial
.
setIdCard
(
peasantHousehold
.
getIdCard
());
commercial
.
setTelephone
(
peasantHousehold
.
getTelephone
());
commercial
.
setProjectAddress
(
peasantHousehold
.
getProjectAddress
());
commercial
.
setProjectAddressName
(
peasantHousehold
.
getProjectAddressName
());
commercial
.
setProjectAddressDetail
(
peasantHousehold
.
getProjectAddressDetail
());
commercial
.
setLegalContactTelephone
(
peasantHousehold
.
getTelephone
());
List
<
Object
>
list
=
new
ArrayList
<>();
if
(
null
!=
surveyDetails
)
{
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getSurroundingHouseSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getSurroundingHouseSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getOverallHousingSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getOverallHousingSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getPanoramaSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getPanoramaSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getPlanSketchSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getPlanSketchSurvey
());
}
if
(
CollectionUtil
.
isNotEmpty
(
surveyDetails
.
getAzimuthSurvey
()))
{
list
.
addAll
(
surveyDetails
.
getAzimuthSurvey
());
}
}
commercial
.
setSurveyPhotosWeb
(
list
);
if
(
information
==
null
)
{
CommercialDto
commercialDto
=
BeanDtoUtils
.
convert
(
commercial
,
CommercialDto
.
class
);
commercialDto
.
setType
(
"zrr"
);
commercialDto
.
setLegalType
(
"zjdnhw"
);
surveyInfoAllDto
.
setCommercial
(
commercialDto
);
}
else
{
surveyInfoAllDto
.
setCommercial
(
BeanDtoUtils
.
convert
(
commercial
,
CommercialDto
.
class
));
if
(
commercial
!=
null
&&
!
StringUtils
.
isEmpty
(
commercial
.
getProjectAddressName
()))
{
surveyInfoAllDto
.
getCommercial
()
.
setProjectAddressText
(
Arrays
.
asList
(
commercial
.
getProjectAddressName
().
split
(
"/"
)));
}
}
QueryWrapper
<
ExtendedInformation
>
extendedInformationQueryWrapper
=
new
QueryWrapper
<>();
extendedInformationQueryWrapper
.
eq
(
"survey_information_id"
,
surveyInformationId
);
ExtendedInformation
extendedInformation
=
extendedInformationService
.
getBaseMapper
()
.
selectOne
(
extendedInformationQueryWrapper
);
if
(
information
==
null
)
{
surveyInfoAllDto
.
setExtendedInformation
(
new
ExtendedInformationDto
());
}
else
{
surveyInfoAllDto
.
setExtendedInformation
(
BeanDtoUtils
.
convert
(
extendedInformation
,
ExtendedInformationDto
.
class
));
}
QueryWrapper
<
DesignInformation
>
designInformationQueryWrapper
=
new
QueryWrapper
<>();
designInformationQueryWrapper
.
eq
(
"peasant_household_id"
,
peasantHousehold
.
getSequenceNbr
());
DesignInformation
designInformation
=
designInformationService
.
getBaseMapper
()
.
selectOne
(
designInformationQueryWrapper
);
if
(
designInformation
==
null
)
{
surveyInfoAllDto
.
setDesignInformation
(
new
DesignInformationDto
());
}
else
{
surveyInfoAllDto
.
setDesignInformation
(
BeanDtoUtils
.
convert
(
designInformation
,
DesignInformationDto
.
class
));
}
LambdaQueryWrapper
<
WorkOrderPowerStation
>
up1
=
new
LambdaQueryWrapper
();
up1
.
eq
(
WorkOrderPowerStation:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
WorkOrderPowerStation
workOrderPowerStation
=
workOrderPowerStationMapper
.
selectOne
(
up1
);
if
(
workOrderPowerStation
!=
null
)
{
Long
workOrderId
=
workOrderPowerStation
.
getWorkOrderId
();
Long
workOrderPowerStationId
=
workOrderPowerStation
.
getSequenceNbr
();
// 派工单信息
LambdaQueryWrapper
<
WorkOrder
>
upl
=
new
LambdaQueryWrapper
();
upl
.
eq
(
WorkOrder:
:
getSequenceNbr
,
workOrderId
);
WorkOrder
workOrder
=
workOrderMapper
.
selectOne
(
upl
);
// 施工信息
LambdaQueryWrapper
<
PowerStationConstructionData
>
up2
=
new
LambdaQueryWrapper
();
up2
.
eq
(
PowerStationConstructionData:
:
getWorkOrderId
,
workOrderId
);
up2
.
eq
(
PowerStationConstructionData:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
PowerStationConstructionData
powerStationConstructionData
=
powerStationConstructionDataMapper
.
selectOne
(
up2
);
// 工程信息
LambdaQueryWrapper
<
PowerStationEngineeringInfo
>
up3
=
new
LambdaQueryWrapper
();
up3
.
eq
(
PowerStationEngineeringInfo:
:
getWorkOrderId
,
workOrderId
);
up3
.
eq
(
PowerStationEngineeringInfo:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
PowerStationEngineeringInfo
powerStationEngineeringInfo
=
powerStationEngineeringInfoMapper
.
selectOne
(
up3
);
if
(
powerStationConstructionData
!=
null
)
{
powerStationEngineeringInfo
=
powerStationEngineeringInfo
!=
null
?
powerStationEngineeringInfo
:
new
PowerStationEngineeringInfo
();
powerStationEngineeringInfo
.
setConstructionComponentInfo
(
powerStationConstructionData
.
getConstructionComponentInfo
());
powerStationEngineeringInfo
.
setConstructionInverterInfo
(
powerStationConstructionData
.
getConstructionInverterInfo
());
powerStationEngineeringInfo
.
setConstructionCollectorBoxInfo
(
powerStationConstructionData
.
getConstructionCollectorBoxInfo
());
powerStationEngineeringInfo
.
setConstructionGridBoxInfo
(
powerStationConstructionData
.
getConstructionGridBoxInfo
());
powerStationEngineeringInfo
.
setProjectRegionManager
(
workOrder
.
getProjectRegionManager
());
powerStationEngineeringInfo
.
setProjectRegionManagerPhone
(
workOrder
.
getProjectRegionManagerPhone
());
powerStationEngineeringInfo
.
setConstructionRegionManager
(
workOrder
.
getConstructionRegionManager
());
powerStationEngineeringInfo
.
setConstructionRegionManagerPhone
(
workOrder
.
getConstructionRegionManagerPhone
());
}
// 并网信息
LambdaQueryWrapper
<
HygfOnGrid
>
up4
=
new
LambdaQueryWrapper
();
up4
.
eq
(
HygfOnGrid:
:
getWorkOrderId
,
workOrderId
);
up4
.
eq
(
HygfOnGrid:
:
getWorkOrderPowerStationId
,
workOrderPowerStationId
);
HygfOnGrid
hygfOnGrid
=
hygfOnGridMapper
.
selectOne
(
up4
);
surveyInfoAllDto
.
setHygfOnGrid
(
hygfOnGrid
!=
null
?
hygfOnGrid
:
new
HygfOnGrid
());
surveyInfoAllDto
.
setPowerStationConstructionData
(
powerStationConstructionData
!=
null
?
powerStationConstructionData
:
new
PowerStationConstructionData
());
surveyInfoAllDto
.
setPowerStationEngineeringInfo
(
powerStationEngineeringInfo
!=
null
?
powerStationEngineeringInfo
:
new
PowerStationEngineeringInfo
());
surveyInfoAllDto
.
setWorkOrder
(
workOrder
!=
null
?
workOrder
:
new
WorkOrder
());
}
else
{
surveyInfoAllDto
.
setHygfOnGrid
(
new
HygfOnGrid
());
surveyInfoAllDto
.
setPowerStationConstructionData
(
new
PowerStationConstructionData
());
surveyInfoAllDto
.
setPowerStationEngineeringInfo
(
new
PowerStationEngineeringInfo
());
surveyInfoAllDto
.
setWorkOrder
(
new
WorkOrder
());
}
if
(!
StringUtils
.
isEmpty
(
processInstanceId
))
{
try
{
Map
<
String
,
Object
>
flowLoggerMap
=
workflowFeignClient
.
getFlowLogger
(
processInstanceId
).
getResult
();
List
<
LinkedHashMap
>
flowLogger
=
(
List
<
LinkedHashMap
>)
flowLoggerMap
.
get
(
"flowLogger"
);
if
(
flowLogger
.
size
()
>
0
)
{
Collections
.
reverse
(
flowLogger
);
}
List
<
LinkedHashMap
>
flowLoggernew
=
new
ArrayList
<>();
for
(
LinkedHashMap
linkedHashMap
:
flowLogger
)
{
if
(
linkedHashMap
.
get
(
"operateDate"
)
!=
null
&&
!
linkedHashMap
.
get
(
"operateDate"
).
toString
().
isEmpty
())
{
LinkedHashMap
linke
=
new
LinkedHashMap
();
linke
.
put
(
"approvalStatue"
,
linkedHashMap
.
get
(
"approvalStatue"
).
toString
());
// 审核意见
List
<
LinkedHashMap
>
approvalSuggestion
=
(
List
<
LinkedHashMap
>)
linkedHashMap
.
get
(
"approvalSuggestion"
);
if
(
approvalSuggestion
!=
null
&&
!
approvalSuggestion
.
isEmpty
())
{
linke
.
put
(
"approvalSuggestion"
,
approvalSuggestion
.
get
(
0
).
get
(
"message"
));
}
linke
.
put
(
"taskName"
,
linkedHashMap
.
get
(
"taskName"
).
toString
());
linke
.
put
(
"operator"
,
linkedHashMap
.
get
(
"operator"
).
toString
());
linke
.
put
(
"operateDate"
,
linkedHashMap
.
get
(
"operateDate"
).
toString
());
flowLoggernew
.
add
(
linke
);
}
}
LoggerDto
loggerDto
=
new
LoggerDto
();
loggerDto
.
setLogger
(
flowLoggernew
);
surveyInfoAllDto
.
setOrderTracking
(
loggerDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
surveyInfoAllDto
;
}
public
JSONArray
getRegionName
()
{
JSONArray
jsonArray
=
new
JSONArray
();
if
(
redisUtils
.
hasKey
(
regionRedis
))
{
jsonArray
=
JSONArray
.
parseArray
(
redisUtils
.
get
(
regionRedis
).
toString
());
}
else
{
Collection
<
RegionModel
>
regionChild
=
new
ArrayList
<>();
RegionModel
regionModel1
=
new
RegionModel
();
regionChild
.
add
(
regionModel1
);
FeignClientResult
<
Collection
<
RegionModel
>>
collectionFeignClientResult
=
Systemctl
.
regionClient
.
queryForTreeParent
(
610000L
);
Collection
<
RegionModel
>
result
=
collectionFeignClientResult
.
getResult
();
for
(
RegionModel
regionModel
:
result
)
{
if
(
regionModel
.
getChildren
()
!=
null
&&
!
regionModel
.
getChildren
().
isEmpty
())
{
for
(
RegionModel
child
:
regionModel
.
getChildren
())
{
if
(
child
.
getChildren
()
!=
null
&&
!
child
.
getChildren
().
isEmpty
())
{
for
(
RegionModel
childChild
:
child
.
getChildren
())
{
jsonArray
.
add
(
childChild
);
}
child
.
setChildren
(
regionChild
);
jsonArray
.
add
(
child
);
}
}
}
regionModel
.
setChildren
(
regionChild
);
jsonArray
.
add
(
regionModel
);
}
redisUtils
.
set
(
regionRedis
,
jsonArray
);
}
return
jsonArray
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
View file @
138a4d88
...
...
@@ -844,13 +844,26 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
updateUnitDataDto
(
UnitDataDto
unitDataDto
){
//验证二维码
UnitInfo
unitInfo
=
new
UnitInfo
();
unitInfo
=
unitInfoMapper
.
selectById
(
unitDataDto
.
getUnitInformation
().
getSequenceNbr
());
List
<
String
>
lisk
=
new
ArrayList
<>();
UnitInformation
unitInformation
=
unitDataDto
.
getUnitInformation
();
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
List
<
RegionalCompanies
>
oldList
=
regionalCompaniesMapper
.
selectList
(
qu
);
List
<
String
>
oldDisString
=
oldList
.
stream
().
map
((
regionalCompanies
)
->
regionalCompanies
.
getRegionalCompaniesSeq
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newDisString
=
dis
.
stream
().
map
((
regionalCompaniesSeq
)
->
regionalCompaniesSeq
.
toString
()).
collect
(
Collectors
.
toList
());
for
(
String
item:
oldDisString
){
if
(!
newDisString
.
contains
(
item
)){
throw
new
BadRequest
(
"所属区域公司只能增加, 不能删除"
);
}
}
List
<
String
>
lisk
=
new
ArrayList
<>();
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
List
<
Integer
>
regist
=
unitInformation
.
getRegisterPcdCodeList
();
...
...
@@ -891,7 +904,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInformation
.
setRegisterPcdCodeList
(
unitInformation
.
getRegisterPcdCodeList
());
unitInformation
.
setWorkPcdCodeList
(
unitInformation
.
getWorkPcdCodeList
());
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
List
<
String
>
disST
=
dis
.
stream
().
map
(
x
->
x
+
""
).
collect
(
Collectors
.
toList
());
BeanUtils
.
copyProperties
(
unitInformation
,
unitInfo
);
CommerceInfo
commerceInfo
=
new
CommerceInfo
();
...
...
@@ -906,20 +919,10 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInfoMapper
.
updateById
(
unitInfo
);
commerceInfoMapper
.
updateById
(
commerceInfo
);
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
List
<
RegionalCompanies
>
oldList
=
regionalCompaniesMapper
.
selectList
(
qu
);
regionalCompaniesMapper
.
delete
(
qu
);
List
<
String
>
oldDisString
=
oldList
.
stream
().
map
((
regionalCompanies
)
->
regionalCompanies
.
getRegionalCompaniesSeq
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newDisString
=
dis
.
stream
().
map
((
regionalCompaniesSeq
)
->
regionalCompaniesSeq
.
toString
()).
collect
(
Collectors
.
toList
());
for
(
String
item:
oldDisString
){
if
(!
newDisString
.
contains
(
item
)){
throw
new
BadRequest
(
"所属区域公司只能增加, 不能删除"
);
}
}
List
<
RegionalCompanies
>
regionalComp
=
new
ArrayList
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WorkOrderServiceImpl.java
View file @
138a4d88
...
...
@@ -864,7 +864,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
@Transactional
(
isolation
=
Isolation
.
REPEATABLE_READ
)
public
ConstructionRecords
addConstructionRecords
(
ConstructionRecords
constructionRecords
){
synchronized
(
constructionRecords
.
getPeasantHouseholdId
()
)
{
synchronized
(
constructionRecords
)
{
LambdaQueryWrapper
<
WorkOrderPowerStation
>
qu
=
new
LambdaQueryWrapper
();
qu
.
eq
(
WorkOrderPowerStation:
:
getSequenceNbr
,
constructionRecords
.
getWorkOrderPowerStationId
());
WorkOrderPowerStation
workOrderPowerStation
=
workOrderPowerStationMapper
.
selectOne
(
qu
);
...
...
@@ -911,7 +911,6 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
upq
.
set
(
WorkOrder:
:
getWorkOrderStatus
,
WorkOrderEnum
.
已完工
.
getCode
());
workOrderMapper
.
update
(
null
,
upq
);
}
}
else
{
//修改电站状态
workOrderPowerStation
.
setPowerStationConstructionStatus
(
WorkOrderEnum
.
未通过
.
getCode
());
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WorkflowImpl.java
View file @
138a4d88
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-dev.properties
View file @
138a4d88
...
...
@@ -229,5 +229,14 @@ dealer.appcode.role=1767363928842571777
dealer.amosDealerId
=
1767820997374775298
#Seata Config
seata.tx-service-group
=
jxiop-seata
seata.service.grouplist.jxiop-seata
=
47.92.234.253:8091
\ No newline at end of file
seata.tx-service-group
=
hygf-seata
seata.service.grouplist.hygf-seata
=
47.92.234.253:8091
# Seata 配置
seata.enabled
=
true
seata.enable-auto-data-source-proxy
=
false
#seata.client.undo.log-serialization=kryo
seata.datasource.autoproxy.datasource-proxy-mode
=
original
seata.datasource.autoproxy.enabled
=
true
seata.datasource.autoproxy.data-source-names
=
mysql
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application.properties
View file @
138a4d88
spring.application.name
=
AMOS-HYGF-C
AOTAO
spring.application.name
=
AMOS-HYGF-C
Z
server.servlet.context-path
=
/hygf
server.port
=
33330
server.uri-encoding
=
UTF-8
...
...
@@ -22,7 +22,7 @@ spring.liquibase.enabled=true
## eureka properties:
eureka.instance.prefer-ip-address
=
true
eureka.instance.ip-address
=
172.16.3.
133
eureka.instance.ip-address
=
172.16.3.
6
eureka.client.registry-fetch-interval-seconds
=
5
eureka.instance.health-check-url-path
=
/actuator/health
eureka.instance.lease-expiration-duration-in-seconds
=
10
...
...
@@ -52,11 +52,11 @@ privilege.fegin.name=AMOS-API-PRIVILEGE
feign.client.config.default.connect-timeout
=
40000
feign.client.config.default.read-timeout
=
40000
amos.system.user.user-name
=
hygf_
admin08
amos.system.user.user-name
=
hygf_
robot
amos.system.user.password
=
a1234560
amos.system.user.product
=
AMOS_STUDIO_WEB
amos.system.user.app-key
=
AMOS_STUDIO
workflow.feign.name
=
AMOS-API-WORKFLOW
workflow.feign.name
=
AMOS-API-WORKFLOW
-CZ
feign.okhttp.enabled
=
true
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/file.conf
View file @
138a4d88
...
...
@@ -30,7 +30,7 @@ transport {
}
service
{
#transaction service group mapping
vgroupMapping
.
tzs
-
seata
=
"jxiop
-seata"
vgroupMapping
.
hygf
-
seata
=
"hygf
-seata"
#only support when registry.type=file, please don't set multiple addresses
default
.
grouplist
=
"47.92.234.253:8091"
#degrade, current not support
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/logback-dev.xml
View file @
138a4d88
...
...
@@ -28,14 +28,14 @@
</encoder>
</appender>
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.Connection"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.Statement"
level=
"
DEBUG
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
DEBUG
"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"
DEBUG
"
/>
<logger
name=
"org.springframework"
level=
"
DEBUG
"
/>
<logger
name=
"org.typroject"
level=
"
DEBUG
"
/>
<logger
name=
"com.yeejoin"
level=
"
DEBUG
"
/>
<logger
name=
"com.apache.ibatis"
level=
"
INFO
"
/>
<logger
name=
"java.sql.Connection"
level=
"
INFO
"
/>
<logger
name=
"java.sql.Statement"
level=
"
INFO
"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"
INFO
"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"
INFO
"
/>
<logger
name=
"org.springframework"
level=
"
INFO
"
/>
<logger
name=
"org.typroject"
level=
"
INFO
"
/>
<logger
name=
"com.yeejoin"
level=
"
INFO
"
/>
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/PersonBasicMapper.java
View file @
138a4d88
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.baomidou.mybatisplus.
extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.
core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.EXPersonUser
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.StationBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.UserMapperDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -21,47 +19,53 @@ import java.util.Map;
public
interface
PersonBasicMapper
extends
BaseMapper
<
PersonBasic
>
{
List
<
UserMapperDto
>
queryPage
(
@Param
(
"current"
)
Long
current
,
@Param
(
"size"
)
Long
size
,
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
List
<
UserMapperDto
>
queryPage
(
@Param
(
"current"
)
Long
current
,
@Param
(
"size"
)
Long
size
,
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
UserMapperDto
>
queryPagecount
(
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
);
int
deleteList
(
String
[]
ids
);
List
<
EXPersonUser
>
getEXPersonUser
(
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
EXPersonUser
>
getEXPersonUser
(
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
);
List
<
EXPersonUser
>
getEXPersonUserAll
(
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"ids"
)
String
[]
ids
List
<
EXPersonUser
>
getEXPersonUserAll
(
@Param
(
"name"
)
String
name
,
@Param
(
"accountName"
)
String
accountName
,
@Param
(
"projectName"
)
String
projectName
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"ids"
)
String
[]
ids
);
List
<
Map
<
String
,
Object
>>
getPersonYardStatistics
(
@Param
(
"parentCode"
)
String
parentCode
);
List
<
Map
<
String
,
Object
>>
getPersonYardStatistics
(
@Param
(
"parentCode"
)
String
parentCode
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"platformStationId"
)
String
platformStationId
);
List
<
Map
<
String
,
Object
>>
getPersonYardByPage
(
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"parentCode"
)
String
parentCode
,
@Param
(
"date"
)
String
date
,
@Param
(
"qrCodeColor"
)
String
qrCodeColor
,
@Param
(
"ne"
)
String
ne
);
@Param
(
"ne"
)
String
ne
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"platformStationId"
)
String
platformStationId
);
Integer
getPersonYardByPageCount
(
@Param
(
"parentCode"
)
String
parentCode
,
@Param
(
"date"
)
String
date
,
@Param
(
"qrCodeColor"
)
String
qrCodeColor
,
@Param
(
"ne"
)
String
ne
);
@Param
(
"ne"
)
String
ne
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"platformStationId"
)
String
platformStationId
);
List
<
StationQrCodeStatistics
>
getPersonStatistics
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/PersonBasicMapper.xml
View file @
138a4d88
...
...
@@ -205,6 +205,12 @@
<if
test=
"parentCode != null and parentCode != ''"
>
AND a.project_org_code like concat(#{parentCode},'%')
</if>
<if
test=
"platformStationId != null and platformStationId != ''"
>
AND c.platform_station_id = #{platformStationId}
</if>
<if
test=
"areaCode != null and areaCode != ''"
>
AND c.area_code = #{areaCode}
</if>
</where>
GROUP BY
a.qrcode_color
...
...
@@ -240,6 +246,12 @@
<if
test=
"ne != null and ne != ''"
>
AND a.qrcode_color != #{ne}
</if>
<if
test=
"platformStationId != null and platformStationId != ''"
>
AND c.platform_station_id = #{platformStationId}
</if>
<if
test=
"areaCode != null and areaCode != ''"
>
AND c.area_code = #{areaCode}
</if>
</where>
ORDER BY sort asc,a.rec_date DESC
limit #{current},#{size}
...
...
@@ -266,6 +278,12 @@
<if
test=
"ne != null and ne != ''"
>
AND a.qrcode_color != #{ne}
</if>
<if
test=
"platformStationId != null and platformStationId != ''"
>
AND c.platform_station_id = #{platformStationId}
</if>
<if
test=
"areaCode != null and areaCode != ''"
>
AND c.area_code = #{areaCode}
</if>
</where>
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
138a4d88
...
...
@@ -1128,7 +1128,8 @@ public class MonitorFanIdxController extends BaseController {
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"运维数据 "
)
@GetMapping
(
"/operationData"
)
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
operationData
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
)
{
public
ResponseModel
<
IPage
<
Map
<
String
,
Object
>>>
operationData
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
// List<StationCacheInfoDto> list = commonServiceImpl.getListStationCacheInfoDto();
...
...
@@ -1152,13 +1153,14 @@ public class MonitorFanIdxController extends BaseController {
// result.setRecords(mapList);
// result.setCurrent(1);
// result.setTotal(mapList.size());
return
ResponseHelper
.
buildResponse
(
monitorService
.
operationData
(
areaCode
));
return
ResponseHelper
.
buildResponse
(
monitorService
.
operationData
(
areaCode
,
platformStationId
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"全国新能源接入情况 "
)
@GetMapping
(
"/getAccessSituation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAccessSituation
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
)
{
return
ResponseHelper
.
buildResponse
(
monitorService
.
getAccessSituation
(
areaCode
));
public
ResponseModel
<
Map
<
String
,
Object
>>
getAccessSituation
(
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
return
ResponseHelper
.
buildResponse
(
monitorService
.
getAccessSituation
(
areaCode
,
platformStationId
));
}
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/PersonQrCodeController.java
View file @
138a4d88
...
...
@@ -68,12 +68,14 @@ public class PersonQrCodeController extends BaseController {
@GetMapping
(
value
=
"/getPersonYardStatistics"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 人员赋码环形图查询"
,
notes
=
"评估大屏 - 人员赋码环形图查询"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getPersonYardStatistics
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
)
{
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
,
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
dataType
)
&&
dataType
.
equals
(
"person"
))
{
resultList
=
personBasicMapper
.
getPersonYardStatistics
(
parentCode
);
resultList
=
personBasicMapper
.
getPersonYardStatistics
(
parentCode
,
areaCode
,
platformStationId
);
}
else
if
(
StringUtils
.
isNotEmpty
(
dataType
)
&&
dataType
.
equals
(
"equip"
))
{
resultList
=
sjglZsjZsbtzMapper
.
getEquipYardStatistics
(
parentCode
);
}
else
if
(
StringUtils
.
isNotEmpty
(
dataType
)
&&
dataType
.
equals
(
"job"
))
{
...
...
@@ -104,11 +106,13 @@ public class PersonQrCodeController extends BaseController {
@RequestParam
(
value
=
"size"
)
Integer
size
,
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
,
@RequestParam
(
required
=
false
)
String
date
,
@RequestParam
(
required
=
false
)
String
qrCodeColor
)
{
@RequestParam
(
required
=
false
)
String
qrCodeColor
,
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
Page
<
Map
<
String
,
Object
>>
resultList
=
new
Page
<>();
if
(
"person"
.
equals
(
dataType
))
{
resultList
=
personBasicServiceImpl
.
getPersonYardByPage
(
parentCode
,
current
,
size
,
date
,
qrCodeColor
,
null
,
null
);
resultList
=
personBasicServiceImpl
.
getPersonYardByPage
(
parentCode
,
current
,
size
,
date
,
qrCodeColor
,
null
,
null
,
areaCode
,
platformStationId
);
}
else
if
(
"equip"
.
equals
(
dataType
))
{
List
<
Map
<
String
,
Object
>>
equipYardByPage
=
sjglZsjZsbtzMapper
.
getEquipYardByPage
((
current
-
1
)
*
size
,
size
,
parentCode
,
date
,
qrCodeColor
,
null
);
Integer
equipYardByPageCount
=
sjglZsjZsbtzMapper
.
getEquipYardByPageCount
(
parentCode
,
date
,
qrCodeColor
,
null
);
...
...
@@ -144,7 +148,9 @@ public class PersonQrCodeController extends BaseController {
@GetMapping
(
value
=
"/getQrCodeCount"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 人员赋码数量等统计"
,
notes
=
"评估大屏 - 人员赋码数量等统计"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getQrCodeCount
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
)
{
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
,
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
FeignClientResult
<
Map
<
String
,
Object
>>
sevenEntity
=
null
;
try
{
...
...
@@ -160,7 +166,7 @@ public class PersonQrCodeController extends BaseController {
String
yellowToGreen
=
result
.
get
(
"yellowToGreen"
).
toString
();
Integer
countAll
=
0
;
if
(
"RYFM"
.
equals
(
dataType
)
||
"person"
.
equals
(
dataType
))
{
countAll
=
personBasicMapper
.
getPersonYardByPageCount
(
parentCode
,
null
,
null
,
null
);
countAll
=
personBasicMapper
.
getPersonYardByPageCount
(
parentCode
,
null
,
null
,
null
,
areaCode
,
platformStationId
);
}
else
if
(
"equip"
.
equals
(
dataType
))
{
countAll
=
sjglZsjZsbtzMapper
.
getEquipYardByPageCount
(
parentCode
,
null
,
null
,
null
);
}
else
if
(
"job"
.
equals
(
dataType
))
{
...
...
@@ -186,7 +192,7 @@ public class PersonQrCodeController extends BaseController {
@GetMapping
(
value
=
"/getQrCodeCountByStation"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"评估大屏 - 场站 人员赋码数量等统计 【折线图】"
,
notes
=
"评估大屏 - 场站 人员赋码数量等统计 【折线图】"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getQrCodeCountByStation
(
@RequestParam
(
required
=
false
,
value
=
"parentCode"
)
String
parentCode
,
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
)
{
@RequestParam
(
required
=
false
,
value
=
"dataType"
)
String
dataType
)
{
List
<
Map
<
String
,
Object
>>
qrCodeCountByStation
=
stationQrCodeStatisticsMapper
.
getQrCodeCountByStation
(
parentCode
,
dataType
);
List
<
Object
>
redNum
=
qrCodeCountByStation
.
stream
().
map
(
t
->
t
.
get
(
"redNum"
)).
collect
(
Collectors
.
toList
());
...
...
@@ -273,10 +279,12 @@ public class PersonQrCodeController extends BaseController {
@RequestParam
(
required
=
false
,
value
=
"score"
)
BigDecimal
score
,
@RequestParam
(
value
=
"current"
)
Integer
current
,
@RequestParam
(
value
=
"size"
)
Integer
size
,
@RequestParam
(
required
=
false
,
value
=
"date"
)
String
date
)
{
@RequestParam
(
required
=
false
,
value
=
"date"
)
String
date
,
@RequestParam
(
value
=
"areaCode"
,
required
=
false
)
String
areaCode
,
@RequestParam
(
value
=
"platformStationId"
,
required
=
false
)
String
platformStationId
)
{
Page
<
Map
<
String
,
Object
>>
resultList
=
new
Page
<>();
if
(
"V1"
.
equals
(
column
))
{
resultList
=
personBasicServiceImpl
.
getPersonYardByPage
(
parentCode
,
current
,
size
,
date
,
null
,
"green"
,
score
);
resultList
=
personBasicServiceImpl
.
getPersonYardByPage
(
parentCode
,
current
,
size
,
date
,
null
,
"green"
,
score
,
areaCode
,
platformStationId
);
}
else
if
(
"S1"
.
equals
(
column
))
{
List
<
Map
<
String
,
Object
>>
equipYardByPage
=
sjglZsjZsbtzMapper
.
getEquipYardByPage
((
current
-
1
)
*
size
,
size
,
parentCode
,
date
,
null
,
"green"
);
Integer
equipYardByPageCount
=
sjglZsjZsbtzMapper
.
getEquipYardByPageCount
(
parentCode
,
date
,
null
,
"green"
);
...
...
@@ -330,8 +338,8 @@ public class PersonQrCodeController extends BaseController {
if
(
"V1"
.
equals
(
column
))
{
resultMap
=
personBasicServiceImpl
.
getPersonDetailInfoByObjectId
(
objectId
);
if
(
resultMap
.
get
(
"recDate"
).
equals
(
""
)){
resultMap
.
put
(
"recDate"
,
resultMap
.
get
(
"qrcodeDate"
));
if
(
resultMap
.
get
(
"recDate"
).
equals
(
""
))
{
resultMap
.
put
(
"recDate"
,
resultMap
.
get
(
"qrcodeDate"
));
}
}
else
if
(
"S1"
.
equals
(
column
))
{
resultMap
=
sjglZsjZsbtzMapper
.
getEquipDetailInfoByObjectId
(
objectId
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
View file @
138a4d88
...
...
@@ -9,6 +9,8 @@ public class StationCacheInfoDto implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
//场站id
private
String
stationId
;
//平台场站id
private
String
platformStationId
;
//场站名称
private
String
stationName
;
//场站类型
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/MonitorService.java
View file @
138a4d88
...
...
@@ -15,10 +15,11 @@ import java.util.Map;
public
interface
MonitorService
{
/**
* @param areaCode 区域编码
* @param platformStationId 场站id
* @return 全国运维数据
* @Description 根据区域编码动态运维数据
*/
IPage
<
Map
<
String
,
Object
>>
operationData
(
String
areaCode
);
IPage
<
Map
<
String
,
Object
>>
operationData
(
String
areaCode
,
String
platformStationId
);
/**
* @return Map<String, Object>
...
...
@@ -122,7 +123,8 @@ public interface MonitorService {
/**
* 获取接入情况
* @param areaCode
* @param platformStationId
* @return
*/
Map
<
String
,
Object
>
getAccessSituation
(
String
areaCode
);
Map
<
String
,
Object
>
getAccessSituation
(
String
areaCode
,
String
platformStationId
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
View file @
138a4d88
...
...
@@ -31,6 +31,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
java.io.IOException
;
...
...
@@ -60,11 +61,14 @@ public class MonitorServiceImpl implements MonitorService {
private
Resource
overviewGF
;
@Override
public
IPage
<
Map
<
String
,
Object
>>
operationData
(
String
areaCode
)
{
public
IPage
<
Map
<
String
,
Object
>>
operationData
(
String
areaCode
,
String
platformStationId
)
{
List
<
StationCacheInfoDto
>
list
=
getListStationCacheInfoDto
();
if
(
null
!=
areaCode
)
{
list
=
list
.
stream
().
filter
(
e
->
e
.
getAreaCode
().
toUpperCase
(
Locale
.
ROOT
).
equals
(
areaCode
.
toUpperCase
(
Locale
.
ROOT
))).
collect
(
Collectors
.
toList
());
}
if
(!
StringUtils
.
isEmpty
(
platformStationId
))
{
list
=
list
.
stream
().
filter
(
e
->
e
.
getPlatformStationId
().
toUpperCase
(
Locale
.
ROOT
).
equals
(
platformStationId
.
toUpperCase
(
Locale
.
ROOT
))).
collect
(
Collectors
.
toList
());
}
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
Map
<
String
,
List
<
StationCacheInfoDto
>>
listMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
StationCacheInfoDto:
:
getStationType
,
Collectors
.
toList
()));
for
(
StationType
value
:
StationType
.
values
())
{
...
...
@@ -156,6 +160,7 @@ public class MonitorServiceImpl implements MonitorService {
stationCacheInfoDto
.
setBoosterGatewayId
(
stationBasic
.
getBoosterGatewayId
());
stationCacheInfoDto
.
setBoosterCoreName
(
stationBasic
.
getBoosterCoreName
());
stationCacheInfoDto
.
setStationCoreName
(
stationBasic
.
getStationCoreName
());
stationCacheInfoDto
.
setPlatformStationId
(
stationBasic
.
getPlatformStationId
());
stationCacheInfoDtos
.
add
(
stationCacheInfoDto
);
}
...
...
@@ -944,8 +949,8 @@ public class MonitorServiceImpl implements MonitorService {
}
@Override
public
Map
<
String
,
Object
>
getAccessSituation
(
String
areaCode
)
{
IPage
<
Map
<
String
,
Object
>>
page
=
operationData
(
areaCode
);
public
Map
<
String
,
Object
>
getAccessSituation
(
String
areaCode
,
String
platformStationId
)
{
IPage
<
Map
<
String
,
Object
>>
page
=
operationData
(
areaCode
,
platformStationId
);
List
<
Map
<
String
,
Object
>>
records
=
page
.
getRecords
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
138a4d88
...
...
@@ -124,9 +124,11 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
String
date
,
String
qrCodeColor
,
String
ne
,
BigDecimal
score
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
personBasicMapper
.
getPersonYardByPage
((
current
-
1
)
*
size
,
size
,
parentCode
,
date
,
qrCodeColor
,
ne
);
Integer
count
=
personBasicMapper
.
getPersonYardByPageCount
(
parentCode
,
date
,
qrCodeColor
,
ne
);
BigDecimal
score
,
String
areaCode
,
String
platformStationId
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
personBasicMapper
.
getPersonYardByPage
((
current
-
1
)
*
size
,
size
,
parentCode
,
date
,
qrCodeColor
,
ne
,
areaCode
,
platformStationId
);
Integer
count
=
personBasicMapper
.
getPersonYardByPageCount
(
parentCode
,
date
,
qrCodeColor
,
ne
,
areaCode
,
platformStationId
);
resultList
.
forEach
(
item
->
{
String
name
=
QrcodeColorEnum
.
getName
(
String
.
valueOf
(
item
.
get
(
"qrCodeColor"
)));
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
138a4d88
...
...
@@ -7,14 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.feign.AmosFeignService
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.PersonBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.feign.AgencyuserFeign
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.PersonAccountFedMapper
;
...
...
@@ -36,19 +34,15 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
springfox.documentation.spring.web.json.Json
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Field
;
import
java.nio.charset.StandardCharsets
;
import
java.text.ParseException
;
import
java.util.*
;
...
...
@@ -63,330 +57,321 @@ import java.util.stream.Collectors;
@Slf4j
@Service
public
class
PersonBasicServiceImpl
extends
BaseService
<
PersonBasicDto
,
PersonBasic
,
PersonBasicMapper
>
implements
IPersonBasicService
{
@Autowired
PersonBasicMapper
personBasicMapper
;
// 人员账号信息service
@Autowired
PersonAccountServiceImpl
personAccountService
;
// 人员归属信息service
@Autowired
PersonAscriptionServiceImpl
personAscriptionService
;
// 人员资质信息service
@Autowired
PersonCertificateServiceImpl
personCertificateService
;
// 人员教育信息
@Autowired
PersonSkillEducationServiceImpl
personSkillEducationService
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Autowired
QuerueProduce
querueProduce
;
@Autowired
private
AmosFeignService
amosFeignService
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
private
AgencyuserFeign
agencyuserFeign
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
/**
* 人员赋码触发风险模型
*/
public
static
final
String
RYFM_DATA_MQTT_TOPIC
=
"ryfm/data/analysis"
;
/**
* 人员红黄码恢复为绿码
*/
public
static
final
String
RYFM_GREEN
=
"ryfm/person/green"
;
private
String
UPDATE
=
"UPDATE"
;
private
String
INSERT
=
"INSERT"
;
@Autowired
PersonAccountFedMapper
personAccountFedMapper
;
/**
* 分页查询
*/
public
Page
<
PersonBasicDto
>
queryForPersonBasicPage
(
Page
<
PersonBasicDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
PersonBasicDto
>
queryForPersonBasicList
()
{
return
this
.
queryForList
(
""
,
false
);
}
public
void
addRedisPostAndCerInfo
()
{
List
<
DictionarieValueModel
>
elevatorCategory
=
null
;
try
{
elevatorCategory
=
amosFeignService
.
listDictionaryByDictCode
(
"YGZYJNJDZS"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
String
>
collect
=
elevatorCategory
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataDesc
));
redisUtils
.
set
(
Constants
.
JXIOP_DICT_POST
,
collect
);
List
<
DictionarieValueModel
>
elevator
=
null
;
try
{
elevator
=
amosFeignService
.
listDictionaryByDictCode
(
"岗位资质鉴定证书"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
String
>
collect2
=
elevator
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataDesc
));
redisUtils
.
set
(
Constants
.
JXIOP_DICT_CERTIFICATES
,
collect2
);
}
public
RiskBizInfoVo
fetchData
(
PersonBasic
personBasic
,
PersonAccount
personAccount
,
String
content
)
{
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
personAccount
.
getProjectName
()
+
personBasic
.
getPostName
()
+
personAccount
.
getName
());
riskBizInfoVo
.
setWarningObjectCode
(
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
riskBizInfoVo
.
setSourceAttribution
(
personBasic
.
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
personAccount
.
getProjectName
());
riskBizInfoVo
.
setWarningObjectType
(
"RYFM"
);
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
detailsVos
.
add
(
dynamicDetailsVo
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
CustomizeItems
customizeItems
=
new
CustomizeItems
();
customizeItems
.
setWarningContent
(
content
);
riskBizInfoVo
.
setCustomizeItems
(
customizeItems
);
return
riskBizInfoVo
;
}
/**
* 新增
*/
@Transactional
public
void
addPerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
)
throws
Exception
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
addRedisPostAndCerInfo
();
}
// 岗位所需证书信息
Map
<
String
,
String
>
postNameMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_POST
);
// 证书临期信息
Map
<
String
,
String
>
certificatesMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_CERTIFICATES
);
// 获取人员基本信息数据
PersonUser
personUser
=
model
.
getPersonUser
();
// 获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
personUser
.
setPhone
(
personAccount
.
getPhoneNum
());
// 人员基础信息
PersonBasic
personBasic
=
new
PersonBasic
();
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
// 默认红码
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
// 该岗位应获得的证书
List
<
String
>
list2
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
personUser
.
getPostName
()))
{
String
certificates
=
postNameMap
.
get
(
personUser
.
getPostName
());
if
(!
StringUtils
.
isEmpty
(
certificates
))
{
list2
=
Arrays
.
asList
(
certificates
.
split
(
","
));
}
}
List
<
String
>
list
=
new
ArrayList
(
list2
);
// 人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
CertificationInfo
personCertificate
=
model
.
getPersonCertificate
();
// 过期的证书
List
<
String
>
overCertificateList
=
new
ArrayList
<>();
// 临期证书
List
<
String
>
inMonthCertificateList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
for
(
PersonCertificate
item
:
personCertificate
.
getCertificationInfo
())
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getValidPeriod
())
&&
!
Objects
.
isNull
(
item
.
getCertificateTime
()))
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
Date
date
=
DateUtils
.
dateAddYears
(
item
.
getCertificateTime
(),
validPeriod
);
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
overCertificateList
.
add
(
item
.
getCertificateName
());
}
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
inMonthCertificateList
.
add
(
item
.
getCertificateName
());
}
}
list
.
remove
(
item
.
getCertificateName
());
}
}
// 缺证
List
<
String
>
noCertificateList
=
new
ArrayList
<>(
list
);
List
<
String
>
strings
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
overCertificateList
))
{
strings
.
add
(
"过期证书:"
+
String
.
join
(
","
,
overCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
inMonthCertificateList
))
{
strings
.
add
(
"临期证书:"
+
String
.
join
(
","
,
inMonthCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
noCertificateList
))
{
strings
.
add
(
"缺少证书:"
+
String
.
join
(
","
,
noCertificateList
));
}
String
join
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
strings
))
{
join
=
String
.
join
(
";"
,
strings
);
}
personBasic
.
setMissingCertificate
(
join
);
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
((
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
||
(
CollectionUtils
.
isNotEmpty
(
list
)))
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
YELLOW
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书临期"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
CompanyModel
companyModel
=
new
CompanyModel
();
// 单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
if
(
personUser
.
getNativePlace
()
!=
null
)
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
this
.
baseMapper
.
insert
(
personBasic
);
if
(
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
personBasic
,
personAccount
,
join
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setTraceId
(
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
try
{
emqKeeper
.
getMqttClient
().
publish
(
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
personCertificate
.
getCertificationInfo
().
forEach
(
item
->
{
item
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
item
);
});
}
// 人员技能学历信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personSkillEducationService
.
save
(
personSkillEducation
);
// 人员账号信息
personAccount
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personAccount
.
setPassword
(
DesUtil
.
encode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
encode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
personAccountService
.
save
(
personAccount
);
// 新增平台账号
// 组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
// 应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
// 手机号
usd
.
setMobile
(
personUser
.
getPhone
());
// 角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
.
collect
(
Collectors
.
toList
());
// 测点数组
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
usd
.
setOrgRoleSeqs
(
map
);
// 密码
usd
.
setPassword
(
personAccount
.
getPassword
());
// 二次密码
usd
.
setRePassword
(
personAccount
.
getSecondaryPassword
());
// 用户名
usd
.
setRealName
(
personAccount
.
getName
());
// 账号
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setLockStatus
(
"UNLOCK"
);
// 新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
setcreateUser
(
usd
);
// 设置userID
usd
.
setUserId
(
agencyUserModel
.
getUserId
());
// 设置工号
usd
.
setUserName
(
personAccount
.
getJobNumber
());
// 创建支持工号登录
this
.
createLoginInfo
(
usd
);
// 查询部门
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
if
(
departmentModel
!=
null
)
{
// personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
implements
IPersonBasicService
{
/**
* 人员赋码触发风险模型
*/
public
static
final
String
RYFM_DATA_MQTT_TOPIC
=
"ryfm/data/analysis"
;
/**
* 人员红黄码恢复为绿码
*/
public
static
final
String
RYFM_GREEN
=
"ryfm/person/green"
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
PersonBasicMapper
personBasicMapper
;
// 人员账号信息service
@Autowired
PersonAccountServiceImpl
personAccountService
;
// 人员归属信息service
@Autowired
PersonAscriptionServiceImpl
personAscriptionService
;
// 人员资质信息service
@Autowired
PersonCertificateServiceImpl
personCertificateService
;
// 人员教育信息
@Autowired
PersonSkillEducationServiceImpl
personSkillEducationService
;
@Value
(
"${amos.secret.key}"
)
String
secretKey
;
@Autowired
QuerueProduce
querueProduce
;
@Autowired
PersonAccountFedMapper
personAccountFedMapper
;
@Autowired
private
AmosFeignService
amosFeignService
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
AgencyuserFeign
agencyuserFeign
;
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
private
String
UPDATE
=
"UPDATE"
;
private
String
INSERT
=
"INSERT"
;
/**
* 分页查询
*/
public
Page
<
PersonBasicDto
>
queryForPersonBasicPage
(
Page
<
PersonBasicDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
PersonBasicDto
>
queryForPersonBasicList
()
{
return
this
.
queryForList
(
""
,
false
);
}
public
void
addRedisPostAndCerInfo
()
{
List
<
DictionarieValueModel
>
elevatorCategory
=
null
;
try
{
elevatorCategory
=
amosFeignService
.
listDictionaryByDictCode
(
"YGZYJNJDZS"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
String
>
collect
=
elevatorCategory
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataDesc
));
redisUtils
.
set
(
Constants
.
JXIOP_DICT_POST
,
collect
);
List
<
DictionarieValueModel
>
elevator
=
null
;
try
{
elevator
=
amosFeignService
.
listDictionaryByDictCode
(
"岗位资质鉴定证书"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
String
>
collect2
=
elevator
.
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
DictionarieValueModel:
:
getDictDataDesc
));
redisUtils
.
set
(
Constants
.
JXIOP_DICT_CERTIFICATES
,
collect2
);
}
public
RiskBizInfoVo
fetchData
(
PersonBasic
personBasic
,
PersonAccount
personAccount
,
String
content
)
{
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
personAccount
.
getProjectName
()
+
personBasic
.
getPostName
()
+
personAccount
.
getName
());
riskBizInfoVo
.
setWarningObjectCode
(
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
riskBizInfoVo
.
setSourceAttribution
(
personBasic
.
getProjectOrgCode
());
riskBizInfoVo
.
setSourceAttributionDesc
(
personAccount
.
getProjectName
());
riskBizInfoVo
.
setWarningObjectType
(
"RYFM"
);
List
<
RiskDynamicDetailsVo
>
detailsVos
=
new
ArrayList
<>();
RiskDynamicDetailsVo
dynamicDetailsVo
=
new
RiskDynamicDetailsVo
();
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
detailsVos
.
add
(
dynamicDetailsVo
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
CustomizeItems
customizeItems
=
new
CustomizeItems
();
customizeItems
.
setWarningContent
(
content
);
riskBizInfoVo
.
setCustomizeItems
(
customizeItems
);
return
riskBizInfoVo
;
}
/**
* 新增
*/
@Transactional
public
void
addPerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
)
throws
Exception
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
addRedisPostAndCerInfo
();
}
// 岗位所需证书信息
Map
<
String
,
String
>
postNameMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_POST
);
// 证书临期信息
Map
<
String
,
String
>
certificatesMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_CERTIFICATES
);
// 获取人员基本信息数据
PersonUser
personUser
=
model
.
getPersonUser
();
// 获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
personUser
.
setPhone
(
personAccount
.
getPhoneNum
());
// 人员基础信息
PersonBasic
personBasic
=
new
PersonBasic
();
BeanUtils
.
copyProperties
(
personUser
,
personBasic
);
// 默认红码
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
// 该岗位应获得的证书
List
<
String
>
list2
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
personUser
.
getPostName
()))
{
String
certificates
=
postNameMap
.
get
(
personUser
.
getPostName
());
if
(!
StringUtils
.
isEmpty
(
certificates
))
{
list2
=
Arrays
.
asList
(
certificates
.
split
(
","
));
}
}
List
<
String
>
list
=
new
ArrayList
(
list2
);
// 人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
CertificationInfo
personCertificate
=
model
.
getPersonCertificate
();
// 过期的证书
List
<
String
>
overCertificateList
=
new
ArrayList
<>();
// 临期证书
List
<
String
>
inMonthCertificateList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
for
(
PersonCertificate
item
:
personCertificate
.
getCertificationInfo
())
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getValidPeriod
())
&&
!
Objects
.
isNull
(
item
.
getCertificateTime
()))
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
Date
date
=
DateUtils
.
dateAddYears
(
item
.
getCertificateTime
(),
validPeriod
);
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
overCertificateList
.
add
(
item
.
getCertificateName
());
}
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
inMonthCertificateList
.
add
(
item
.
getCertificateName
());
}
}
list
.
remove
(
item
.
getCertificateName
());
}
}
// 缺证
List
<
String
>
noCertificateList
=
new
ArrayList
<>(
list
);
List
<
String
>
strings
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
overCertificateList
))
{
strings
.
add
(
"过期证书:"
+
String
.
join
(
","
,
overCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
inMonthCertificateList
))
{
strings
.
add
(
"临期证书:"
+
String
.
join
(
","
,
inMonthCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
noCertificateList
))
{
strings
.
add
(
"缺少证书:"
+
String
.
join
(
","
,
noCertificateList
));
}
String
join
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
strings
))
{
join
=
String
.
join
(
";"
,
strings
);
}
personBasic
.
setMissingCertificate
(
join
);
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
((
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
||
(
CollectionUtils
.
isNotEmpty
(
list
)))
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
YELLOW
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书临期"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
CompanyModel
companyModel
=
new
CompanyModel
();
// 单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
if
(
personUser
.
getNativePlace
()
!=
null
)
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
this
.
baseMapper
.
insert
(
personBasic
);
if
(
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
personBasic
,
personAccount
,
join
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setTraceId
(
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
try
{
emqKeeper
.
getMqttClient
().
publish
(
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
personCertificate
.
getCertificationInfo
().
forEach
(
item
->
{
item
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
item
);
});
}
// 人员技能学历信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personSkillEducationService
.
save
(
personSkillEducation
);
// 人员账号信息
personAccount
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personAccount
.
setPassword
(
DesUtil
.
encode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
encode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
personAccountService
.
save
(
personAccount
);
// 新增平台账号
// 组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
// 应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
// 手机号
usd
.
setMobile
(
personUser
.
getPhone
());
// 角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
.
collect
(
Collectors
.
toList
());
// 测点数组
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
usd
.
setOrgRoleSeqs
(
map
);
// 密码
usd
.
setPassword
(
personAccount
.
getPassword
());
// 二次密码
usd
.
setRePassword
(
personAccount
.
getSecondaryPassword
());
// 用户名
usd
.
setRealName
(
personAccount
.
getName
());
// 账号
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setLockStatus
(
"UNLOCK"
);
// 新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
setcreateUser
(
usd
);
// 设置userID
usd
.
setUserId
(
agencyUserModel
.
getUserId
());
// 设置工号
usd
.
setUserName
(
personAccount
.
getJobNumber
());
// 创建支持工号登录
this
.
createLoginInfo
(
usd
);
// 查询部门
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
if
(
departmentModel
!=
null
)
{
// personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
// personBasic.setProjectOrgCode(companyModel.getOrgCode());
//
//
// if (personUser.getNativePlace()!=null) {
// personBasic.setNativePlace(JSON.toJSONString(personUser.getNativePlace()));
// }
personAccount
.
setPuserId
(
agencyUserModel
.
getUserId
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
personAccount
.
setPuserId
(
agencyUserModel
.
getUserId
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
// this.personBasicMapper.updateById(personBasic);
this
.
personAccountService
.
updateById
(
personAccount
);
// ----------------------------权限表中新增数据-----------------------------
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setPermissionType
(
"YTH"
);
stdUserEmpower
.
setRecDate
(
new
Date
());
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower
);
// ----------------------------户用管理端区域公司---------------------------
StdUserEmpower
stdUserEmpowerhygf
=
new
StdUserEmpower
();
List
<
CompanyModel
>
co
=
userEmpowerMapper
.
getCompanyBoList
(
"region"
,
null
,
null
);
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
this
.
personAccountService
.
updateById
(
personAccount
);
// ----------------------------权限表中新增数据-----------------------------
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setPermissionType
(
"YTH"
);
stdUserEmpower
.
setRecDate
(
new
Date
());
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower
);
// ----------------------------户用管理端区域公司---------------------------
StdUserEmpower
stdUserEmpowerhygf
=
new
StdUserEmpower
();
List
<
CompanyModel
>
co
=
userEmpowerMapper
.
getCompanyBoList
(
"region"
,
null
,
null
);
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
// if(exre!=null&&!exre.isEmpty()){
// List<String> pexre=new ArrayList<>();
// List<CompanyModel> exreco = co.stream().filter(product -> !"area".equals(product.getLevel())).collect(Collectors.toList());
...
...
@@ -397,275 +382,275 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// }
// stdUserEmpowerhygf.setEliminateAmosOrgCode(pexre);
// }
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpowerhygf
);
// ----------------------------权限表中新增数据-----------------------------
PersonAccountFed
personAccountFed
=
new
PersonAccountFed
();
BeanUtils
.
copyProperties
(
personAccount
,
personAccountFed
);
personAccountFed
.
setSyncState
(
0
);
personAccountFed
.
setSyncDate
(
new
Date
());
personAccountFedMapper
.
insert
(
personAccountFed
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"SEQUENCE_NBR"
,
agencyUserModel
.
getSequenceNbr
());
ProduceMsg
produceMsg
=
new
ProduceMsg
(
data
,
INSERT
,
agencyUserModel
.
getUserId
());
querueProduce
.
produceMsg
(
JSON
.
toJSONString
(
produceMsg
));
}
@Transactional
public
PersonDto
updatePerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
,
Long
sequenceNbr
)
throws
ParseException
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
addRedisPostAndCerInfo
();
}
// 岗位所需证书信息
Map
<
String
,
String
>
postNameMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_POST
);
// 证书临期信息
Map
<
String
,
String
>
certificatesMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_CERTIFICATES
);
// 获取人员基本信息数据
PersonUser
personUser
=
model
.
getPersonUser
();
// 获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
PersonAccount
oldpersonAccount
=
new
PersonAccount
();
personUser
.
setPhone
(
personAccount
.
getPhoneNum
());
// 人员基础信息
PersonBasic
personBasic
=
personBasicMapper
.
selectById
(
sequenceNbr
);
personBasic
.
setSequenceNbr
(
sequenceNbr
);
personAccount
.
setPassword
(
DesUtil
.
encode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
encode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
// 人员归属信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
PersonSkillEducation
personSkillEducationd
=
personSkillEducationService
.
getOne
(
new
QueryWrapper
<
PersonSkillEducation
>().
eq
(
"person_id"
,
personBasic
.
getSequenceNbr
()));
personSkillEducation
.
setSequenceNbr
(
personSkillEducationd
.
getSequenceNbr
());
personSkillEducationService
.
updateById
(
personSkillEducation
);
// 获取人员资质信息
CertificationInfo
personCertificate
=
model
.
getPersonCertificate
();
LambdaUpdateWrapper
<
PersonCertificate
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
eq
(
PersonCertificate:
:
getPersonId
,
personBasic
.
getSequenceNbr
());
personCertificateService
.
remove
(
wrapper
);
// 默认红码
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpowerhygf
);
// ----------------------------权限表中新增数据-----------------------------
PersonAccountFed
personAccountFed
=
new
PersonAccountFed
();
BeanUtils
.
copyProperties
(
personAccount
,
personAccountFed
);
personAccountFed
.
setSyncState
(
0
);
personAccountFed
.
setSyncDate
(
new
Date
());
personAccountFedMapper
.
insert
(
personAccountFed
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"SEQUENCE_NBR"
,
agencyUserModel
.
getSequenceNbr
());
ProduceMsg
produceMsg
=
new
ProduceMsg
(
data
,
INSERT
,
agencyUserModel
.
getUserId
());
querueProduce
.
produceMsg
(
JSON
.
toJSONString
(
produceMsg
));
}
@Transactional
public
PersonDto
updatePerson
(
PersonDto
model
,
HttpServletRequest
httpServletRequest
,
Long
sequenceNbr
)
throws
ParseException
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
addRedisPostAndCerInfo
();
}
// 岗位所需证书信息
Map
<
String
,
String
>
postNameMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_POST
);
// 证书临期信息
Map
<
String
,
String
>
certificatesMap
=
(
Map
<
String
,
String
>)
redisUtils
.
get
(
Constants
.
JXIOP_DICT_CERTIFICATES
);
// 获取人员基本信息数据
PersonUser
personUser
=
model
.
getPersonUser
();
// 获取人员账号信息
PersonAccount
personAccount
=
model
.
getPersonAccount
();
PersonAccount
oldpersonAccount
=
new
PersonAccount
();
personUser
.
setPhone
(
personAccount
.
getPhoneNum
());
// 人员基础信息
PersonBasic
personBasic
=
personBasicMapper
.
selectById
(
sequenceNbr
);
personBasic
.
setSequenceNbr
(
sequenceNbr
);
personAccount
.
setPassword
(
DesUtil
.
encode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
encode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
// 人员归属信息
PersonSkillEducation
personSkillEducation
=
new
PersonSkillEducation
();
BeanUtils
.
copyProperties
(
personUser
,
personSkillEducation
);
personSkillEducation
.
setPersonId
(
personBasic
.
getSequenceNbr
());
PersonSkillEducation
personSkillEducationd
=
personSkillEducationService
.
getOne
(
new
QueryWrapper
<
PersonSkillEducation
>().
eq
(
"person_id"
,
personBasic
.
getSequenceNbr
()));
personSkillEducation
.
setSequenceNbr
(
personSkillEducationd
.
getSequenceNbr
());
personSkillEducationService
.
updateById
(
personSkillEducation
);
// 获取人员资质信息
CertificationInfo
personCertificate
=
model
.
getPersonCertificate
();
LambdaUpdateWrapper
<
PersonCertificate
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
eq
(
PersonCertificate:
:
getPersonId
,
personBasic
.
getSequenceNbr
());
personCertificateService
.
remove
(
wrapper
);
// 默认红码
// personBasic.setQrcodeColor(QrcodeColorEnum.RED.getCode());
// 该岗位应获得的证书
List
<
String
>
list2
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
personUser
.
getPostName
()))
{
String
certificates
=
String
.
valueOf
(
postNameMap
.
get
(
personUser
.
getPostName
()));
if
(!
StringUtils
.
isEmpty
(
certificates
))
{
list2
=
Arrays
.
asList
(
certificates
.
split
(
","
));
}
}
List
<
String
>
list
=
new
ArrayList
(
list2
);
// 人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
// 过期的证书
List
<
String
>
overCertificateList
=
new
ArrayList
<>();
// 临期证书
List
<
String
>
inMonthCertificateList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
for
(
PersonCertificate
item
:
personCertificate
.
getCertificationInfo
())
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getValidPeriod
())
&&
!
Objects
.
isNull
(
item
.
getCertificateTime
()))
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
Date
date
=
DateUtils
.
dateAddYears
(
item
.
getCertificateTime
(),
validPeriod
);
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
overCertificateList
.
add
(
item
.
getCertificateName
());
}
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
inMonthCertificateList
.
add
(
item
.
getCertificateName
());
}
item
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
item
);
}
list
.
remove
(
item
.
getCertificateName
());
}
}
// 缺证
List
<
String
>
noCertificateList
=
new
ArrayList
<>(
list
);
List
<
String
>
strings
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
overCertificateList
))
{
strings
.
add
(
"过期证书:"
+
String
.
join
(
","
,
overCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
inMonthCertificateList
))
{
strings
.
add
(
"临期证书:"
+
String
.
join
(
","
,
inMonthCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
noCertificateList
))
{
strings
.
add
(
"缺少证书:"
+
String
.
join
(
","
,
noCertificateList
));
}
String
join
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
strings
))
{
join
=
String
.
join
(
";"
,
strings
);
}
String
missingCertificateOld
=
personBasic
.
getMissingCertificate
();
personBasic
.
setMissingCertificate
(
join
);
CompanyModel
companyModel
=
new
CompanyModel
();
// 单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
String
qrcodeColorOld
=
personBasic
.
getQrcodeColor
();
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
((
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
||
(
CollectionUtils
.
isNotEmpty
(
list
)))
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
YELLOW
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书临期"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
// 人员账号信息
personAccount
.
setPersonId
(
sequenceNbr
);
oldpersonAccount
=
personAccountService
.
getById
(
personAccount
.
getSequenceNbr
());
personAccountService
.
updateById
(
personAccount
);
// 新增平台账号
// 组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
// 应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
// 手机号
usd
.
setMobile
(
personUser
.
getPhone
());
// 角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
.
collect
(
Collectors
.
toList
());
// 测点数组
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
usd
.
setOrgRoleSeqs
(
map
);
// 密码
usd
.
setPassword
(
personAccount
.
getPassword
());
// 二次密码
usd
.
setRePassword
(
personAccount
.
getSecondaryPassword
());
// 用户名
usd
.
setRealName
(
personAccount
.
getName
());
// 账号
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setLockStatus
(
"UNLOCK"
);
usd
.
setUserId
(
personAccount
.
getPuserId
());
usd
.
setOriginalPassword
(
oldpersonAccount
.
getPassword
());
// 新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
updateuser
(
personAccount
.
getPuserId
(),
usd
);
log
.
info
(
"更新平台账户信息::"
+
JSONObject
.
toJSONString
(
usd
));
// 设置userID
usd
.
setUserId
(
agencyUserModel
.
getUserId
());
// 设置工号
usd
.
setUserName
(
personAccount
.
getJobNumber
());
// 创建支持工号登录
this
.
updateLoginInfo
(
oldpersonAccount
.
getJobNumber
(),
usd
);
// 查询部门
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
BeanUtils
.
copyProperties
(
personUser
,
personBasic
,
"qrcodeDesc"
,
"qrcodeColor"
);
if
(
departmentModel
!=
null
)
{
// personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
if
(
personUser
.
getNativePlace
()
!=
null
)
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
if
(!
join
.
equals
(
missingCertificateOld
))
{
personBasic
.
setRecDate
(
new
Date
());
this
.
personBasicMapper
.
updateById
(
personBasic
);
if
((
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
())))
{
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
personBasic
,
personAccount
,
join
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setDataSource
(
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
"证书齐全"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
HashMap
<
String
,
String
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"objectId"
,
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
personMap
.
put
(
"qrCodeColor"
,
qrcodeColorOld
);
personMap
.
put
(
"warningObjectType"
,
"RYFM"
);
personMap
.
put
(
"sourceAttribution"
,
personBasic
.
getProjectOrgCode
());
personMap
.
put
(
"sourceAttributionDesc"
,
personAccount
.
getProjectName
());
personMap
.
put
(
"warningSourceType"
,
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_GREEN
,
JSON
.
toJSONString
(
personMap
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
else
{
this
.
personBasicMapper
.
updateById
(
personBasic
);
}
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"YTH"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setRecDate
(
new
Date
());
stdUserEmpower
.
setPermissionType
(
"YTH"
);
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower
);
}
else
{
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setRecDate
(
new
Date
());
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
// 户用角色权限
StdUserEmpower
stdUserEmpowerhygf
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"HYGF"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpowerhygf
))
{
stdUserEmpowerhygf
=
new
StdUserEmpower
();
List
<
CompanyModel
>
co
=
userEmpowerMapper
.
getCompanyBoList
(
"region"
,
null
,
null
);
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
// 该岗位应获得的证书
List
<
String
>
list2
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
personUser
.
getPostName
()))
{
String
certificates
=
String
.
valueOf
(
postNameMap
.
get
(
personUser
.
getPostName
()));
if
(!
StringUtils
.
isEmpty
(
certificates
))
{
list2
=
Arrays
.
asList
(
certificates
.
split
(
","
));
}
}
List
<
String
>
list
=
new
ArrayList
(
list2
);
// 人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
// 过期的证书
List
<
String
>
overCertificateList
=
new
ArrayList
<>();
// 临期证书
List
<
String
>
inMonthCertificateList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
personCertificate
.
getCertificationInfo
()))
{
for
(
PersonCertificate
item
:
personCertificate
.
getCertificationInfo
())
{
if
(
StringUtils
.
isNotEmpty
(
item
.
getValidPeriod
())
&&
!
Objects
.
isNull
(
item
.
getCertificateTime
()))
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
Date
date
=
DateUtils
.
dateAddYears
(
item
.
getCertificateTime
(),
validPeriod
);
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
overCertificateList
.
add
(
item
.
getCertificateName
());
}
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
inMonthCertificateList
.
add
(
item
.
getCertificateName
());
}
item
.
setPersonId
(
personBasic
.
getSequenceNbr
());
personCertificateService
.
save
(
item
);
}
list
.
remove
(
item
.
getCertificateName
());
}
}
// 缺证
List
<
String
>
noCertificateList
=
new
ArrayList
<>(
list
);
List
<
String
>
strings
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
overCertificateList
))
{
strings
.
add
(
"过期证书:"
+
String
.
join
(
","
,
overCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
inMonthCertificateList
))
{
strings
.
add
(
"临期证书:"
+
String
.
join
(
","
,
inMonthCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
noCertificateList
))
{
strings
.
add
(
"缺少证书:"
+
String
.
join
(
","
,
noCertificateList
));
}
String
join
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
strings
))
{
join
=
String
.
join
(
";"
,
strings
);
}
String
missingCertificateOld
=
personBasic
.
getMissingCertificate
();
personBasic
.
setMissingCertificate
(
join
);
CompanyModel
companyModel
=
new
CompanyModel
();
// 单位
companyModel
=
this
.
getCompanyModel
(
personAccount
.
getProjectId
());
String
qrcodeColorOld
=
personBasic
.
getQrcodeColor
();
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
((
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
||
(
CollectionUtils
.
isNotEmpty
(
list
)))
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
YELLOW
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书临期"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
// 人员账号信息
personAccount
.
setPersonId
(
sequenceNbr
);
oldpersonAccount
=
personAccountService
.
getById
(
personAccount
.
getSequenceNbr
());
personAccountService
.
updateById
(
personAccount
);
// 新增平台账号
// 组装数据
AgencyUserModel
usd
=
new
AgencyUserModel
();
// 应用
usd
.
setAppCodes
(
personAccount
.
getApplication
());
// 手机号
usd
.
setMobile
(
personUser
.
getPhone
());
// 角色
Map
<
Long
,
List
<
Long
>>
map
=
new
HashMap
<>();
List
<
Long
>
cdids
=
personAccount
.
getRoles
().
stream
().
map
(
s
->
Long
.
parseLong
(
s
.
trim
()))
.
collect
(
Collectors
.
toList
());
// 测点数组
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
map
.
put
(
personAccount
.
getDepartmentId
(),
cdids
);
}
else
{
map
.
put
(
personAccount
.
getProjectId
(),
cdids
);
}
usd
.
setOrgRoleSeqs
(
map
);
// 密码
usd
.
setPassword
(
personAccount
.
getPassword
());
// 二次密码
usd
.
setRePassword
(
personAccount
.
getSecondaryPassword
());
// 用户名
usd
.
setRealName
(
personAccount
.
getName
());
// 账号
usd
.
setUserName
(
personAccount
.
getAccountName
());
usd
.
setLockStatus
(
"UNLOCK"
);
usd
.
setUserId
(
personAccount
.
getPuserId
());
usd
.
setOriginalPassword
(
oldpersonAccount
.
getPassword
());
// 新增平台用户
AgencyUserModel
agencyUserModel
=
this
.
updateuser
(
personAccount
.
getPuserId
(),
usd
);
log
.
info
(
"更新平台账户信息::"
+
JSONObject
.
toJSONString
(
usd
));
// 设置userID
usd
.
setUserId
(
agencyUserModel
.
getUserId
());
// 设置工号
usd
.
setUserName
(
personAccount
.
getJobNumber
());
// 创建支持工号登录
this
.
updateLoginInfo
(
oldpersonAccount
.
getJobNumber
(),
usd
);
// 查询部门
DepartmentModel
departmentModel
=
null
;
if
(
personAccount
.
getDepartmentId
()
!=
null
)
{
departmentModel
=
this
.
getdepartmentModel
(
personAccount
.
getDepartmentId
());
}
BeanUtils
.
copyProperties
(
personUser
,
personBasic
,
"qrcodeDesc"
,
"qrcodeColor"
);
if
(
departmentModel
!=
null
)
{
// personBasic.setProjectOrgCode(departmentModel.getOrgCode());
personAccount
.
setProjectDepartmentName
(
departmentModel
.
getDepartmentName
());
}
personBasic
.
setProjectOrgCode
(
companyModel
.
getOrgCode
());
if
(
personUser
.
getNativePlace
()
!=
null
)
{
personBasic
.
setNativePlace
(
JSON
.
toJSONString
(
personUser
.
getNativePlace
()));
}
personAccount
.
setProjectName
(
companyModel
.
getCompanyName
());
if
(!
join
.
equals
(
missingCertificateOld
))
{
personBasic
.
setRecDate
(
new
Date
());
this
.
personBasicMapper
.
updateById
(
personBasic
);
if
((
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
())))
{
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
fetchData
(
personBasic
,
personAccount
,
join
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setDataSource
(
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
else
if
(
"证书齐全"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
HashMap
<
String
,
String
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"objectId"
,
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
personMap
.
put
(
"qrCodeColor"
,
qrcodeColorOld
);
personMap
.
put
(
"warningObjectType"
,
"RYFM"
);
personMap
.
put
(
"sourceAttribution"
,
personBasic
.
getProjectOrgCode
());
personMap
.
put
(
"sourceAttributionDesc"
,
personAccount
.
getProjectName
());
personMap
.
put
(
"warningSourceType"
,
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_GREEN
,
JSON
.
toJSONString
(
personMap
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
else
{
this
.
personBasicMapper
.
updateById
(
personBasic
);
}
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"YTH"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setRecDate
(
new
Date
());
stdUserEmpower
.
setPermissionType
(
"YTH"
);
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpower
);
}
else
{
stdUserEmpower
.
setAmosOrgCode
(
Arrays
.
asList
(
personAccount
.
getYthPermission
()));
stdUserEmpower
.
setRecDate
(
new
Date
());
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
// 户用角色权限
StdUserEmpower
stdUserEmpowerhygf
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"HYGF"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpowerhygf
))
{
stdUserEmpowerhygf
=
new
StdUserEmpower
();
List
<
CompanyModel
>
co
=
userEmpowerMapper
.
getCompanyBoList
(
"region"
,
null
,
null
);
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
// if(exre!=null&&!exre.isEmpty()){
// List<String> pexre=new ArrayList<>();
// List<CompanyModel> exreco = co.stream().filter(product -> !"area".equals(product.getLevel())).collect(Collectors.toList());
...
...
@@ -676,27 +661,27 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// }
// stdUserEmpowerhygf.setEliminateAmosOrgCode(pexre);
// }
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpowerhygf
);
}
else
{
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
insert
(
stdUserEmpowerhygf
);
}
else
{
// List<CompanyModel> co= userEmpowerMapper.getCompanyBoList("region",null,null);
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
List
<
String
>
re
=
personAccount
.
getRegionalCompaniesSeq
();
String
flag
=
personAccount
.
getRegionalCompaniesSeqFlag
();
if
(
flag
!=
null
&&
!
flag
.
isEmpty
())
{
if
(
flag
.
equals
(
"all"
))
{
List
<
String
>
all
=
new
ArrayList
<>();
all
.
add
(
"all"
);
stdUserEmpowerhygf
.
setAmosOrgCode
(
all
);
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
}
else
{
stdUserEmpowerhygf
.
setAmosOrgCode
(
re
);
}
List
<
String
>
exre
=
personAccount
.
getExternalRegionalCompaniesSeq
();
// if(exre!=null&&!exre.isEmpty()){
// List<String> pexre=new ArrayList<>();
// List<CompanyModel> exreco = co.stream().filter(product -> !"area".equals(product.getLevel())).collect(Collectors.toList());
...
...
@@ -707,268 +692,268 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// }
// stdUserEmpowerhygf.setEliminateAmosOrgCode(pexre);
// }
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
updateById
(
stdUserEmpowerhygf
);
}
personAccountService
.
updateById
(
personAccount
);
PersonAccountFed
personAccountFed
=
new
PersonAccountFed
();
BeanUtils
.
copyProperties
(
personAccount
,
personAccountFed
);
personAccountFed
.
setSyncState
(
1
);
personAccountFed
.
setSyncDate
(
new
Date
());
personAccountFedMapper
.
updateById
(
personAccountFed
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"SEQUENCE_NBR"
,
agencyUserModel
.
getSequenceNbr
());
ProduceMsg
produceMsg
=
new
ProduceMsg
(
data
,
UPDATE
,
agencyUserModel
.
getUserId
());
querueProduce
.
produceMsg
(
JSON
.
toJSONString
(
produceMsg
));
return
model
;
}
@Transactional
public
PersonDto
getPerson
(
Long
sequenceNbr
,
String
type
)
{
PersonDto
personDto
=
new
PersonDto
();
PersonUser
personUser
=
new
PersonUser
();
QueryWrapper
<
PersonBasic
>
wrapper1
=
new
QueryWrapper
();
wrapper1
.
eq
(
"sequence_nbr"
,
sequenceNbr
);
wrapper1
.
eq
(
"is_delete"
,
0
);
// 人员基础信息
PersonBasic
personBasic
=
this
.
getOne
(
wrapper1
);
BeanUtils
.
copyProperties
(
personBasic
,
personUser
);
// 人员技能学历信息
QueryWrapper
<
PersonSkillEducation
>
wrapper2
=
new
QueryWrapper
();
wrapper2
.
eq
(
"person_id"
,
sequenceNbr
);
PersonSkillEducation
personSkillEducation
=
personSkillEducationService
.
getOne
(
wrapper2
);
BeanUtils
.
copyProperties
(
personSkillEducation
,
personUser
);
// 人员资质信息
LambdaQueryWrapper
<
PersonCertificate
>
personCertificateLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
personCertificateLambdaQueryWrapper
.
eq
(
PersonCertificate:
:
getPersonId
,
sequenceNbr
);
List
<
PersonCertificate
>
list
=
personCertificateService
.
list
(
personCertificateLambdaQueryWrapper
);
CertificationInfo
certificationInfo
=
new
CertificationInfo
();
certificationInfo
.
setCertificationInfo
(
list
);
QueryWrapper
<
PersonAccount
>
wrapper4
=
new
QueryWrapper
();
wrapper4
.
eq
(
"person_id"
,
sequenceNbr
);
// 人员账号信息
PersonAccount
personAccount
=
personAccountService
.
getOne
(
wrapper4
);
personAccount
.
setPhoneNum
(
personBasic
.
getPhone
());
// 对于密码进行解密
if
(
"look"
.
equals
(
type
))
{
personAccount
.
setIdNumber
(
DesensitizedUtil
.
idCardNum
(
personAccount
.
getIdNumber
(),
0
,
4
));
}
else
{
personAccount
.
setPassword
(
DesUtil
.
decode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
decode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
}
if
(
personBasic
.
getNativePlace
()
!=
null
)
{
personUser
.
setNativePlace
(
JSON
.
parseArray
(
personBasic
.
getNativePlace
(),
Integer
.
class
));
}
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"YTH"
));
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
personAccount
.
setYthPermission
(
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
));
}
StdUserEmpower
stdUserEmpowerhygf
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"HYGF"
));
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpowerhygf
))
{
if
(
stdUserEmpowerhygf
.
getAmosOrgCode
()
==
null
||
stdUserEmpowerhygf
.
getAmosOrgCode
().
size
()
==
0
)
{
stdUserEmpowerhygf
.
setEliminateAmosOrgCode
(
exre
);
stdUserEmpowerhygf
.
setPermissionType
(
"HYGF"
);
stdUserEmpowerhygf
.
setRecDate
(
new
Date
());
stdUserEmpowerhygf
.
setAmosUserId
(
personAccount
.
getPuserId
());
userEmpowerMapper
.
updateById
(
stdUserEmpowerhygf
);
}
personAccountService
.
updateById
(
personAccount
);
PersonAccountFed
personAccountFed
=
new
PersonAccountFed
();
BeanUtils
.
copyProperties
(
personAccount
,
personAccountFed
);
personAccountFed
.
setSyncState
(
1
);
personAccountFed
.
setSyncDate
(
new
Date
());
personAccountFedMapper
.
updateById
(
personAccountFed
);
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"SEQUENCE_NBR"
,
agencyUserModel
.
getSequenceNbr
());
ProduceMsg
produceMsg
=
new
ProduceMsg
(
data
,
UPDATE
,
agencyUserModel
.
getUserId
());
querueProduce
.
produceMsg
(
JSON
.
toJSONString
(
produceMsg
));
return
model
;
}
@Transactional
public
PersonDto
getPerson
(
Long
sequenceNbr
,
String
type
)
{
PersonDto
personDto
=
new
PersonDto
();
PersonUser
personUser
=
new
PersonUser
();
QueryWrapper
<
PersonBasic
>
wrapper1
=
new
QueryWrapper
();
wrapper1
.
eq
(
"sequence_nbr"
,
sequenceNbr
);
wrapper1
.
eq
(
"is_delete"
,
0
);
// 人员基础信息
PersonBasic
personBasic
=
this
.
getOne
(
wrapper1
);
BeanUtils
.
copyProperties
(
personBasic
,
personUser
);
// 人员技能学历信息
QueryWrapper
<
PersonSkillEducation
>
wrapper2
=
new
QueryWrapper
();
wrapper2
.
eq
(
"person_id"
,
sequenceNbr
);
PersonSkillEducation
personSkillEducation
=
personSkillEducationService
.
getOne
(
wrapper2
);
BeanUtils
.
copyProperties
(
personSkillEducation
,
personUser
);
// 人员资质信息
LambdaQueryWrapper
<
PersonCertificate
>
personCertificateLambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
personCertificateLambdaQueryWrapper
.
eq
(
PersonCertificate:
:
getPersonId
,
sequenceNbr
);
List
<
PersonCertificate
>
list
=
personCertificateService
.
list
(
personCertificateLambdaQueryWrapper
);
CertificationInfo
certificationInfo
=
new
CertificationInfo
();
certificationInfo
.
setCertificationInfo
(
list
);
QueryWrapper
<
PersonAccount
>
wrapper4
=
new
QueryWrapper
();
wrapper4
.
eq
(
"person_id"
,
sequenceNbr
);
// 人员账号信息
PersonAccount
personAccount
=
personAccountService
.
getOne
(
wrapper4
);
personAccount
.
setPhoneNum
(
personBasic
.
getPhone
());
// 对于密码进行解密
if
(
"look"
.
equals
(
type
))
{
personAccount
.
setIdNumber
(
DesensitizedUtil
.
idCardNum
(
personAccount
.
getIdNumber
(),
0
,
4
));
}
else
{
personAccount
.
setPassword
(
DesUtil
.
decode
(
personAccount
.
getPassword
(),
secretKey
));
personAccount
.
setSecondaryPassword
(
DesUtil
.
decode
(
personAccount
.
getSecondaryPassword
(),
secretKey
));
}
if
(
personBasic
.
getNativePlace
()
!=
null
)
{
personUser
.
setNativePlace
(
JSON
.
parseArray
(
personBasic
.
getNativePlace
(),
Integer
.
class
));
}
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"YTH"
));
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
personAccount
.
setYthPermission
(
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
));
}
StdUserEmpower
stdUserEmpowerhygf
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>()
.
eq
(
"amos_user_id"
,
personAccount
.
getPuserId
()).
eq
(
"permission_type"
,
"HYGF"
));
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpowerhygf
))
{
if
(
stdUserEmpowerhygf
.
getAmosOrgCode
()
==
null
||
stdUserEmpowerhygf
.
getAmosOrgCode
().
size
()
==
0
)
{
// List<String> list2 = new ArrayList<>();
// list2.add("all");
personAccount
.
setRegionalCompaniesSeq
(
null
);
personAccount
.
setRegionalCompaniesSeq
(
null
);
}
else
if
(
stdUserEmpowerhygf
.
getAmosOrgCode
().
size
()
==
1
&&
stdUserEmpowerhygf
.
getAmosOrgCode
().
get
(
0
).
equals
(
"all"
))
{
}
else
if
(
stdUserEmpowerhygf
.
getAmosOrgCode
().
size
()
==
1
&&
stdUserEmpowerhygf
.
getAmosOrgCode
().
get
(
0
).
equals
(
"all"
))
{
personAccount
.
setRegionalCompaniesSeqFlag
(
"all"
);
personAccount
.
setRegionalCompaniesSeq
(
null
);
personAccount
.
setRegionalCompaniesSeqFlag
(
"all"
);
personAccount
.
setRegionalCompaniesSeq
(
null
);
}
else
{
}
else
{
personAccount
.
setRegionalCompaniesSeqFlag
(
"no"
);
personAccount
.
setRegionalCompaniesSeq
(
stdUserEmpowerhygf
.
getAmosOrgCode
());
personAccount
.
setRegionalCompaniesSeqFlag
(
"no"
);
personAccount
.
setRegionalCompaniesSeq
(
stdUserEmpowerhygf
.
getAmosOrgCode
());
}
personAccount
.
setExternalRegionalCompaniesSeq
(
stdUserEmpowerhygf
.
getEliminateAmosOrgCode
());
}
personAccount
.
setExternalRegionalCompaniesSeq
(
stdUserEmpowerhygf
.
getEliminateAmosOrgCode
());
}
personDto
.
setPersonUser
(
personUser
);
personDto
.
setPersonCertificate
(
certificationInfo
);
personDto
.
setPersonAccount
(
personAccount
);
return
personDto
;
}
}
personDto
.
setPersonUser
(
personUser
);
personDto
.
setPersonCertificate
(
certificationInfo
);
personDto
.
setPersonAccount
(
personAccount
);
return
personDto
;
}
@Transactional
public
int
deletePerson
(
String
[]
ids
)
{
@Transactional
public
int
deletePerson
(
String
[]
ids
)
{
// 查询所有平台用户
QueryWrapper
<
PersonAccount
>
wrapper
=
new
QueryWrapper
();
wrapper
.
in
(
"person_id"
,
ids
);
List
<
PersonAccount
>
list
=
personAccountService
.
list
(
wrapper
);
List
<
String
>
userid
=
new
ArrayList
<>();
// 查询所有平台用户
QueryWrapper
<
PersonAccount
>
wrapper
=
new
QueryWrapper
();
wrapper
.
in
(
"person_id"
,
ids
);
List
<
PersonAccount
>
list
=
personAccountService
.
list
(
wrapper
);
List
<
String
>
userid
=
new
ArrayList
<>();
// List<String> loginId = new ArrayList<>();
for
(
PersonAccount
personAccount
:
list
)
{
userid
.
add
(
personAccount
.
getPuserId
());
for
(
PersonAccount
personAccount
:
list
)
{
userid
.
add
(
personAccount
.
getPuserId
());
// loginId.add(personAccount.getJobNumber());
}
// 删除平台
int
deleteResult
=
personBasicMapper
.
deleteList
(
ids
);
this
.
deleuser
(
String
.
join
(
","
,
userid
));
}
// 删除平台
int
deleteResult
=
personBasicMapper
.
deleteList
(
ids
);
this
.
deleuser
(
String
.
join
(
","
,
userid
));
//// this.deleteLoginInfo(String.join(",", loginId));
// this.deleteLoginInfo(loginId.get(1));
QueryWrapper
<
PersonAccountFed
>
wrapper1
=
new
QueryWrapper
();
wrapper1
.
in
(
"person_id"
,
ids
);
personAccountFedMapper
.
delete
(
wrapper1
);
userEmpowerMapper
.
delete
(
new
QueryWrapper
<
StdUserEmpower
>().
in
(
"amos_user_id"
,
userid
).
eq
(
"permission_type"
,
"YTH"
));
return
deleteResult
;
}
// 新增平台用户
private
AgencyUserModel
setcreateUser
(
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
create
(
userDto
);
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
return
user
;
}
private
LoginInfoModel
createLoginInfo
(
AgencyUserModel
userDto
)
{
FeignClientResult
<
LoginInfoModel
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
createLoginInfo
(
userDto
);
}
catch
(
Exception
e
)
{
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userDto
.
getUserId
(),
true
);
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
// 修改平台用户
private
AgencyUserModel
updateuser
(
String
userId
,
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
null
;
FeignClientResult
<
AgencyUserModel
>
amosUser1
=
null
;
try
{
amosUser
=
Privilege
.
agencyUserClient
.
update
(
userDto
,
userId
);
amosUser1
=
Privilege
.
agencyUserClient
.
modifyPassword
(
userId
,
userDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
amosUser1
))
{
if
(
amosUser1
.
getStatus
()
==
200
)
{
user
=
amosUser1
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser1
.
getMessage
());
}
}
return
user
;
}
private
LoginInfoModel
updateLoginInfo
(
String
loginId
,
AgencyUserModel
userDto
)
{
FeignClientResult
<
LoginInfoModel
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
updateLoginInfo
(
userDto
,
loginId
);
// amosLoginfo = agencyuserFeign.updateLoginInfo(userDto, loginId);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
private
DepartmentModel
getdepartmentModel
(
Long
departmentId
)
{
FeignClientResult
<
DepartmentModel
>
de
=
Privilege
.
departmentClient
.
seleteOne
(
departmentId
);
DepartmentModel
departmentModel
=
new
DepartmentModel
();
if
(!
ObjectUtils
.
isEmpty
(
de
))
{
if
(
de
.
getStatus
()
==
200
)
{
departmentModel
=
de
.
getResult
();
}
else
{
throw
new
RuntimeException
(
de
.
getMessage
());
}
}
return
departmentModel
;
}
public
CompanyModel
getCompanyModel
(
Long
projectId
)
{
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
projectId
);
CompanyModel
companyModel
=
new
CompanyModel
();
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()
==
200
)
{
companyModel
=
cResult
.
getResult
();
}
else
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
return
companyModel
;
}
private
void
deleuser
(
String
userid
)
{
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userid
,
true
);
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()
!=
200
)
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
}
private
String
deleteLoginInfo
(
String
loginId
)
{
FeignClientResult
<
String
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
deleteLoginInfo
(
loginId
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
/**
* 分页查询
*/
public
Page
<
UserMapperDto
>
queryPage
(
Page
<
UserMapperDto
>
page
,
String
name
,
String
accountName
,
String
projectName
,
String
orgCode
)
{
List
<
UserMapperDto
>
list
=
personBasicMapper
.
queryPage
((
page
.
getCurrent
()
-
1
)
*
page
.
getSize
(),
page
.
getSize
(),
name
,
accountName
,
projectName
,
orgCode
);
List
<
UserMapperDto
>
listcount
=
personBasicMapper
.
queryPagecount
(
name
,
accountName
,
projectName
,
orgCode
);
page
.
setTotal
(
listcount
.
size
());
page
.
setRecords
(
list
);
return
page
;
}
public
List
<
Map
<
String
,
Object
>>
getPersonYardStatistics
(
String
parentCode
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
personBasicMapper
.
getPersonYardStatistics
(
parentCode
);
resultList
.
forEach
(
item
->
{
String
name
=
QrcodeColorEnum
.
getName
(
String
.
valueOf
(
item
.
get
(
"qrCodeColor"
)));
item
.
put
(
"name"
,
name
);
item
.
put
(
"value"
,
Integer
.
parseInt
(
item
.
get
(
"value"
).
toString
()));
});
return
resultList
;
}
QueryWrapper
<
PersonAccountFed
>
wrapper1
=
new
QueryWrapper
();
wrapper1
.
in
(
"person_id"
,
ids
);
personAccountFedMapper
.
delete
(
wrapper1
);
userEmpowerMapper
.
delete
(
new
QueryWrapper
<
StdUserEmpower
>().
in
(
"amos_user_id"
,
userid
).
eq
(
"permission_type"
,
"YTH"
));
return
deleteResult
;
}
// 新增平台用户
private
AgencyUserModel
setcreateUser
(
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
Privilege
.
agencyUserClient
.
create
(
userDto
);
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
return
user
;
}
private
LoginInfoModel
createLoginInfo
(
AgencyUserModel
userDto
)
{
FeignClientResult
<
LoginInfoModel
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
createLoginInfo
(
userDto
);
}
catch
(
Exception
e
)
{
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userDto
.
getUserId
(),
true
);
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
// 修改平台用户
private
AgencyUserModel
updateuser
(
String
userId
,
AgencyUserModel
userDto
)
{
FeignClientResult
<
AgencyUserModel
>
amosUser
=
null
;
FeignClientResult
<
AgencyUserModel
>
amosUser1
=
null
;
try
{
amosUser
=
Privilege
.
agencyUserClient
.
update
(
userDto
,
userId
);
amosUser1
=
Privilege
.
agencyUserClient
.
modifyPassword
(
userId
,
userDto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
AgencyUserModel
user
=
new
AgencyUserModel
();
if
(!
ObjectUtils
.
isEmpty
(
amosUser
))
{
if
(
amosUser
.
getStatus
()
==
200
)
{
user
=
amosUser
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser
.
getMessage
());
}
}
if
(!
ObjectUtils
.
isEmpty
(
amosUser1
))
{
if
(
amosUser1
.
getStatus
()
==
200
)
{
user
=
amosUser1
.
getResult
();
}
else
{
throw
new
RuntimeException
(
amosUser1
.
getMessage
());
}
}
return
user
;
}
private
LoginInfoModel
updateLoginInfo
(
String
loginId
,
AgencyUserModel
userDto
)
{
FeignClientResult
<
LoginInfoModel
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
updateLoginInfo
(
userDto
,
loginId
);
// amosLoginfo = agencyuserFeign.updateLoginInfo(userDto, loginId);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
private
DepartmentModel
getdepartmentModel
(
Long
departmentId
)
{
FeignClientResult
<
DepartmentModel
>
de
=
Privilege
.
departmentClient
.
seleteOne
(
departmentId
);
DepartmentModel
departmentModel
=
new
DepartmentModel
();
if
(!
ObjectUtils
.
isEmpty
(
de
))
{
if
(
de
.
getStatus
()
==
200
)
{
departmentModel
=
de
.
getResult
();
}
else
{
throw
new
RuntimeException
(
de
.
getMessage
());
}
}
return
departmentModel
;
}
public
CompanyModel
getCompanyModel
(
Long
projectId
)
{
FeignClientResult
<
CompanyModel
>
cResult
=
Privilege
.
companyClient
.
seleteOne
(
projectId
);
CompanyModel
companyModel
=
new
CompanyModel
();
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()
==
200
)
{
companyModel
=
cResult
.
getResult
();
}
else
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
return
companyModel
;
}
private
void
deleuser
(
String
userid
)
{
FeignClientResult
<
List
<
String
>>
cResult
=
Privilege
.
agencyUserClient
.
multDeleteUser
(
userid
,
true
);
if
(!
ObjectUtils
.
isEmpty
(
cResult
))
{
if
(
cResult
.
getStatus
()
!=
200
)
{
throw
new
RuntimeException
(
cResult
.
getMessage
());
}
}
}
private
String
deleteLoginInfo
(
String
loginId
)
{
FeignClientResult
<
String
>
amosLoginfo
=
null
;
try
{
amosLoginfo
=
Privilege
.
agencyUserClient
.
deleteLoginInfo
(
loginId
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
return
amosLoginfo
.
getResult
();
}
/**
* 分页查询
*/
public
Page
<
UserMapperDto
>
queryPage
(
Page
<
UserMapperDto
>
page
,
String
name
,
String
accountName
,
String
projectName
,
String
orgCode
)
{
List
<
UserMapperDto
>
list
=
personBasicMapper
.
queryPage
((
page
.
getCurrent
()
-
1
)
*
page
.
getSize
(),
page
.
getSize
(),
name
,
accountName
,
projectName
,
orgCode
);
List
<
UserMapperDto
>
listcount
=
personBasicMapper
.
queryPagecount
(
name
,
accountName
,
projectName
,
orgCode
);
page
.
setTotal
(
listcount
.
size
());
page
.
setRecords
(
list
);
return
page
;
}
public
List
<
Map
<
String
,
Object
>>
getPersonYardStatistics
(
String
parentCode
,
String
areaCode
,
String
platformStationId
)
{
List
<
Map
<
String
,
Object
>>
resultList
=
personBasicMapper
.
getPersonYardStatistics
(
parentCode
,
areaCode
,
platformStationId
);
resultList
.
forEach
(
item
->
{
String
name
=
QrcodeColorEnum
.
getName
(
String
.
valueOf
(
item
.
get
(
"qrCodeColor"
)));
item
.
put
(
"name"
,
name
);
item
.
put
(
"value"
,
Integer
.
parseInt
(
item
.
get
(
"value"
).
toString
()));
});
return
resultList
;
}
// public Page<Map<String, Object>> getPersonYardByPage(String parentCode,
// Integer current,
...
...
pom.xml
View file @
138a4d88
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-biz-boot
</artifactId>
<version>
1.0.0
</version>
<packaging>
pom
</packaging>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-biz-boot
</artifactId>
<version>
1.0.0
</version>
<packaging>
pom
</packaging>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.3.11.RELEASE
</version>
<relativePath
/>
</parent>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.3.11.RELEASE
</version>
<relativePath
/>
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<amos-biz-boot.version>
1.0.0
</amos-biz-boot.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<fastjson.version>
1.2.83
</fastjson.version>
<knife4j-spring-boot-starter.version>
2.0.7
</knife4j-spring-boot-starter.version>
<springboot.version>
2.3.11.RELEASE
</springboot.version>
<springcloud.version>
Hoxton.SR8
</springcloud.version>
<maven-jar-plugin.version>
3.1.1
</maven-jar-plugin.version>
<tyboot-version>
1.1.25-SNAPSHOT
</tyboot-version>
<amos.version>
1.7.10-SNAPSHOT
</amos.version>
<itext.version>
7.1.1
</itext.version>
<elasticsearch.version>
7.15.2
</elasticsearch.version>
</properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<amos-biz-boot.version>
1.0.0
</amos-biz-boot.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
<fastjson.version>
1.2.83
</fastjson.version>
<knife4j-spring-boot-starter.version>
2.0.7
</knife4j-spring-boot-starter.version>
<springboot.version>
2.3.11.RELEASE
</springboot.version>
<springcloud.version>
Hoxton.SR8
</springcloud.version>
<maven-jar-plugin.version>
3.1.1
</maven-jar-plugin.version>
<tyboot-version>
1.1.25-SNAPSHOT
</tyboot-version>
<!-- <amos.version>1.7.10-SNAPSHOT</amos.version>-->
<amos.version>
1.10.8
</amos.version>
<itext.version>
7.1.1
</itext.version>
<elasticsearch.version>
7.15.2
</elasticsearch.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.netflix.hystrix
</groupId>
<artifactId>
hystrix-javanica
</artifactId>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
jsr305
</artifactId>
<groupId>
com.google.code.findbugs
</groupId>
</exclusion>
<exclusion>
<artifactId>
annotations
</artifactId>
<groupId>
com.google.code.findbugs
</groupId>
</exclusion>
<exclusion>
<artifactId>
aspectjrt
</artifactId>
<groupId>
org.aspectj
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel
</artifactId>
<version>
2.0.5
</version>
<exclusions>
<exclusion>
<groupId>
org.ow2.asm
</groupId>
<artifactId>
asm
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-compress
</artifactId>
<version>
1.18
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
fr.opensagres.xdocreport
</groupId>
<artifactId>
xdocreport
</artifactId>
<version>
1.0.6
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml-schemas
</artifactId>
<version>
4.0.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
ooxml-schemas
</artifactId>
<version>
1.3
</version>
<exclusions>
<exclusion>
<artifactId>
xmlbeans
</artifactId>
<groupId>
org.apache.xmlbeans
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.netflix.hystrix
</groupId>
<artifactId>
hystrix-javanica
</artifactId>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
jsr305
</artifactId>
<groupId>
com.google.code.findbugs
</groupId>
</exclusion>
<exclusion>
<artifactId>
annotations
</artifactId>
<groupId>
com.google.code.findbugs
</groupId>
</exclusion>
<exclusion>
<artifactId>
aspectjrt
</artifactId>
<groupId>
org.aspectj
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
easyexcel
</artifactId>
<version>
2.0.5
</version>
<exclusions>
<exclusion>
<groupId>
org.ow2.asm
</groupId>
<artifactId>
asm
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-compress
</artifactId>
<version>
1.18
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
fr.opensagres.xdocreport
</groupId>
<artifactId>
xdocreport
</artifactId>
<version>
1.0.6
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml-schemas
</artifactId>
<version>
4.0.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
ooxml-schemas
</artifactId>
<version>
1.3
</version>
<exclusions>
<exclusion>
<artifactId>
xmlbeans
</artifactId>
<groupId>
org.apache.xmlbeans
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.jsoup
</groupId>
<artifactId>
jsoup
</artifactId>
<version>
1.11.3
</version>
</dependency>
<dependency>
<groupId>
joda-time
</groupId>
<artifactId>
joda-time
</artifactId>
<version>
2.10.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.velocity
</groupId>
<artifactId>
velocity-engine-core
</artifactId>
<version>
2.1
</version>
</dependency>
<dependency>
<groupId>
org.freemarker
</groupId>
<artifactId>
freemarker
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-jexl
</artifactId>
<version>
2.1.1
</version>
</dependency>
<!-- MQTT???? -->
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-stream
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-mqtt
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<scope>
provided
</scope>
</dependency>
<!-- knife4j -->
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
${knife4j-spring-boot-starter.version}
</version>
<exclusions>
<exclusion>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
${amos.version}
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-privilege
</artifactId>
<version>
${amos.version}
</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
${springcloud.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${springboot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
1.7.9-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-generator
</artifactId>
<version>
3.2.0
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.2.0
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.1.2
</version>
<exclusions>
<exclusion>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.3.10
</version>
</dependency>
<dependency>
<groupId>
org.liquibase
</groupId>
<artifactId>
liquibase-core
</artifactId>
<version>
4.4.3
</version>
</dependency>
<dependency>
<groupId>
e-iceblue
</groupId>
<artifactId>
spire.doc.free
</artifactId>
<version>
3.9.0
</version>
</dependency>
<dependency>
<groupId>
net.sf.json-lib
</groupId>
<artifactId>
json-lib
</artifactId>
<version>
2.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
<version>
2.17.0
</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<!--<repository> <id>Releases</id> <name>Releases</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository> <repository> <id>Snapshots</id> <name>Snapshots</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository> -->
<repository>
<id>
Releases
</id>
<name>
Releases
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/releases/
</url>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
http://113.142.68.105:8081/nexus/content/groups/public/
</url>
</repository>
<dependency>
<groupId>
org.jsoup
</groupId>
<artifactId>
jsoup
</artifactId>
<version>
1.11.3
</version>
</dependency>
<dependency>
<groupId>
joda-time
</groupId>
<artifactId>
joda-time
</artifactId>
<version>
2.10.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.velocity
</groupId>
<artifactId>
velocity-engine-core
</artifactId>
<version>
2.1
</version>
</dependency>
<dependency>
<groupId>
org.freemarker
</groupId>
<artifactId>
freemarker
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-jexl
</artifactId>
<version>
2.1.1
</version>
</dependency>
<!-- MQTT???? -->
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-stream
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-mqtt
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<scope>
provided
</scope>
</dependency>
<!-- knife4j -->
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
${knife4j-spring-boot-starter.version}
</version>
<exclusions>
<exclusion>
<groupId>
org.javassist
</groupId>
<artifactId>
javassist
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-systemctl
</artifactId>
<version>
${amos.version}
</version>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-feign-privilege
</artifactId>
<version>
${amos.version}
</version>
</dependency>
<dependency>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<version>
2.6
</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
${springcloud.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${springboot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-rule
</artifactId>
<version>
1.7.9-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-generator
</artifactId>
<version>
3.2.0
</version>
</dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.2.0
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<artifactId>
mybatis-spring-boot-starter
</artifactId>
<version>
2.1.2
</version>
<exclusions>
<exclusion>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.3.10
</version>
</dependency>
<dependency>
<groupId>
org.liquibase
</groupId>
<artifactId>
liquibase-core
</artifactId>
<version>
4.4.3
</version>
</dependency>
<dependency>
<groupId>
e-iceblue
</groupId>
<artifactId>
spire.doc.free
</artifactId>
<version>
3.9.0
</version>
</dependency>
<dependency>
<groupId>
net.sf.json-lib
</groupId>
<artifactId>
json-lib
</artifactId>
<version>
2.4
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
<version>
2.17.0
</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<!--<repository> <id>Releases</id> <name>Releases</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository> <repository> <id>Snapshots</id> <name>Snapshots</name> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository> -->
<repository>
<id>
Releases
</id>
<name>
Releases
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/releases/
</url>
</repository>
<repository>
<id>
com.e-iceblue
</id>
<name>
e-iceblue
</name>
<url>
http://113.142.68.105:8081/nexus/content/groups/public/
</url>
</repository>
<repository>
<id>
Snapshots
</id>
<name>
Snapshots
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/snapshots/
</url>
</repository>
<repository>
<id>
Snapshots
</id>
<name>
Snapshots
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/snapshots/
</url>
</repository>
<repository>
<id>
thirdparty
</id>
<name>
thirdparty
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/thirdparty/
</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>
Releases
</id>
<name>
Releases
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/releases/
</url>
</repository>
<repository>
<id>
thirdparty
</id>
<name>
thirdparty
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/thirdparty/
</url>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>
Releases
</id>
<name>
Releases
</name>
<url>
http://113.142.68.105:8081/nexus/content/repositories/releases/
</url>
</repository>
</distributionManagement>
<modules>
<module>
amos-boot-biz-common
</module>
<module>
amos-boot-core
</module>
<module>
amos-boot-data
</module>
<module>
amos-boot-system-jxiop
</module>
</modules>
<modules>
<module>
amos-boot-biz-common
</module>
<module>
amos-boot-core
</module>
<module>
amos-boot-data
</module>
<module>
amos-boot-system-jxiop
</module>
</modules>
</project>
\ 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