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
595eb981
Commit
595eb981
authored
Jul 18, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
008ae1c3
93701e05
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
769 additions
and
438 deletions
+769
-438
BusinessException.java
...in/amos/api/householdapi/exception/BusinessException.java
+1
-1
TanYinInveterInfo.java
...face/orm/houseapi/entity/tdeingine/TanYinInveterInfo.java
+1
-1
TanYinDataAcquisitionServiceImpl.java
...i/face/service/impl/TanYinDataAcquisitionServiceImpl.java
+26
-19
IHygfIcbcService.java
...n/amos/boot/module/hygf/api/service/IHygfIcbcService.java
+18
-0
IPersonnelBusinessService.java
...ot/module/hygf/api/service/IPersonnelBusinessService.java
+2
-0
pom.xml
amos-boot-system-jxiop/amos-boot-module-hygf-biz/pom.xml
+29
-29
MysqlServerConfig.java
...n/amos/boot/module/hygf/biz/config/MysqlServerConfig.java
+114
-6
FinancingInfoController.java
...t/module/hygf/biz/controller/FinancingInfoController.java
+5
-5
HygfIcbcController.java
...s/boot/module/hygf/biz/controller/HygfIcbcController.java
+41
-0
PersonnelBusinessController.java
...dule/hygf/biz/controller/PersonnelBusinessController.java
+13
-0
PowerStationController.java
...ot/module/hygf/biz/controller/PowerStationController.java
+2
-2
PreparationMoneyController.java
...odule/hygf/biz/controller/PreparationMoneyController.java
+7
-7
UnitInfoController.java
...s/boot/module/hygf/biz/controller/UnitInfoController.java
+2
-2
TaskV2FeignService.java
...n/amos/boot/module/hygf/biz/feign/TaskV2FeignService.java
+3
-1
WorkFlowFeignService.java
...amos/boot/module/hygf/biz/feign/WorkFlowFeignService.java
+2
-1
WorkflowFeignClient.java
.../amos/boot/module/hygf/biz/feign/WorkflowFeignClient.java
+2
-2
XidFeignConfiguration.java
...mos/boot/module/hygf/biz/feign/XidFeignConfiguration.java
+43
-43
AcceptanceRectificationOrderServiceImpl.java
...service/impl/AcceptanceRectificationOrderServiceImpl.java
+2
-2
AcceptanceServiceImpl.java
...t/module/hygf/biz/service/impl/AcceptanceServiceImpl.java
+2
-2
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+2
-3
FinancingInfoServiceImpl.java
...odule/hygf/biz/service/impl/FinancingInfoServiceImpl.java
+0
-1
HygfIcbcServiceImpl.java
...oot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
+88
-0
PersonnelBusinessServiceImpl.java
...e/hygf/biz/service/impl/PersonnelBusinessServiceImpl.java
+158
-136
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+0
-1
PreparationMoneyServiceImpl.java
...le/hygf/biz/service/impl/PreparationMoneyServiceImpl.java
+2
-3
SurveyInformationServiceImpl.java
...e/hygf/biz/service/impl/SurveyInformationServiceImpl.java
+1
-2
WorkflowImpl.java
.../amos/boot/module/hygf/biz/service/impl/WorkflowImpl.java
+0
-1
application-dev.properties
...le-hygf-biz/src/main/resources/application-dev.properties
+1
-8
application-kingbase8.properties
...f-biz/src/main/resources/application-kingbase8.properties
+18
-11
application.properties
...module-hygf-biz/src/main/resources/application.properties
+3
-2
logback-dev.xml
...s-boot-module-hygf-biz/src/main/resources/logback-dev.xml
+9
-9
logback-kingbase8.xml
...-module-hygf-biz/src/main/resources/logback-kingbase8.xml
+1
-1
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+2
-2
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+105
-96
BitTypeHandler.java
...oin/amos/boot/module/jxiop/biz/config/BitTypeHandler.java
+35
-0
application-kingbase8.properties
...n-biz/src/main/resources/application-kingbase8.properties
+22
-29
application.properties
...p-bigscreen-biz/src/main/resources/application.properties
+2
-6
pom.xml
pom.xml
+5
-4
No files found.
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/exception/BusinessException.java
View file @
595eb981
...
...
@@ -12,7 +12,7 @@ import org.typroject.tyboot.core.foundation.exception.BaseException;
*/
public
class
BusinessException
extends
BaseException
{
private
String
code
=
""
;
private
String
code
;
public
BusinessException
(
String
message
)
{
super
(
message
,
BusinessException
.
class
.
getSimpleName
(),
"错误的请求."
);
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/orm/houseapi/entity/tdeingine/TanYinInveterInfo.java
View file @
595eb981
...
...
@@ -38,7 +38,7 @@ public class TanYinInveterInfo {
private
String
gmtCreate
;
@ApiModelProperty
(
"ID"
)
@TableField
(
"id
S
tring"
)
@TableField
(
"id
_s
tring"
)
private
String
idString
;
@ApiModelProperty
(
"功率"
)
...
...
amos-boot-data/amos-boot-data-housepvapi/src/main/java/com/yeejoin/amos/api/householdapi/face/service/impl/TanYinDataAcquisitionServiceImpl.java
View file @
595eb981
...
...
@@ -216,8 +216,9 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
long
ts
=
System
.
currentTimeMillis
();
log
.
info
(
"-------碳银同步电站开始: {} ------- "
,
ts
);
List
<
String
>
projectNos
=
tanYinCustomerInfoMapper
.
listProjectNo
();
projectNos
.
add
(
"TF2024060312382700202"
);
String
powerDate
=
"2024-07-17"
;
// projectNos.add("TF2024060312382700202");
// String powerDate = "2024-07-17";
String
powerDate
=
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
));
if
(
CollectionUtils
.
isEmpty
(
projectNos
))
{
return
;
}
...
...
@@ -238,6 +239,8 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
TANYIN
.
getCode
()).
in
(
"third_station_id"
,
stationIds
));
Map
<
String
,
JpStation
>
jpStationMap
=
jpStations
.
stream
().
collect
(
Collectors
.
toMap
(
JpStation:
:
getThirdStationId
,
Function
.
identity
()));
List
<
TanYinInveterInfo
>
tanYinInveterInfos
=
new
ArrayList
();
for
(
TanYinStationInfo
tanYinStationInfo
:
tanYinStationInfos
)
{
tanYinStationInfo
.
setCreateTime
(
System
.
currentTimeMillis
());
tanYinStationInfoMapper
.
insert
(
tanYinStationInfo
);
...
...
@@ -250,7 +253,7 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
tanYinInveterInfo
.
setSn
(
inverterListDTO
.
getSn
());
tanYinInveterInfo
.
setSupplier
(
inverterListDTO
.
getSupplier
());
tanYinInveterInfo
.
setCreateTime
(
System
.
currentTimeMillis
());
tanYinInveterInfo
Mapper
.
insert
(
tanYinInveterInfo
);
tanYinInveterInfo
s
.
add
(
tanYinInveterInfo
);
}
String
stationId
=
tanYinStationInfo
.
getProjectNo
();
...
...
@@ -408,32 +411,23 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
}
else
{
TdHYGFStationAllGenerateMapper
.
insert
(
TdHYGFStationAllGenerate
);
}
}
log
.
info
(
"-------碳银同步电站结束: {} ------- "
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
log
.
info
(
"-------碳银同步逆变器开始: {} ------- "
+
ts
+
"------- "
+
sdf
.
format
(
new
Date
()));
inverterList
(
tanYinInveterInfos
);
}
/**
* 每隔 10分钟同步碳银电站逆变器信息
*
* @param
* @return {@link }
* @throws
* @author yangyang
* @date 2024/7/17 13:58
*/
@Scheduled
(
cron
=
"${dataRequestScheduled.tanYin}"
)
@Override
public
void
inverterList
()
{
long
ts
=
System
.
currentTimeMillis
();
log
.
info
(
"-------碳银同步逆变器开始: {} ------- "
,
ts
);
List
<
TanYinInveterInfo
>
tanYinInveterInfos
=
tanYinInveterInfoMapper
.
selectList
(
new
QueryWrapper
<>());
}
public
void
inverterList
(
List
<
TanYinInveterInfo
>
tanYinInveterInfos
)
{
if
(
CollectionUtils
.
isEmpty
(
tanYinInveterInfos
))
{
return
;
}
Map
<
String
,
TanYinInveterInfo
>
tanYinInveterInfoMap
=
tanYinInveterInfos
.
stream
().
collect
(
Collectors
.
toMap
(
TanYinInveterInfo:
:
getSn
,
v
->
v
,
(
k1
,
k2
)
->
k1
));
List
<
String
>
stationIds
=
tanYinInveterInfos
.
stream
().
map
(
TanYinInveterInfo:
:
getProjectNo
).
collect
(
Collectors
.
toList
());
List
<
JpStation
>
jpStations
=
jpStationMapper
.
selectList
(
new
QueryWrapper
<
JpStation
>().
eq
(
"third_code"
,
PVProducerInfoEnum
.
TANYIN
.
getCode
()).
in
(
"third_station_id"
,
stationIds
));
Map
<
String
,
JpStation
>
jpStationMap
=
jpStations
.
stream
().
collect
(
Collectors
.
toMap
(
JpStation:
:
getThirdStationId
,
Function
.
identity
()));
...
...
@@ -452,6 +446,12 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
for
(
TanYinInveterInfo
tanYinInveterInfo
:
tanYinInveterInfos
)
{
JSONObject
tanYinInveterInfoResultJson
=
tanYinInveterInfoResultMap
.
getJSONObject
(
tanYinInveterInfo
.
getSn
());
TanYinInveterInfo
tanYinInveterInfoDTO
=
tanYinInveterInfoResultJson
.
toJavaObject
(
TanYinInveterInfo
.
class
);
tanYinInveterInfoDTO
.
setProjectNo
(
tanYinInveterInfo
.
getProjectNo
());
tanYinInveterInfoDTO
.
setDeviceName
(
tanYinInveterInfo
.
getDeviceName
());
tanYinInveterInfoDTO
.
setSn
(
tanYinInveterInfo
.
getSn
());
tanYinInveterInfoDTO
.
setSupplier
(
tanYinInveterInfo
.
getSupplier
());
tanYinInveterInfoDTO
.
setCreateTime
(
System
.
currentTimeMillis
());
tanYinInveterInfoMapper
.
insert
(
tanYinInveterInfoDTO
);
JpInverter
jpInverter
=
jpInverterMapper
.
selectOne
(
new
QueryWrapper
<
JpInverter
>().
eq
(
"third_station_id"
,
tanYinInveterInfo
.
getProjectNo
())
...
...
@@ -471,6 +471,11 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
jpInverter
.
setUpdateTime
(
tanYinInveterInfoDTO
.
getGmtCreate
()
!=
null
?
new
Date
(
Long
.
parseLong
(
tanYinInveterInfoDTO
.
getGmtCreate
()))
:
new
Date
());
JpStation
jpStation
=
jpStationMap
.
get
(
tanYinInveterInfo
.
getProjectNo
());
if
(
jpStation
!=
null
)
{
if
(!
"离线"
.
equals
(
jpStation
.
getState
())
&&
!
"异常"
.
equals
(
jpStation
.
getState
()))
{
jpStation
.
setState
(
TanYinConstant
.
stationStatus
.
get
(
tanYinInveterInfoDTO
.
getStatus
()));
jpStationMapper
.
updateById
(
jpStation
);
jpStationMap
.
put
(
tanYinInveterInfo
.
getProjectNo
(),
jpStation
);
}
// 逆变器没有就空着
// jpInverter.setDayPowerGeneration(jpStation.getDayGenerate());
// jpInverter.setMonthPowerGeneration(jpStation.getMonthGenerate());
...
...
@@ -506,6 +511,8 @@ public class TanYinDataAcquisitionServiceImpl implements TanYinDataAcquisitionSe
jpInverterElectricity
.
setThirdCode
(
PVProducerInfoEnum
.
TANYIN
.
getCode
());
jpInverterElectricity
.
setThirdStationId
(
jpInverter
.
getThirdStationId
());
// jpInverterElectricity.setType("交流");
// jpInverterElectricity.setFrequency();// 频率
// jpInverterElectricity.setPower();// 功率
jpInverterElectricity
.
setName
(
name
);
if
(
tanYinInveterInfoResultJson
.
get
(
name
)
!=
null
&&
!
""
.
equals
(
tanYinInveterInfoResultJson
.
get
(
name
)))
{
jpInverterElectricity
.
setVoltage
(
Double
.
valueOf
(
tanYinInveterInfoResultJson
.
get
(
name
).
toString
()));
// 电压
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IHygfIcbcService.java
0 → 100644
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 电子钱包接口类
*
* @author system_generator
* @date 2024-01-12
*/
public
interface
IHygfIcbcService
{
void
icbcRegisterWalletUrl
(
HttpServletRequest
req
,
HttpServletResponse
resp
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IPersonnelBusinessService.java
View file @
595eb981
...
...
@@ -17,4 +17,6 @@ public interface IPersonnelBusinessService {
UserDataDto
getPersonnelBusinessById
(
String
id
);
Object
deleteAllBySequenceNbr
(
Long
sequenceNbr
);
Boolean
deleteBySequenceNbrs
(
String
sequenceNbrs
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/pom.xml
View file @
595eb981
...
...
@@ -67,35 +67,35 @@
<version>
1.10.4
</version>
<scope>
compile
</scope>
</dependency>
<dependency
>
<groupId>
io.github.openfeign
</groupId
>
<artifactId>
feign-httpclient
</artifactId
>
</dependency
>
<dependency
>
<groupId>
com.esotericsoftware.kryo
</groupId
>
<artifactId>
kryo
</artifactId
>
<version>
2.24.0
</version
>
</dependency
>
<dependency
>
<groupId>
de.javakaffee
</groupId
>
<artifactId>
kryo-serializers
</artifactId
>
<version>
0.45
</version
>
</dependency
>
<dependency
>
<groupId>
com.esotericsoftware
</groupId
>
<artifactId>
kryo
</artifactId
>
<version>
4.0.2
</version
>
</dependency
>
<dependency
>
<groupId>
cn.com.vastdata
</groupId
>
<artifactId>
vastbase-jdbc
</artifactId
>
<version>
2.7p
</version
>
</dependency
>
<dependency
>
<groupId>
io.seata
</groupId
>
<artifactId>
seata-spring-boot-starter
</artifactId
>
<version>
1.8.0
</version
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>io.github.openfeign</groupId>--
>
<!-- <artifactId>feign-httpclient</artifactId>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>com.esotericsoftware.kryo</groupId>--
>
<!-- <artifactId>kryo</artifactId>--
>
<!-- <version>2.24.0</version>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>de.javakaffee</groupId>--
>
<!-- <artifactId>kryo-serializers</artifactId>--
>
<!-- <version>0.45</version>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>com.esotericsoftware</groupId>--
>
<!-- <artifactId>kryo</artifactId>--
>
<!-- <version>4.0.2</version>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>cn.com.vastdata</groupId>--
>
<!-- <artifactId>vastbase-jdbc</artifactId>--
>
<!-- <version>2.7p</version>--
>
<!-- </dependency>--
>
<!-- <dependency>--
>
<!-- <groupId>io.seata</groupId>--
>
<!-- <artifactId>seata-spring-boot-starter</artifactId>--
>
<!-- <version>1.8.0</version>--
>
<!-- </dependency>--
>
<!-- ICBC工行支付 -->
<dependency>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/config/MysqlServerConfig.java
View file @
595eb981
//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.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;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//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.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource;
//import java.util.Properties;
//
//
///**
// * mysql配置类
// * @author zhengwen
// */
//@Configuration
//@MapperScan(basePackages = {"com.yeejoin.amos.boot.module.hygf.api.mapper"}, sqlSessionTemplateRef = "mysqlSqlSessionTemplate")
//public class MysqlServerConfig {
//
// @Autowired
// MetaHandler metaHandler;
// private static final String MAPPER_LOCATION = "classpath*:mapper/mysql/*.xml";
// @Bean(name = "mysqlDataSource")
// @ConfigurationProperties(prefix = "spring.datasource.mysql-service")
// @Primary
// public DataSource mysqlDataSource() {
// 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("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;
// }
//
//
//}
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
config
;
...
...
@@ -7,7 +115,6 @@ 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
;
...
...
@@ -44,18 +151,16 @@ 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
Proxy
"
)
DataSource
dataSource
,
GlobalConfig
globalConfig
)
throws
Exception
{
public
SqlSessionFactory
mysqlSqlSessionFactory
(
@Qualifier
(
"mysqlDataSource"
)
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
);
//分页插件
...
...
@@ -70,7 +175,10 @@ public class MysqlServerConfig {
""
+
";"
);
interceptor
.
setProperties
(
properties
);
bean
.
setPlugins
(
new
Interceptor
[]
{
interceptor
,
paginationInterceptor
(),
userEmpowerInterceptor
(),
paginationInterceptor
()
});
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/FinancingInfoController.java
View file @
595eb981
...
...
@@ -5,8 +5,8 @@ import cn.hutool.core.map.MapBuilder;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseUtil
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -48,7 +48,7 @@ public class FinancingInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@
Global
Transactional
@Transactional
public
ResponseModel
<
FinancingInfoDto
>
save
(
@RequestBody
FinancingInfoDto
model
)
{
model
=
financingInfoServiceImpl
.
saveModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
...
...
@@ -63,7 +63,7 @@ public class FinancingInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
@
Global
Transactional
@Transactional
public
ResponseModel
<
FinancingInfoDto
>
updateBySequenceNbrFinancingInfo
(
@RequestBody
FinancingInfoDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setFile
(
JSON
.
toJSONString
(
model
.
getFiles
()));
...
...
@@ -147,7 +147,7 @@ public class FinancingInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"撤回"
,
notes
=
"撤回"
)
@
Global
Transactional
@Transactional
@GetMapping
(
value
=
"/rollback"
)
public
ResponseModel
rollback
(
String
instanceId
,
String
peasantHouseholdId
)
{
financingInfoServiceImpl
.
rollback
(
instanceId
,
peasantHouseholdId
);
...
...
@@ -158,7 +158,7 @@ public class FinancingInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"审核"
,
notes
=
"审核"
)
@PostMapping
(
value
=
"/execueFlow"
)
@
Global
Transactional
@Transactional
public
ResponseModel
execueFlow
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
financingInfoServiceImpl
.
execueFlow
(
params
);
return
CommonResponseNewUtil
.
success
();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/HygfIcbcController.java
0 → 100644
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfIcbcServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
/**
* 并网信息
*/
@RestController
@Api
(
tags
=
"电子钱包"
)
@RequestMapping
(
value
=
"/icbc"
)
public
class
HygfIcbcController
extends
BaseController
{
@Autowired
HygfIcbcServiceImpl
hygfIcbcService
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/icbcRegisterWalletUrl"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"注册电子钱包"
,
notes
=
"注册电子钱包"
)
public
void
getHygfIcbcRegisterWalletUrl
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
hygfIcbcService
.
icbcRegisterWalletUrl
(
req
,
resp
);
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PersonnelBusinessController.java
View file @
595eb981
...
...
@@ -108,6 +108,19 @@ public class PersonnelBusinessController extends BaseController {
}
/**
* 根据sequenceNbrs批量删除
*
* @param sequenceNbrs 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/deleteDealerPerson"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbrs批量删除经销商人员信息"
,
notes
=
"根据sequenceNbrs批量删除经销商人员信息"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbrs
(
@RequestParam
(
value
=
"sequenceNbrs"
)
String
sequenceNbrs
){
return
ResponseHelper
.
buildResponse
(
personnelBusinessServiceImpl
.
deleteBySequenceNbrs
(
sequenceNbrs
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PowerStationController.java
View file @
595eb981
...
...
@@ -6,10 +6,10 @@ import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.PowerStationServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -132,7 +132,7 @@ public class PowerStationController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"电站审核"
,
notes
=
"电站审核"
)
@PostMapping
(
value
=
"/powerStationExamine"
)
@
Global
Transactional
@Transactional
public
ResponseModel
<
String
>
powerStationExamine
(
@RequestParam
(
value
=
"pageId"
)
long
pageId
,
@RequestParam
(
value
=
"nodeCode"
)
String
nodeCode
,
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PreparationMoneyController.java
View file @
595eb981
...
...
@@ -19,11 +19,11 @@ import com.yeejoin.amos.boot.module.hygf.biz.service.impl.DesignInformationServi
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfReplenishmentServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.PreparationMoneyServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
...
@@ -69,7 +69,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增发货单"
,
notes
=
"新增发货单"
)
@
Global
Transactional
@Transactional
@UserLimits
public
ResponseModel
<
PreparationMoney
>
save
(
@RequestParam
(
"isSubmit"
)
String
isSubmit
,
@RequestBody
PreparationMoney
model
)
{
AgencyUserModel
agencyUserModel
=
getUserInfo
();
...
...
@@ -257,7 +257,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/uploadVoucher"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传收获凭证"
,
notes
=
"上传收获凭证"
)
@
Global
Transactional
@Transactional
public
ResponseModel
uploadVoucher
(
@RequestParam
(
value
=
"instanceId"
,
required
=
false
)
String
instanceId
,
@RequestBody
PreparationMoney
model
,
String
isSubmit
)
{
preparationMoneyServiceImpl
.
uploadVoucher
(
model
,
instanceId
,
isSubmit
);
...
...
@@ -267,7 +267,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/excuteFlow"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"收货审核"
,
notes
=
"收货审核"
)
@
Global
Transactional
@Transactional
public
ResponseModel
excuteFlow
(
@RequestParam
(
value
=
"instanceId"
,
required
=
false
)
String
instanceId
,
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestBody
Map
<
String
,
Object
>
kv
)
{
...
...
@@ -278,7 +278,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/replenishmentSubmit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补货申请"
,
notes
=
"补货申请"
)
@
Global
Transactional
@Transactional
public
ResponseModel
replenishmentSubmit
(
@RequestBody
HygfReplenishment
hygfReplenishment
)
{
// HygfReplenishment hygfReplenishment1 = new HygfReplenishment();
// BeanUtils.copyProperties(hygfReplenishment,hygfReplenishment1);
...
...
@@ -302,7 +302,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/replenishmentAudit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补货审核"
,
notes
=
"补货审核"
)
@
Global
Transactional
@Transactional
public
ResponseModel
replenishmentAudit
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestBody
Map
<
String
,
Object
>
kv
)
{
preparationMoneyServiceImpl
.
replenishmentAudit
(
sequenceNbr
,
kv
);
return
CommonResponseNewUtil
.
success
();
...
...
@@ -311,7 +311,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/submitOrder"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补货审核"
,
notes
=
"补货审核"
)
@
Global
Transactional
@Transactional
public
ResponseModel
submitOrder
(
@RequestParam
(
value
=
"instanceId"
)
String
instanceId
,
@RequestParam
(
value
=
"isSubmit"
)
String
isSubmit
,
@RequestBody
PreparationMoney
model
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/UnitInfoController.java
View file @
595eb981
...
...
@@ -25,7 +25,6 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -33,6 +32,7 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -262,7 +262,7 @@ public class UnitInfoController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/unitRegister"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位注册"
,
notes
=
"单位注册"
)
@
Global
Transactional
@Transactional
public
ResponseModel
<
UnitRegisterDto
>
save
(
@RequestBody
UnitRegisterDto
model
)
{
try
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/feign/TaskV2FeignService.java
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
feign
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
...
...
@@ -16,7 +17,8 @@ import java.util.List;
* @apiNote 待办Feign调用
* @date 2024-05-16
*/
@FeignClient
(
name
=
"AMOS-API-PRIVILEGE"
,
path
=
"/systemctl/v2/task"
,
configuration
=
{
XidFeignConfiguration
.
class
})
//@FeignClient(name = "AMOS-API-PRIVILEGE", path = "/systemctl/v2/task", configuration = {XidFeignConfiguration.class})
@FeignClient
(
name
=
"AMOS-API-PRIVILEGE"
,
path
=
"/systemctl/v2/task"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
TaskV2FeignService
{
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/feign/WorkFlowFeignService.java
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -8,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
import
java.util.Map
;
@FeignClient
(
name
=
"${workflow.feign.name}"
,
path
=
"workflow"
,
configuration
=
{
XidFeignConfiguration
.
class
})
@FeignClient
(
name
=
"${workflow.feign.name}"
,
path
=
"workflow"
,
configuration
=
{
MultipartSupportConfig
.
class
})
public
interface
WorkFlowFeignService
{
/***
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/feign/WorkflowFeignClient.java
View file @
595eb981
...
...
@@ -11,8 +11,8 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
import
java.util.Map
;
@FeignClient
(
name
=
"${workflow.feign.name:AMOS-API-WORKFLOW}"
,
path
=
"workflow"
,
configuration
=
{
XidFeignConfiguration
.
class
})
@FeignClient
(
name
=
"${workflow.feign.name:AMOS-API-WORKFLOW}"
,
path
=
"workflow"
,
configuration
=
{
MultipartSupportConfig
.
class
})
//
@FeignClient(name = "${workflow.feign.name:AMOS-API-WORKFLOW}", path = "workflow", configuration = {XidFeignConfiguration.class})
public
interface
WorkflowFeignClient
{
/***
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/feign/XidFeignConfiguration.java
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
feign
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
feign.codec.Encoder
;
import
feign.form.spring.SpringFormEncoder
;
import
io.seata.core.context.RootContext
;
import
org.springframework.beans.factory.ObjectFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.http.HttpMessageConverters
;
import
org.springframework.cloud.openfeign.support.SpringEncoder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.context.request.RequestContextListener
;
@Configuration
public
class
XidFeignConfiguration
implements
RequestInterceptor
{
@Autowired
private
ObjectFactory
<
HttpMessageConverters
>
messageConverters
;
@Bean
public
Encoder
feignFormEncoder
()
{
return
new
SpringFormEncoder
(
new
SpringEncoder
(
messageConverters
));
}
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public
RequestContextListener
requestInterceptor
()
{
return
new
RequestContextListener
();
}
@Override
public
void
apply
(
RequestTemplate
template
)
{
String
xid
=
RootContext
.
getXID
();
if
(
StringUtils
.
hasText
(
xid
)){
template
.
header
(
RootContext
.
KEY_XID
,
xid
);
}
}
}
\ No newline at end of file
//package com.yeejoin.amos.boot.module.hygf.biz.feign;
//
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import io.seata.core.context.RootContext;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.util.StringUtils;
//import org.springframework.web.context.request.RequestContextListener;
//
//@Configuration
//public class XidFeignConfiguration implements RequestInterceptor {
// @Autowired
// private ObjectFactory<HttpMessageConverters> messageConverters;
//
// @Bean
// public Encoder feignFormEncoder() {
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
// }
// /**
// * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
// * @return
// */
// @Bean
// public RequestContextListener requestInterceptor() {
// return new RequestContextListener();
// }
//
// @Override
// public void apply(RequestTemplate template) {
// String xid = RootContext.getXID();
// if(StringUtils.hasText(xid)){
// template.header(RootContext.KEY_XID, xid);
// }
// }
//}
\ 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/AcceptanceRectificationOrderServiceImpl.java
View file @
595eb981
...
...
@@ -20,11 +20,11 @@ import com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceRectificationOrd
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.apache.commons.lang3.BooleanUtils
;
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
;
...
...
@@ -103,7 +103,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
* 提交整改并触发工作流
*/
@
Global
Transactional
@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 @
595eb981
...
...
@@ -19,11 +19,11 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper;
import
com.yeejoin.amos.boot.module.hygf.api.service.IAcceptanceService
;
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.StringUtils
;
...
...
@@ -115,7 +115,7 @@ public class AcceptanceServiceImpl implements IAcceptanceService {
return
Optional
.
ofNullable
(
item
).
orElse
(
new
AcceptanceCheckItem
());
}
@Override
@
Global
Transactional
@Transactional
public
void
checkAccept
(
Long
basicGridAcceptanceId
,
String
userId
)
{
String
lockName
=
String
.
format
(
"LockName:checkAccept:%s"
,
basicGridAcceptanceId
);
Boolean
isLocked
=
redisLockUtil
.
tryLock
(
lockName
,
lockName
,
10
,
1
);
...
...
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 @
595eb981
...
...
@@ -13,7 +13,6 @@ import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -94,7 +93,7 @@ public class BasicGridAcceptanceServiceImpl
return
grid
;
}
@
Global
Transactional
@Transactional
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
...
...
@@ -202,7 +201,7 @@ public class BasicGridAcceptanceServiceImpl
return
bool
;
}
@
Global
Transactional
@Transactional
public
void
execute
(
AcceptanceCheckItem
dto
,
String
userId
)
{
String
lockName
=
String
.
format
(
"LockName:executeWorkflow:%s"
,
dto
.
getBasicGridAcceptanceId
());
Boolean
isLocked
=
redisLockUtil
.
tryLock
(
lockName
,
lockName
,
10
,
1
);
...
...
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 @
595eb981
...
...
@@ -35,7 +35,6 @@ 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.apache.commons.lang3.BooleanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfIcbcServiceImpl.java
0 → 100644
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.icbc.api.IcbcConstants
;
import
com.icbc.api.UiIcbcClient
;
import
com.icbc.api.request.JftUiUserEntrustopenacctSubmitRequestV1
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfIcbcService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.PrintWriter
;
import
java.util.UUID
;
/**
* 并网信息服务实现类
*
* @author system_generator
* @date 2024-01-12
*/
@Service
@Slf4j
public
class
HygfIcbcServiceImpl
implements
IHygfIcbcService
{
private
static
final
long
serialVersionUID
=
1L
;
// 合作方 APPID
private
static
final
String
APP_ID
=
"11000000000000028870"
;
// 此处替换合作方 APPID 对应私钥
private
static
final
String
MY_PRIVATE_KEY
=
"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAlcIeANdqipul3/qAIRlknSacHiFCMzLzUJisGcr9ipm3p2rir8WDsac2MxgtUt+f89SGNoWyjv4q0/QAKQQTd5U3KuGAksCJLBGVibuFe7G7YGYVezUksjvocvp8GIinCIkzq67KL2SOpGXAu3s+282rx8AxdTZA/EhXQvbORbWz5+DamyY+wS7Maa8KmIOb6WZPtiXgENZxDHAafrqW8Gt1BnVfJNf5yS5J9Wl+LcR1EPvi5iH8dSIdn1ZMVupoREjV/DvItSogVehsqTRZWuekAo2xH9YEli1UMG/l3deViRn/A4VmPPzdv0xXpn/yO+OTjWez+KmSmJfAZXBvAgMBAAECggEABRYviWFWTz8X+1qeIDI/nHO2KFt3X2tAxkJztd/8h5PYmYw3e4NPATp5Ayp4UgIlW/ExxNW91EiImBL/F939eJIpA8sDJ8U4hqb+U+fOZyksOZnDOIAHmE+I24vl588yFM9Z6F55gGeeDVJ0SZHqIG/nz8i339aLt02yj3N6V1peQugBP6L9arcD+gVu4F70whkqW+lHBK/WzX1OazqEx3Ip175jqzi9/0vO/h/kqnGGXuMi2VeuAPsa+d0a6lf/FScxqCt3t6dCkJ5DPA1MCj81dPi5ZfCM/vE0N8I6LEV+RyC7bb4YVO/PoicFjb2j8vfLvldOUrsvkNH51dZusQKBgQDpMHacOBpIuVzEFfNtS9SgA96cUV6NCSmHoQppJ/p9xKzY4DpcqoOCIBT4WCvVe6PeN5mrjzt8Q5gJWxiq0tVgIF9k8GjLmuiJ2v4Qh8aUmlRwn0T0DYiX/Y7uzX+pRlkpoKrSktlTOT9vmGwZDGDk0h2+H3hZ3YQEucfA6bhHmQKBgQDTbHrbr1WsUR9lrdLaGi/Uphpl3BXLuCnJXav3yIZOktO5V68MfPZXLP7aaNtbK3n0YHD+Uv8wpHBBSWQYjVYlGdvlniA/W1pr73GZJECFfS1BmmFC4GG3E92D5IkmrcPlUuz8XxKrlwHnfW1F0MoDvhp930vS0tS6u+WYTt9dRwKBgCeEQPVkRIACeYf5OFFTQmsDfNv8pgs8fD8xuTPsxHQ/uhLenMVLWBHbIfKb7oG0/CYSQgZitW/vfHpJZ7q7E9HAaqoOW5P1YmbKJ7fhanOQW7LiKqs5B+bJ30j0piendkCpq4kXvaBu2SMuL1NnV5wvRz8K0jhYY6DxYrp8YPAxAoGAZxWTaZ25tgTvvBHeprzx6Ur7wAJpFiU7KpVjjbLV2WW5mbro/LvJGIQ11qQdn/w4wDBtp3MsPblPimWQSnBPOlO7Zd+NdZbDJbFfv/1vACcic8Qj/AmPW0ZyUSaSwKskwqGGLx7j6Yn9QbNkHhBJDz4XiJvhSm/FjS6kKXj7a20CgYEArnEiPmL5g1Ca/qKK9ql8Q6P9gipIfGGpaFu23y0trbcFpVn8Oos/ic0Jgw4Xiz+rqvb6bW2V6lqBJ+9/kdn0i7zlZxKNpYsW2xFgi04OU3d5HkGL16Y1rpqMYYEhjFaOIn7J8P046UYR99yaybgQd18TE6oFrX8OL5uY8M4ge4Y="
;
// 指定《聚富通委托代扣签约同步开户页面服务V1》URL
private
static
final
String
serviceUrl
=
"https://gw.open.icbc.com.cn/ui/jft/ui/user/entrustopenacct/submit/V1"
;
private
static
final
String
corpNo
=
"020240710000001169"
;
private
static
final
String
trxChannel
=
"05"
;
// 05表示小程序
// 此处替换合作方 AES 加密秘钥
private
static
final
String
AES_Key
=
"nuCVNzIxOTHZWv8YjEeYQA=="
;
private
static
final
String
CAMS_PUBLIC_KEY
=
"655CE8706E6ED9A30B92E57D8D645ADDE8C541C27C5C5AFD529C610C4C0B04F9074E3B6E933C50A3316AEA60CEF461BE4C7916D2AF51170D3A2631394A7F3939"
;
@Override
public
void
icbcRegisterWalletUrl
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
try
{
UiIcbcClient
client
=
new
UiIcbcClient
(
APP_ID
,
IcbcConstants
.
SIGN_TYPE_RSA2
,
MY_PRIVATE_KEY
,
IcbcConstants
.
CHARSET_UTF8
);
String
userId
=
req
.
getParameter
(
"userId"
);
JftUiUserEntrustopenacctSubmitRequestV1
request
=
new
JftUiUserEntrustopenacctSubmitRequestV1
();
request
.
setServiceUrl
(
serviceUrl
);
JftUiUserEntrustopenacctSubmitRequestV1
.
JftUiUserEntrustopenacctSubmitRequestV1Biz
bizContent
=
new
JftUiUserEntrustopenacctSubmitRequestV1
.
JftUiUserEntrustopenacctSubmitRequestV1Biz
();
bizContent
.
setAppId
(
APP_ID
);
bizContent
.
setCorpNo
(
corpNo
);
bizContent
.
setOutUserId
(
userId
);
bizContent
.
setCorpSerno
(
UUID
.
randomUUID
().
toString
());
bizContent
.
setTrxChannel
(
trxChannel
);
bizContent
.
setSignProtocol
(
"0"
);
// 是否对接缴费代扣流程
// bizContent.setOutVendorId("MAA7TGFK-2"); // 企业外系统编号
// bizContent.setProjectId(UUID.randomUUID().toString().substring(0, 16)); // 缴费项目编号
// bizContent.setBusiCode(userId); // 缴费编号
// bizContent.setProtocolEndDate("2030-12-30");
// bizContent.setProtocolLimitAmount("99999999999999999");
// bizContent.setCallbackUrl("https://www.icbc.com.cn/notify");
// bizContent.setJumpUrl("https://www.icbc.com.cn/jumpback?userId=xxx");
// bizContent.setFailJumpUrl("https://www.icbc.com.cn/jumpback?userId=xxx");
bizContent
.
setCamsPublicKey
(
CAMS_PUBLIC_KEY
);
request
.
setBizContent
(
bizContent
);
// 调用工行 SDK,生成自动提交表单,将用户跳转到收方入驻页面
resp
.
setHeader
(
"Content-Type"
,
"text/html;charset="
+
IcbcConstants
.
CHARSET_UTF8
);
PrintWriter
out
=
resp
.
getWriter
();
out
.
write
(
"<html>"
);
out
.
write
(
"<head>"
);
out
.
write
(
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset="
+
IcbcConstants
.
CHARSET_UTF8
+
"\">"
);
out
.
write
(
"</head>"
);
out
.
write
(
"<body>"
);
System
.
out
.
println
(
"111111111111111118888888888888"
+
client
.
buildPostForm
(
request
).
toString
());
out
.
write
(
client
.
buildPostForm
(
request
));
out
.
write
(
"</body>"
);
out
.
write
(
"</html>"
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
"报错了"
);
}
}
}
\ 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/PersonnelBusinessServiceImpl.java
View file @
595eb981
...
...
@@ -27,6 +27,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -68,6 +70,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Value
(
"${hygf.user.group.empty}"
)
private
long
userGroupempty
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
PersonnelBusinessServiceImpl
.
class
);
/**
* 分页查询
*/
...
...
@@ -79,13 +84,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
* 列表查询 示例
*/
public
List
<
PersonnelBusinessDto
>
queryForPersonnelBusinessList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
@Override
public
IPage
<
CompanyDtoUserDto
>
getCompanyDtoUserDto
(
CompanyDtoUserDto
dto
)
{
Map
<
String
,
String
>
map
=
personnelBusinessMapper
.
getorgcode
(
dto
.
getAmosUnitId
());
Map
<
String
,
String
>
map
=
personnelBusinessMapper
.
getorgcode
(
dto
.
getAmosUnitId
());
dto
.
setAmosUnitOrgCode
(
map
.
get
(
"orgCode"
));
IPage
<
CompanyDtoUserDto
>
pag
=
personnelBusinessMapper
.
getCompanyDtoUserDtopage
(
dto
);
...
...
@@ -93,10 +98,10 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
@Transactional
public
void
savePersonnelBusiness
(
UserDataDto
model
)
{
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
public
void
savePersonnelBusiness
(
UserDataDto
model
)
{
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
//新增平台用户
try
{
// 1 创建平台用户
...
...
@@ -119,8 +124,8 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
// 将创建用户加入用户组
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
userResult
.
getDevMessage
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
userResult
.
getDevMessage
());
}
List
<
String
>
userId
=
new
ArrayList
<>();
userId
.
add
(
userResult
.
getResult
().
getUserId
());
...
...
@@ -130,7 +135,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
//新增人员基础信息表
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
publicAgencyUser
.
setRealName
(
userDataJBDto
.
getRealName
());
publicAgencyUser
.
setGender
(
userDataJBDto
.
getGender
());
publicAgencyUser
.
setJobNumber
(
userDataJBDto
.
getJobNumber
());
...
...
@@ -139,35 +144,35 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult
.
getDevMessage
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult
.
getDevMessage
());
}
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosUserId
(
userResult
.
getResult
().
getUserId
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
()):
null
);
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
())
:
null
);
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUserMapper
.
insert
(
publicAgencyUser
);
PersonnelBusiness
re
=
new
PersonnelBusiness
();
PersonnelBusiness
re
=
new
PersonnelBusiness
();
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult1
.
getDevMessage
());
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"新增人员失败!"
+
companyResult1
.
getDevMessage
());
}
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
()):
null
);
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
())
:
null
);
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
...
...
@@ -176,8 +181,8 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
personnelBusinessMapper
.
insert
(
re
);
//增加人员权限
List
<
String
>
lisk
=
new
ArrayList
<>();
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
List
<
String
>
lisk
=
new
ArrayList
<>();
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
...
...
@@ -186,10 +191,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userEmpowerMapper
.
insert
(
stdUserEmpower
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
if
(
userResult
!=
null
&&
userResult
.
getResult
()
!=
null
&&
StringUtils
.
isNotEmpty
(
userResult
.
getResult
().
getUserId
()))
{
Privilege
.
agencyUserClient
.
multDeleteUser
(
userResult
.
getResult
().
getUserId
());
...
...
@@ -202,20 +204,20 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Transactional
public
void
updatePersonnelBusiness
(
UserDataDto
model
,
long
id
)
{
public
void
updatePersonnelBusiness
(
UserDataDto
model
,
long
id
)
{
PublicAgencyUser
publicAgencyUser
=
publicAgencyUserMapper
.
selectById
(
id
);
PublicAgencyUser
publicAgencyUser
=
publicAgencyUserMapper
.
selectById
(
id
);
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
UserDataZHDto
userDataZHDto
=
model
.
getUserDataZHDto
();
UserDataJBDto
userDataJBDto
=
model
.
getUserDataJBDto
();
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
try
{
List
<
Long
>
newRole
=
userDataZHDto
.
getRole
();
List
<
Long
>
oldRole
=
JSONArray
.
parseArray
(
publicAgencyUser
.
getRole
(),
Long
.
class
);
for
(
Long
item
:
oldRole
)
{
if
(!
newRole
.
contains
(
item
))
{
for
(
Long
item
:
oldRole
)
{
if
(!
newRole
.
contains
(
item
))
{
throw
new
BadRequest
(
"角色只能增加, 不能删除"
);
}
}
...
...
@@ -238,9 +240,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
// 将创建用户加入用户组
userResult
=
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
publicAgencyUser
.
getAmosUserId
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
userResult
.
getDevMessage
());
userResult
=
Privilege
.
agencyUserClient
.
update
(
agencyUserModel
,
publicAgencyUser
.
getAmosUserId
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
userResult
.
getDevMessage
());
}
List
<
String
>
userId
=
new
ArrayList
<>();
userId
.
add
(
userResult
.
getResult
().
getUserId
());
...
...
@@ -258,56 +260,56 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUser
.
setAmosId
(
userDataJBDto
.
getAmosUnitId
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
seleteOne
(
userDataJBDto
.
getAmosUnitId
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult
.
getDevMessage
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult
.
getDevMessage
());
}
publicAgencyUser
.
setAmosOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
publicAgencyUser
.
setAmosUserName
(
userDataZHDto
.
getUserName
());
publicAgencyUser
.
setPassword
(
DesUtil
.
encode
(
userDataZHDto
.
getPassword
(),
secretKey
));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setRole
(
JSON
.
toJSONString
(
userDataZHDto
.
getRole
()));
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUser
.
setLockTime
(
new
Date
());
publicAgencyUser
.
setHeight
(
userDataJBDto
.
getHeight
());
publicAgencyUser
.
setWeight
(
userDataJBDto
.
getWeight
());
publicAgencyUser
.
setEmergencyTelephone
(
userDataJBDto
.
getEmergencyTelephone
());
publicAgencyUser
.
setDomicileAddress
(
userDataJBDto
.
getDomicileAddress
());
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
()):
null
);
publicAgencyUser
.
setPosition
(
userDataJBDto
.
getPosition
()
!=
null
?
JSON
.
toJSONString
(
userDataJBDto
.
getPosition
())
:
null
);
publicAgencyUser
.
setNowAddress
(
userDataJBDto
.
getNowAddress
());
publicAgencyUser
.
setNativePlace
(
userDataJBDto
.
getNativePlace
());
publicAgencyUser
.
setPoliticalOutlook
(
userDataJBDto
.
getPoliticalOutlook
());
publicAgencyUserMapper
.
updateById
(
publicAgencyUser
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUser
.
getSequenceNbr
());
PersonnelBusiness
re
=
personnelBusinessMapper
.
selectOne
(
qug
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUser
.
getSequenceNbr
());
PersonnelBusiness
re
=
personnelBusinessMapper
.
selectOne
(
qug
);
FeignClientResult
<
CompanyModel
>
companyResult1
=
Privilege
.
companyClient
.
seleteOne
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult1
.
getDevMessage
());
if
(
companyResult1
==
null
||
companyResult1
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"修改人员失败!"
+
companyResult1
.
getDevMessage
());
}
re
.
setRegionalCompaniesSeq
(
Long
.
valueOf
(
userDataJBDto
.
getRegionalCompaniesSeq
()));
re
.
setRegionalCompaniesName
(
companyResult1
.
getResult
().
getCompanyName
());
re
.
setRegionalCompaniesCode
(
companyResult1
.
getResult
().
getOrgCode
());
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
()):
null
);
re
.
setCertificate
(
model
.
getUserDataZZDto
()
!=
null
?
JSON
.
toJSONString
(
model
.
getUserDataZZDto
().
getCertificate
())
:
null
);
re
.
setAmosUnitId
(
companyResult
.
getResult
().
getSequenceNbr
());
re
.
setAmosUnitName
(
companyResult
.
getResult
().
getCompanyName
());
re
.
setAmosUnitOrgCode
(
companyResult
.
getResult
().
getOrgCode
());
personnelBusinessMapper
.
updateById
(
re
);
//增加人员权限
List
<
String
>
lisk
=
new
ArrayList
<>();
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUser
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
List
<
String
>
lisk
=
new
ArrayList
<>();
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUser
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
// lisk.add(publicAgencyUser.getAmosOrgCode());
lisk
.
add
(
re
.
getRegionalCompaniesCode
());
if
(
stdUserEmpower
!=
null
)
{
if
(
stdUserEmpower
!=
null
)
{
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setAmosUserId
(
publicAgencyUser
.
getAmosUserId
());
stdUserEmpower
.
setAmosOrgCode
(
lisk
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
...
...
@@ -315,11 +317,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BadRequest
(
e
.
getMessage
());
...
...
@@ -328,36 +326,30 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
@Transactional
public
void
replace
(
String
id
){
public
void
replace
(
String
id
)
{
try
{
//获取当前用户
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
personnelBusines
.
setUserType
(
"2"
);
personnelBusinessMapper
.
updateById
(
personnelBusines
);
//获取经销商管理员
LambdaQueryWrapper
<
UnitInfo
>
qudg
=
new
LambdaQueryWrapper
<>();
qudg
.
eq
(
UnitInfo:
:
getAmosCompanySeq
,
personnelBusines
.
getAmosDealerId
());
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
qudg
);
LambdaQueryWrapper
<
PublicAgencyUser
>
qudx
=
new
LambdaQueryWrapper
<>();
qudx
.
eq
(
PublicAgencyUser:
:
getAmosUserId
,
unitInfo
.
getAdminUserId
());
PublicAgencyUser
publicAgencyUsex
=
publicAgencyUserMapper
.
selectOne
(
qudx
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qugf
=
new
LambdaQueryWrapper
<>();
qugf
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUsex
.
getSequenceNbr
());
PersonnelBusiness
personnelBusinesx
=
personnelBusinessMapper
.
selectOne
(
qugf
);
LambdaQueryWrapper
<
UnitInfo
>
qudg
=
new
LambdaQueryWrapper
<>();
qudg
.
eq
(
UnitInfo:
:
getAmosCompanySeq
,
personnelBusines
.
getAmosDealerId
());
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
qudg
);
LambdaQueryWrapper
<
PublicAgencyUser
>
qudx
=
new
LambdaQueryWrapper
<>();
qudx
.
eq
(
PublicAgencyUser:
:
getAmosUserId
,
unitInfo
.
getAdminUserId
());
PublicAgencyUser
publicAgencyUsex
=
publicAgencyUserMapper
.
selectOne
(
qudx
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qugf
=
new
LambdaQueryWrapper
<>();
qugf
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUsex
.
getSequenceNbr
());
PersonnelBusiness
personnelBusinesx
=
personnelBusinessMapper
.
selectOne
(
qugf
);
personnelBusinesx
.
setUserType
(
"1"
);
personnelBusinessMapper
.
updateById
(
personnelBusinesx
);
...
...
@@ -367,9 +359,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
unitInfo
.
setAdminUserName
(
publicAgencyUse
.
getRealName
());
unitInfoMapper
.
updateById
(
unitInfo
);
//修改管理员
List
<
Long
>
roidx
=
JSONArray
.
parseArray
(
publicAgencyUsex
.
getRole
(),
Long
.
class
);
List
<
Long
>
roidx
=
JSONArray
.
parseArray
(
publicAgencyUsex
.
getRole
(),
Long
.
class
);
//修改平台用户
...
...
@@ -377,9 +367,9 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userId
.
add
(
publicAgencyUse
.
getAmosUserId
());
System
.
out
.
println
(
"删除旧管理员===================================:"
+
publicAgencyUsex
.
getAmosUserId
());
System
.
out
.
println
(
"删除旧管理员===================================:"
+
publicAgencyUsex
.
getAmosUserId
());
List
<
String
>
userId1
=
new
ArrayList
<>();
if
(
roidx
!=
null
&&!
roidx
.
isEmpty
()&&
roidx
.
size
()==
1
&&
roidx
.
get
(
0
).
longValue
()==
userGroupId
)
{
if
(
roidx
!=
null
&&
!
roidx
.
isEmpty
()
&&
roidx
.
size
()
==
1
&&
roidx
.
get
(
0
).
longValue
()
==
userGroupId
)
{
//新增空角色防止单位丢失
userId1
.
add
(
publicAgencyUsex
.
getAmosUserId
());
...
...
@@ -387,33 +377,32 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
//删除旧管理员
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupId
,
publicAgencyUsex
.
getAmosUserId
());
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupId
,
publicAgencyUsex
.
getAmosUserId
());
// 1 修改平台用户
Privilege
.
groupUserClient
.
create
(
userGroupId
,
userId
);
System
.
out
.
println
(
"新增角色用户===================================:"
+
userId
);
System
.
out
.
println
(
"新增角色用户===================================:"
+
userId
);
//修改权限
if
(
roidx
==
null
)
{
if
(
roidx
==
null
)
{
publicAgencyUsex
.
setRole
(
null
);
}
else
{
}
else
{
roidx
.
remove
(
userGroupId
);
publicAgencyUsex
.
setRole
(
CollectionUtil
.
isEmpty
(
roidx
)
?
JSON
.
toJSONString
(
Arrays
.
asList
(
userGroupempty
)):
JSON
.
toJSONString
(
roidx
));
publicAgencyUsex
.
setRole
(
CollectionUtil
.
isEmpty
(
roidx
)
?
JSON
.
toJSONString
(
Arrays
.
asList
(
userGroupempty
))
:
JSON
.
toJSONString
(
roidx
));
}
//修改当前用户角色权限
List
<
Long
>
roid
=
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
Long
.
class
);
if
(
roid
==
null
)
{
roid
=
new
ArrayList
<>();
List
<
Long
>
roid
=
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
Long
.
class
);
if
(
roid
==
null
)
{
roid
=
new
ArrayList
<>();
}
roid
.
add
(
userGroupId
);
if
(
roid
.
contains
(
userGroupempty
)){
if
(
roid
.
contains
(
userGroupempty
))
{
roid
.
remove
(
userGroupempty
);
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupempty
,
publicAgencyUsex
.
getAmosUserId
());
Privilege
.
groupUserClient
.
deleteGroupUser
(
userGroupempty
,
publicAgencyUsex
.
getAmosUserId
());
}
publicAgencyUse
.
setRole
(
JSON
.
toJSONString
(
roid
));
...
...
@@ -421,22 +410,19 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
publicAgencyUserMapper
.
updateById
(
publicAgencyUse
);
//旧管理员去除
List
<
String
>
li
=
null
;
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUsex
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
li
=
stdUserEmpower
.
getAmosOrgCode
();
List
<
String
>
li
=
null
;
LambdaQueryWrapper
<
StdUserEmpower
>
uo
=
new
LambdaQueryWrapper
();
uo
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUsex
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
uo
);
li
=
stdUserEmpower
.
getAmosOrgCode
();
if
(
stdUserEmpower
!=
null
)
{
if
(
stdUserEmpower
!=
null
)
{
stdUserEmpower
.
setAmosOrgCode
(
null
);
userEmpowerMapper
.
updateById
(
stdUserEmpower
);
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
}
else
{
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setAmosOrgCode
(
null
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
stdUserEmpower
.
setAmosUserId
(
publicAgencyUsex
.
getAmosUserId
());
...
...
@@ -444,20 +430,18 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
//新管理员新增
LambdaQueryWrapper
<
StdUserEmpower
>
uo1
=
new
LambdaQueryWrapper
();
uo1
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUse
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower1
=
userEmpowerMapper
.
selectOne
(
uo1
);
LambdaQueryWrapper
<
StdUserEmpower
>
uo1
=
new
LambdaQueryWrapper
();
uo1
.
eq
(
StdUserEmpower:
:
getAmosUserId
,
publicAgencyUse
.
getAmosUserId
());
StdUserEmpower
stdUserEmpower1
=
userEmpowerMapper
.
selectOne
(
uo1
);
if
(
stdUserEmpower1
!=
null
)
{
if
(
stdUserEmpower1
!=
null
)
{
stdUserEmpower1
.
setAmosOrgCode
(
li
);
userEmpowerMapper
.
updateById
(
stdUserEmpower1
);
}
else
{
stdUserEmpower1
=
new
StdUserEmpower
();
}
else
{
stdUserEmpower1
=
new
StdUserEmpower
();
stdUserEmpower1
.
setAmosOrgCode
(
li
);
stdUserEmpower1
.
setPermissionType
(
"HYGF"
);
stdUserEmpower1
.
setAmosUserId
(
publicAgencyUse
.
getAmosUserId
());
...
...
@@ -465,14 +449,12 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
UserMessage
userMessage
=
new
UserMessage
(
TaskTypeStationEnum
.
设置管理员
.
getCode
(),
personnelBusines
.
getSequenceNbr
()
,
publicAgencyUse
.
getAmosUserId
(),
new
Date
(),
"您已成为单位管理员。"
,
personnelBusines
.
getAmosUnitOrgCode
());
UserMessage
userMessage
=
new
UserMessage
(
TaskTypeStationEnum
.
设置管理员
.
getCode
(),
personnelBusines
.
getSequenceNbr
(),
publicAgencyUse
.
getAmosUserId
(),
new
Date
(),
"您已成为单位管理员。"
,
personnelBusines
.
getAmosUnitOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"设置失败!"
);
}
...
...
@@ -480,27 +462,27 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Override
public
UserDataDto
getPersonnelBusinessById
(
String
id
)
{
public
UserDataDto
getPersonnelBusinessById
(
String
id
)
{
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PublicAgencyUser
>
qud
=
new
LambdaQueryWrapper
<>();
qud
.
eq
(
PublicAgencyUser:
:
getSequenceNbr
,
id
);
PublicAgencyUser
publicAgencyUse
=
publicAgencyUserMapper
.
selectOne
(
qud
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
LambdaQueryWrapper
<
PersonnelBusiness
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
PersonnelBusiness:
:
getFoundationId
,
publicAgencyUse
.
getSequenceNbr
());
PersonnelBusiness
personnelBusines
=
personnelBusinessMapper
.
selectOne
(
qug
);
UserDataZHDto
userDataZHDto
=
new
UserDataZHDto
();
UserDataJBDto
userDataJBDto
=
new
UserDataJBDto
();
UserDataZZDto
userDataZZDto
=
new
UserDataZZDto
();
UserDataZHDto
userDataZHDto
=
new
UserDataZHDto
();
UserDataJBDto
userDataJBDto
=
new
UserDataJBDto
();
UserDataZZDto
userDataZZDto
=
new
UserDataZZDto
();
userDataZZDto
.
setCertificate
(
personnelBusines
.
getCertificate
()
!=
null
?
JSONArray
.
parseArray
(
personnelBusines
.
getCertificate
(),
JSONObject
.
class
):
null
);
userDataZHDto
.
setRole
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
long
.
class
));
userDataZZDto
.
setCertificate
(
personnelBusines
.
getCertificate
()
!=
null
?
JSONArray
.
parseArray
(
personnelBusines
.
getCertificate
(),
JSONObject
.
class
)
:
null
);
userDataZHDto
.
setRole
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getRole
(),
long
.
class
));
userDataZHDto
.
setUserName
(
publicAgencyUse
.
getAmosUserName
());
BeanUtils
.
copyProperties
(
publicAgencyUse
,
userDataJBDto
);
userDataJBDto
.
setPosition
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getPosition
(),
String
.
class
));
userDataJBDto
.
setRegionalCompaniesSeq
(
personnelBusines
.
getRegionalCompaniesSeq
()
!=
null
?
personnelBusines
.
getRegionalCompaniesSeq
().
toString
():
null
);
BeanUtils
.
copyProperties
(
publicAgencyUse
,
userDataJBDto
);
userDataJBDto
.
setPosition
(
JSONArray
.
parseArray
(
publicAgencyUse
.
getPosition
(),
String
.
class
));
userDataJBDto
.
setRegionalCompaniesSeq
(
personnelBusines
.
getRegionalCompaniesSeq
()
!=
null
?
personnelBusines
.
getRegionalCompaniesSeq
().
toString
()
:
null
);
userDataJBDto
.
setAmosUnitId
(
personnelBusines
.
getAmosUnitId
());
Boolean
hasOperationRecords
=
hasOperationRecords
(
id
);
...
...
@@ -517,17 +499,16 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userDataJBDto
.
setUnallowModify
(
hasOperationRecords
?
"unallow"
:
"allow"
);
}
return
new
UserDataDto
(
userDataZHDto
,
userDataJBDto
,
userDataZZDto
);
return
new
UserDataDto
(
userDataZHDto
,
userDataJBDto
,
userDataZZDto
);
}
/**
* 用户是否有业务操作
*
*
* @param id id
* @return {@link Boolean}
* @author yangyang
* @throws
* @author yangyang
* @date 2024/7/3 16:24
*/
public
Boolean
hasOperationRecords
(
String
id
)
{
...
...
@@ -598,4 +579,44 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
}
@Override
public
Boolean
deleteBySequenceNbrs
(
String
sequenceNbrs
)
{
//根据sequenceNbr查询用户userId
if
(
StringUtils
.
isEmpty
(
sequenceNbrs
))
{
throw
new
BadRequest
(
"入参:sequenceNbrs为空"
);
}
List
<
String
>
sequenceNbrList
=
new
ArrayList
<>();
String
[]
sequenceNbrArray
=
sequenceNbrs
.
split
(
","
);
for
(
String
sequenceNbr
:
sequenceNbrArray
)
{
String
userId
=
personnelBusinessMapper
.
selectUserInfo
(
Long
.
valueOf
(
sequenceNbr
));
//添加校验,如果业务表里面有相关的用户id不能删除
List
<
String
>
tableName
=
personnelBusinessMapper
.
selectHygfTableName
();
if
(
CollectionUtil
.
isNotEmpty
(
tableName
))
{
for
(
String
table
:
tableName
)
{
int
count
=
personnelBusinessMapper
.
countByUserId
(
table
,
userId
);
if
(
count
>
0
)
{
logger
.
error
(
"sequenceNbr:{}对应的用户:{},对应的表:{}有操作记录无法删除"
,
sequenceNbr
,
userId
,
table
);
sequenceNbrList
.
add
(
sequenceNbr
);
return
false
;
}
}
}
try
{
//删除平台表账号
Privilege
.
agencyUserClient
.
multDeleteUser
(
userId
);
personnelBusinessMapper
.
deleteSubByUserId
(
userId
);
//删除hygf_personnel_business表中数据
personnelBusinessMapper
.
deleteHpbByFoundationId
(
Long
.
valueOf
(
sequenceNbr
));
//删除std_user_empower表中数据
personnelBusinessMapper
.
deleteSueByUserId
(
userId
);
return
null
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"sequenceNbr:{}对应删除失败"
,
sequenceNbr
);
sequenceNbrList
.
add
(
sequenceNbr
);
}
}
return
true
;
}
}
\ 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 @
595eb981
...
...
@@ -21,7 +21,6 @@ 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.commons.lang3.BooleanUtils
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PreparationMoneyServiceImpl.java
View file @
595eb981
...
...
@@ -34,7 +34,6 @@ 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.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -916,7 +915,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
@
Global
Transactional
@Transactional
public
void
uploadVoucher
(
PreparationMoney
model
,
String
instanceId
,
String
isSubmit
)
{
//经销商暂存则只更新发货单属性 不进行业务推动
if
(
"1"
.
equals
(
isSubmit
))
{
...
...
@@ -1033,7 +1032,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
@
Global
Transactional
@Transactional
public
void
replenishmentRollback
(
Long
sequenceNbr
)
{
LambdaQueryWrapper
<
HygfPreparationMoneyAuditing
>
lambda
=
new
LambdaQueryWrapper
();
lambda
.
eq
(
HygfPreparationMoneyAuditing:
:
getPreparationMoneyId
,
sequenceNbr
);
...
...
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 @
595eb981
...
...
@@ -25,7 +25,6 @@ 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.BooleanUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -149,7 +148,7 @@ public class SurveyInformationServiceImpl
return
this
.
queryForList
(
""
,
false
);
}
@
Global
Transactional
@Transactional
public
SurveyInfoAllDto
saveSurveyInfo
(
SurveyInfoAllDto
surveyInfoAllDto
,
String
operationType
)
{
String
lockName
=
null
;
try
{
...
...
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 @
595eb981
...
...
@@ -7,7 +7,6 @@ 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 @
595eb981
...
...
@@ -119,7 +119,7 @@ spring.security.user.password=a1234560
fire-rescue
=
123
mybatis-plus.global-config.db-config.
update-strategy
=
ignored
mybatis-plus.global-config.db-config.
field-strategy
=
IGNORED
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key
=
qaz
...
...
@@ -246,9 +246,3 @@ spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
123456
spring.elasticsearch.rest.read-timeout
=
30000
## 47环境 排除es报错引进无用配置 业务未实际使用es
spring.elasticsearch.rest.uris
=
http://47.92.234.253:9200
spring.elasticsearch.rest.connection-timeout
=
30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
123456
spring.elasticsearch.rest.read-timeout
=
30000
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-kingbase8.properties
View file @
595eb981
## DB properties:
spring.datasource.dynamic.primary
=
mysql-service
spring.datasource.mysql-service.driver-class-name
=
com.kingbase8.Driver
spring.datasource.mysql-service.jdbc-url
=
jdbc:kingbase8://10.20.1.176:54321/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8¤tSchema=root
#spring.datasource.mysql-service.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.mysql-service.jdbc-url=jdbc:mysql://47.92.234.253:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username
=
root
spring.datasource.mysql-service.password
=
Yeejoin@2020
spring.datasource.mysql-service.type
=
com.zaxxer.hikari.HikariDataSource
...
...
@@ -50,11 +52,11 @@ spring.datasource.tdengine-service.connection-test-query: SELECT 1
## eureka properties:
eureka.instance.hostname
=
10.20.1.160
eureka.instance.hostname
=
47.92.234.253
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database
=
1
spring.redis.host
=
10.20.1.210
spring.redis.host
=
47.92.234.253
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
...
...
@@ -90,7 +92,7 @@ lettuce.timeout=10000
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://
10.20.1.210
:2883
emqx.broker
=
tcp://
47.92.234.253
:2883
emqx.user-name
=
admin
emqx.password
=
public
emqx.max-inflight
=
1000
...
...
@@ -125,7 +127,7 @@ amos.secret.key=qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url
=
tcp://
10.20.1.210
:61616
spring.activemq.broker-url
=
tcp://
47.92.234.253
:61616
spring.activemq.user
=
admin
spring.activemq.password
=
admin
spring.jms.pub-sub-domain
=
false
...
...
@@ -231,12 +233,18 @@ dealer.amosDealerId=1767820997374775298
#Seata Config
seata.tx-service-group
=
hygf-seata
seata.service.grouplist.hygf-seata
=
47.92.234.253
:8091
seata.service.grouplist.hygf-seata
=
172.16.0.29
: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
=
postgresql
\ No newline at end of file
## 47环境 排除es报错引进无用配置 业务未实际使用es
spring.elasticsearch.rest.uris
=
http://47.92.234.253:9200
spring.elasticsearch.rest.connection-timeout
=
30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
123456
spring.elasticsearch.rest.read-timeout
=
30000
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application.properties
View file @
595eb981
...
...
@@ -2,7 +2,7 @@ spring.application.name=AMOS-HYGF-CZ
server.servlet.context-path
=
/hygf
server.port
=
33330
server.uri-encoding
=
UTF-8
spring.profiles.active
=
dev
spring.profiles.active
=
kingbase8
spring.jackson.time-zone
=
GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
logging.config
=
classpath:logback-${spring.profiles.active}.xml
...
...
@@ -56,7 +56,7 @@ 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
-CZ
workflow.feign.name
=
AMOS-API-WORKFLOW
feign.okhttp.enabled
=
true
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/logback-dev.xml
View file @
595eb981
...
...
@@ -28,16 +28,16 @@
</encoder>
</appender>
<!--myibatis log configure-->
<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
"
/>
<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
"
/>
<!-- 日志输出级别 -->
<root
level=
"
INFO
"
>
<root
level=
"
DEBUG
"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/logback-kingbase8.xml
View file @
595eb981
...
...
@@ -37,7 +37,7 @@
<logger
name=
"org.typroject"
level=
"DEBUG"
/>
<logger
name=
"com.yeejoin"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"
INFO
"
>
<root
level=
"
DEBUG
"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
595eb981
...
...
@@ -193,7 +193,7 @@ public class TDBigScreenAnalyseController extends BaseController {
String
finalStationCode
=
stationCode
;
// List<String> dateList = dateInfoBy15.stream().map(i -> i.get("date")).collect(Collectors.toList());
String
finalAreaCode
=
areaCode
;
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)
||
analysisType
==
null
))
{
if
((
WarningPeriodEnum
.
DAY
.
getName
().
equals
(
analysisType
)))
{
List
<
String
>
fullDateList
=
dateList
.
stream
().
map
(
s
->
{
return
s
+
" 00:00:00"
;
}).
collect
(
Collectors
.
toList
());
...
...
@@ -215,7 +215,7 @@ public class TDBigScreenAnalyseController extends BaseController {
String
value
=
map
.
get
(
date
)
!=
null
?
String
.
valueOf
(
map
.
get
(
date
))
:
"100"
;
valueList
.
add
(
String
.
valueOf
(
Math
.
round
(
Double
.
valueOf
(
value
)
*
10.0
)
/
10.0
));
}
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
))
{
}
else
if
(
WarningPeriodEnum
.
MINUTES
.
getName
().
equals
(
analysisType
)
||
analysisType
==
null
)
{
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getInfoByMoment
(
finalAreaCode
,
finalStationCode
,
dateList
);
Map
<
String
,
Object
>
map
=
healthListInfo
.
stream
().
collect
(
Collectors
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
595eb981
...
...
@@ -129,9 +129,10 @@
FROM
${tableName}
<where>
ANALYSIS_TYPE = '按
天
'
ANALYSIS_TYPE = '按
10分钟
'
<!-- AND DATE_ADD(DATE_FORMAT( REC_DATE, '%Y-%m-%d' ),INTERVAL 1 DAY) = CURRENT_DATE-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!-- AND CURRENT_DATE = get_time_add(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"stationCode != null and stationCode != ''"
>
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
...
...
@@ -246,9 +247,10 @@
ARAE
FROM fan_health_index_latest_data
WHERE ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
GROUP BY ARAE
UNION ALL
(
...
...
@@ -256,17 +258,18 @@
ARAE
FROM pv_health_index_latest_data
WHERE ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_TYPE = '按天
'
AND ANALYSIS_TYPE = '按10分钟
'
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
GROUP BY ARAE
)
) a
GROUP BY a.ARAE
</select>
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"java.util.Map"
>
SELECT a.*
FROM (
) a
GROUP BY a.ARAE
</select>
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"java.util.Map"
>
SELECT a.*
FROM (
SELECT STATION AS station,
WARNING_NAME AS warningName,
count(1) AS num,
...
...
@@ -318,9 +321,10 @@
fan_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
</if>
...
...
@@ -335,9 +339,10 @@
pv_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
</if>
...
...
@@ -491,9 +496,10 @@
fan_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '子系统'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if>
...
...
@@ -529,7 +535,7 @@
fan_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '设备'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<if
test=
"gatewayId != null and gatewayId != ''"
>
...
...
@@ -588,7 +594,7 @@
fan_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE= '测点'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
AND POINT_NAME IS NOT NULL
AND POINT_NAME != ''
<if
test=
"subSystem != null and subSystem != ''"
>
...
...
@@ -648,7 +654,7 @@
pv_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '子阵'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<if
test=
"gatewayId != null and gatewayId != ''"
>
...
...
@@ -666,9 +672,10 @@
pv_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '设备'
AND ANALYSIS_TYPE = '按
天
'
AND ANALYSIS_TYPE = '按
10分钟
'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"subarray != null and subarray != ''"
>
AND SUBARRAY = concat('#', #{subarray})
</if>
...
...
@@ -677,8 +684,8 @@
</if>
</where>
group by EQUIPMENT_NAME
</select>
<select
id=
"getPvSumSystemListByEquipment"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getPvSumSystemListByEquipment"
resultType=
"java.util.Map"
>
SELECT
EQUIPMENT_NAME as equipmentName
FROM
...
...
@@ -696,8 +703,8 @@
</where>
GROUP BY
EQUIPMENT_NAME
</select>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
SELECT
IFNULL(HEALTH_INDEX, 100) AS healthIndex,
POINT_NAME AS pointName
...
...
@@ -705,7 +712,7 @@
pv_health_index_latest_data
<where>
ANALYSIS_OBJ_TYPE = '测点'
AND ANALYSIS_TYPE = '按天
'
AND ANALYSIS_TYPE = '按10分钟
'
AND POINT_NAME IS NOT NULL
AND POINT_NAME != ''
<if
test=
"equipmentName != null and equipmentName != ''"
>
...
...
@@ -717,8 +724,8 @@
</where>
GROUP BY
POINT_NAME
</select>
<select
id=
"getPvWarningInfoBySubSystem"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getPvWarningInfoBySubSystem"
resultType=
"java.util.Map"
>
SELECT
POINT_NAME as pointName,
WARNING_NAME as warningName
...
...
@@ -737,8 +744,8 @@
POINT_NAME
ORDER BY
WARNING_NAME ASC
</select>
<select
id=
"getPvPointNameListBySumSystem"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getPvPointNameListBySumSystem"
resultType=
"java.util.Map"
>
SELECT
POINT_NAME as pointName,
INDEX_ADDRESS as indexAddress,
...
...
@@ -756,8 +763,8 @@
</where>
GROUP BY
POINT_NAME
</select>
<select
id=
"getPointNameByIndexAddress"
resultType=
"java.lang.String"
>
</select>
<select
id=
"getPointNameByIndexAddress"
resultType=
"java.lang.String"
>
select POINT_NAME
from ${tableName}
where INDEX_ADDRESS = #{varDesc}
...
...
@@ -765,8 +772,8 @@
limit 1
</select>
<select
id=
"getFullViewRecall"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO"
>
</select>
<select
id=
"getFullViewRecall"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO"
>
SELECT a.*,
row_number() over ( ORDER BY pointName ) AS id
FROM (
...
...
@@ -815,8 +822,8 @@
)
) a
ORDER BY a.station ASC, a.equipmentName ASC, a.equipmentName asc, a.subSystem asc
</select>
<select
id=
"getStationIndexInfo"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getStationIndexInfo"
resultType=
"java.util.Map"
>
SELECT a.STATION AS station,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
FROM (
...
...
@@ -839,8 +846,8 @@
)
) a
GROUP BY a.STATION
</select>
<select
id=
"getEquipmentIndexInfo"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getEquipmentIndexInfo"
resultType=
"java.util.Map"
>
SELECT a.equipmentName AS equipmentName,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
FROM (
...
...
@@ -866,8 +873,8 @@
and equipmentName != ''
GROUP BY
a.equipmentName
</select>
<select
id=
"getSubSystemIndexInfo"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getSubSystemIndexInfo"
resultType=
"java.util.Map"
>
SELECT a.subSystem AS subSystem,
ROUND(avg(a.avgHealthIndex), 2) AS healthIndex
...
...
@@ -895,8 +902,8 @@
GROUP BY
a.subSystem
</select>
<select
id=
"getPointNameIndexInfo"
resultType=
"java.util.Map"
>
</select>
<select
id=
"getPointNameIndexInfo"
resultType=
"java.util.Map"
>
SELECT IFNULL(MAX(HEALTH_INDEX), 100) AS healthIndex,
concat(MAX(STATION), '_', INDEX_ADDRESS) as gatewayIndexAddress
...
...
@@ -915,8 +922,8 @@
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE
GROUP BY INDEX_ADDRESS
)
</select>
<select
id=
"getHealthLevelInfoList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel"
>
</select>
<select
id=
"getHealthLevelInfoList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthLevel"
>
SELECT CONCAT(`STATUS`, '_', ANALYSIS_OBJ_TYPE) AS analysisObjType,
HEALTH_LEVEL AS healthLevel,
GROUP_LOWER_LIMIT AS groupLowerLimit,
...
...
@@ -942,14 +949,14 @@
#{item}
</foreach>
</if>
</select>
<select
id=
"getAddressInfo"
resultType=
"java.lang.String"
>
</select>
<select
id=
"getAddressInfo"
resultType=
"java.lang.String"
>
select index_address
from wl_equipment_specific_index
where gateway_id = '1668801435891929089'
and data_type = 'analog' limit 100
</select>
<select
id=
"queryForLeftTableList"
resultType=
"map"
>
</select>
<select
id=
"queryForLeftTableList"
resultType=
"map"
>
SELECT
b.*,
IFNULL(CAST(HEALTH_INDEX AS UNSIGNED), 100 ) as HEALTH_INDEX ,
...
...
@@ -989,8 +996,8 @@
</where>
order by HEALTH_INDEX ASC
limit ${current},${size}
</select>
<select
id=
"queryForLeftTableListCount"
resultType=
"int"
>
</select>
<select
id=
"queryForLeftTableListCount"
resultType=
"int"
>
SELECT
count(1)
FROM
...
...
@@ -1021,8 +1028,8 @@
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
<select
id=
"queryForLeftTableListNum"
resultType=
"map"
>
</select>
<select
id=
"queryForLeftTableListNum"
resultType=
"map"
>
SELECT
CAST(ibfhi.HEALTH_INDEX AS UNSIGNED) as value
...
...
@@ -1054,8 +1061,8 @@
AND b.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
</where>
</select>
<select
id=
"queryForLeftTableListByPoint"
resultType=
"map"
>
</select>
<select
id=
"queryForLeftTableListByPoint"
resultType=
"map"
>
SELECT
b.*
FROM
...
...
@@ -1703,9 +1710,10 @@
FROM
fan_health_index_latest_data
<where>
ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY') -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
...
...
@@ -1725,9 +1733,10 @@
FROM
pv_health_index_latest_data
<where>
ANALYSIS_TYPE = '按天
'
ANALYSIS_TYPE = '按10分钟
'
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
...
...
@@ -1739,49 +1748,49 @@
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
</where>
)
) a
</select>
<!--<select id="getDateInfoBy15" resultType="java.util.Map">
SELECT
</where>
)
) a
</select>
<!--<select id="getDateInfoBy15" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
WHERE
DATEDIFF( CURDATE() - INTERVAL 1 DAY, DATE( DATE_ADD( CURDATE() - INTERVAL 1 DAY, INTERVAL - 15 DAY )) ) >= @s
</select>
<select id="getDateInfo" resultType="java.util.Map">
SELECT
</select>
<select id="getDateInfo" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
WHERE
DATEDIFF( #{endTime}, DATE( DATE_ADD( #{endTime}, INTERVAL - DATEDIFF( #{endTime}, #{startTime})-1 DAY )) ) >= @s
</select>
<select id="getHourInfo" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
</select>
<select id="getMomentInfo" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
</select>
<select id="getHourInfo" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
</select>
<select id="getMomentInfo" resultType="java.util.Map">
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
</select>-->
<select
id=
"getHealthIndexByIndexAddress"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/config/BitTypeHandler.java
0 → 100644
View file @
595eb981
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
config
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
org.apache.ibatis.type.BaseTypeHandler
;
import
org.apache.ibatis.type.JdbcType
;
import
org.apache.ibatis.type.MappedJdbcTypes
;
@MappedJdbcTypes
(
JdbcType
.
BIT
)
public
class
BitTypeHandler
extends
BaseTypeHandler
<
Boolean
>
{
@Override
public
void
setNonNullParameter
(
PreparedStatement
ps
,
int
i
,
Boolean
parameter
,
JdbcType
jdbcType
)
throws
SQLException
{
//原生的boolean会再sql上加上引号比如'0'或者'1',人大金仓不支持,支持不带引号的
//ps.setBoolean(i, parameter);
ps
.
setInt
(
i
,
parameter
?
1
:
0
);
}
@Override
public
Boolean
getNullableResult
(
ResultSet
rs
,
String
columnName
)
throws
SQLException
{
return
rs
.
getBoolean
(
columnName
);
}
@Override
public
Boolean
getNullableResult
(
ResultSet
rs
,
int
columnIndex
)
throws
SQLException
{
return
rs
.
getBoolean
(
columnIndex
);
}
@Override
public
Boolean
getNullableResult
(
java
.
sql
.
CallableStatement
cs
,
int
columnIndex
)
throws
SQLException
{
return
cs
.
getBoolean
(
columnIndex
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/resources/application-kingbase8.properties
View file @
595eb981
...
...
@@ -4,33 +4,33 @@ spring.db1.datasource.type: com.alibaba.druid.pool.DruidDataSource
spring.db1.datasource.url
=
jdbc:kingbase8://10.20.1.176:54321/production?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8¤tSchema=root
spring.db1.datasource.username
=
root
spring.db1.datasource.password
=
Yeejoin@2020
spring.db1.datasource.driver-class-name
:
com.kingbase8.Driver
spring.db1.datasource.driver-class-name
=
com.kingbase8.Driver
## db2-sync_data
spring.db2.datasource.type
:
com.alibaba.druid.pool.DruidDataSource
spring.db2.datasource.url
=
jdbc:kingbase8://10.20.1.176:54321/jxiop_sync_data?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8¤tSchema=root
spring.db2.datasource.username
=
root
spring.db2.datasource.password
=
Yeejoin@2020
spring.db2.datasource.driver-class-name
:
com.kingbase8.Driver
##db3
spring.db3.datasource.url
=
jdbc:TAOS-RS://10.20.1.157:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db2.datasource.driver-class-name
=
com.kingbase8.Driver
spring.db3.datasource.url
=
jdbc:TAOS-RS://10.20.0.203:6041/iot_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db3.datasource.username
=
root
spring.db3.datasource.password
=
taosdata
spring.db3.datasource.driver-class-name
:
com.taosdata.jdbc.rs.RestfulDriver
##db4
spring.db4.datasource.url
=
jdbc:TAOS-RS://10.20.
1.157:6041/iot
_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db4.datasource.url
=
jdbc:TAOS-RS://10.20.
0.203:6041/analysis
_data?user=root&password=taosdata&timezone=GMT%2b8&allowMultiQueries=true
spring.db4.datasource.username
=
root
spring.db4.datasource.password
=
taosdata
spring.db4.datasource.driver-class-name
:
com.taosdata.jdbc.rs.RestfulDriver
# kingbase8 backquote not support
mybatis-plus.global-config.db-config.table-field-strategy
=
ignore
## eureka properties:
eureka.instance.hostname
=
10.20.1.160
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
#eureka.instance.hostname=139.9.173.44
eureka.instance.prefer-ip-address
=
true
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@47.92.234.253:10001/eureka/
## redis properties:
spring.redis.database
=
1
spring.redis.host
=
10.20.1.210
spring.redis.host
=
47.92.234.253
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
...
...
@@ -65,17 +65,18 @@ lettuce.timeout=10000
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://10.20.1.210:2883
emqx.client-id
=
AMOS-JXIOP-BIGSCREEN
emqx.client-user-name
=
emqx.client-password
=
emqx.broker
=
tcp://47.92.234.253:2883
emqx.user-name
=
admin
emqx.password
=
public
mqtt.scene.host
=
mqtt://
10.20.1.210
:8083/mqtt
mqtt.scene.host
=
mqtt://
47.92.234.253
:8083/mqtt
mqtt.client.product.id
=
mqtt
mqtt.topic
=
topic_mqtt
spring.mqtt.completionTimeout
=
3000
emqx.max-inflight
=
1000
emqx.client-user-name
=
admin
emqx.client-password
=
public
## influxDB
#spring.influx.url= http://172.16.3.155:18186
...
...
@@ -98,7 +99,8 @@ emqx.client-password=public
#spring.influx.bufferLimit=20000
#spring.influx.url=http://10.20.1.157:18086
# influxDB
#spring.influx.url= http://192.168.120.102:18086
#spring.influx.password=Yeejoin@2020
#spring.influx.user=root
#spring.influx.database=iot_platform
...
...
@@ -128,28 +130,19 @@ amos.secret.key=qaz
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url
=
tcp://
10.20.1.210
:61616
spring.activemq.broker-url
=
tcp://
47.92.234.253
:61616
spring.activemq.user
=
admin
spring.activemq.password
=
admin
spring.jms.pub-sub-domain
=
false
myqueue
=
amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
spring.elasticsearch.rest.uris
=
http://10.20.0.223:9200
spring.elasticsearch.rest.connection-timeout
=
30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
Yeejoin@2020
spring.elasticsearch.rest.read-timeout
=
30000
# ?????????
fan.statuts.stattuspath
=
upload/jxiop/device_status
pictureUrl
=
upload/jxiop/syz/
# Ԥ
idx.predict.serviceUrl
=
http://10.20.1.157:8095/jxdj/predict-data
large.cron
=
0 0/5 * * * ?
forecast.url
=
logic
=
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/resources/application.properties
View file @
595eb981
...
...
@@ -2,7 +2,7 @@ spring.application.name=AMOS-JXIOP-BIGSCREEN-CZ
server.servlet.context-path
=
/jxiop-bigscreen
server.port
=
33300
server.uri-encoding
=
UTF-8
spring.profiles.active
=
dev1
spring.profiles.active
=
kingbase8
spring.jackson.time-zone
=
GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
logging.config
=
classpath:logback-${spring.profiles.active}.xml
...
...
@@ -75,11 +75,7 @@ station.section=10
gl.sum.column
=
日发电量,月发电量,年发电量
gl.avg.column
=
有功功率,日利用小时,瞬时风速
spring.elasticsearch.rest.uris
=
http://139.9.173.44:9200
spring.elasticsearch.rest.connection-timeout
=
30000
spring.elasticsearch.rest.username
=
elastic
spring.elasticsearch.rest.password
=
Yeejoin@2020
spring.elasticsearch.rest.read-timeout
=
30000
daily.power.generation.cron
=
0 0/1 * * * ?
moon.power.generation.cron
=
0 0/1 * * * ?
...
...
pom.xml
View file @
595eb981
...
...
@@ -329,10 +329,10 @@
<module>
amos-boot-biz-common
</module>
<module>
amos-boot-core
</module>
<module>
amos-boot-data
</module>
<module>
amos-boot-module
</module
>
<module>
amos-boot-system-ccs
</module
>
<module>
amos-boot-system-jcs
</module
>
<module>
amos-boot-system-equip
</module
>
<!-- <module>amos-boot-module</module>--
>
<!-- <module>amos-boot-system-ccs</module>--
>
<!-- <module>amos-boot-system-jcs</module>--
>
<!-- <module>amos-boot-system-equip</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