@@ -70,7 +70,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
private final SupvProblemMapper supvProblemMapper ;
private final SupvFileMapper supvFileMapper ;
private final I SupvFileService supvFileService ;
private final SupvReportMMapper supvReportMMapper ;
@@ -91,7 +91,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
@Value ( " ${gw.url} " )
private String gwUrl ;
@Value ( " ${gw.code} " )
private String code ;
@Override
public String pushPlan ( List < String > planIds ) {
@@ -227,7 +229,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
List < PlanVO > planVOS = BeanUtil . copyToList ( supvPlanList , PlanVO . class ) ;
SendParam param = new SendParam ( ) ;
param . setStats ( planVOS ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 接收电能质量技术监督工作计划数据接口数据: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 1 ) , " pqPlanCreate " ) ;
@@ -288,7 +290,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
if ( mapRe . containsKey ( supvProblem . getRectificationMeasure ( ) ) ) {
supvProblem . setRectificationMeasure ( String . format ( " %02d " , mapRe . get ( supvProblem . getRectificationMeasure ( ) ) . getAlgoDescribe ( ) ) ) ;
}
supvProblem . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
supvProblem . setProvinceId ( code ) ;
}
if ( supvProblemList . size ( ) > 100 ) {
@@ -301,7 +303,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
SendParam param = new SendParam ( ) ;
param . setStats ( list ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 删除电能质量技术监督工作计划接口数据: " + s + " 结束----! " ) ;
Map < String , String > send ;
@@ -340,11 +342,11 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
}
@Override
public String pushFile ( List < String > busIds ) throws IOException {
public String pushFile ( List < String > busIds ) {
StringBuilder stringBuilder = new StringBuilder ( ) ;
LambdaQueryWrapper < SupvFile > lambdaQueryWrapper = new LambdaQueryWrapper < > ( ) ;
lambdaQueryWrapper . in ( SupvFile : : getBusiId , busIds ) ;
List < SupvFile > supvFiles = supvFileMapper . selectL ist ( lambdaQueryWrapper ) ;
List < SupvFile > supvFiles = supvFileService . l ist ( lambdaQueryWrapper ) ;
if ( supvFiles . size ( ) > 100 ) {
throw new BusinessException ( " 一次最多上送100条数据 " ) ;
}
@@ -356,7 +358,6 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
DictData dictData ;
//TODO 调用上送接口
for ( int i = 0 ; i < supvFiles . size ( ) ; i + + ) {
if ( mapFile . containsKey ( supvFiles . get ( i ) . getAttachmentType ( ) ) ) {
dictData = mapFile . get ( supvFiles . get ( i ) . getAttachmentType ( ) ) ;
supvFiles . get ( i ) . setAttachmentType ( dictData . getValue ( ) ) ;
@@ -364,9 +365,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
stringBuilder . append ( " 第 " + i + " 次操作失败: 请检查上送附件类型是否正确 " ) ;
continue ;
}
// Map<String, String> sendFile = sendFile(getUrl(4), supvFiles.get(i));
Map < String , String > sendFile = new HashMap < > ( ) ;
Map < String , String > sendFile = sendFile ( getUrl ( 4 ) , supvFiles . get ( i ) ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 总部提供附件接收接口,省公司调用此接口,完成附件上报响应结果: " + sendFile + " 结束----! " ) ;
if ( sendFile . containsKey ( " succeed " ) ) {
String succeed = sendFile . get ( " succeed " ) ;
@@ -376,6 +375,10 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
Map map = JSON . parseObject ( succeed , Map . class ) ;
String status = map . get ( " status " ) . toString ( ) ;
if ( " 000000 " . equals ( status ) ) {
supvFileService . update ( new LambdaUpdateWrapper < SupvFile > ( )
. eq ( SupvFile : : getUuid , supvFiles . get ( i ) . getUuid ( ) )
. set ( SupvFile : : getIsUploadHead , 1 )
) ;
String result = map . get ( " result " ) . toString ( ) ;
Map mapCount = JSON . parseObject ( result , Map . class ) ;
String count = mapCount . get ( " count " ) . toString ( ) ;
@@ -403,7 +406,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
//TODO 调用上送接口
SendParam param = new SendParam ( ) ;
param . setStats ( supvReportMList ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 取消电能质量技术监督工作计划接口数据: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 5 ) , " pqMonthReportCreate " ) ;
@@ -454,7 +457,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
//TODO
SendParam param = new SendParam ( ) ;
param . setStats ( supvPlanList ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 删除电能质量技术监督工作计划接口数据: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 6 ) , " pqPlanDelete " ) ;
@@ -504,7 +507,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
List < PlanHisVO > list = BeanUtil . copyToList ( supvPlanHis , PlanHisVO . class ) ;
SendParam param = new SendParam ( ) ;
param . setStats ( list ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 预告警单数据接口: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 7 ) , " pqPlanCreateHis " ) ;
@@ -568,7 +571,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
List < AlarmVO > list = BeanUtil . copyToList ( supvAlarms , AlarmVO . class ) ;
SendParam param = new SendParam ( ) ;
param . setStats ( list ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 工作计划变更历史数据接口: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 8 ) , " pqAlarmCreate " ) ;
@@ -609,7 +612,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
List < AlarmBackVO > list = BeanUtil . copyToList ( supvAlarmBacks , AlarmBackVO . class ) ;
SendParam param = new SendParam ( ) ;
param . setStats ( list ) ;
param . setProvinceId ( " 13B9B47F1E483324E05338297A0A0595 " ) ;
param . setProvinceId ( code ) ;
String s = JSONObject . toJSONStringWithDateFormat ( param , JSON . DEFFAULT_DATE_FORMAT ) ;
log . info ( Thread . currentThread ( ) . getName ( ) + " 获取返回体 工作计划变更历史数据接口: " + s + " 结束----! " ) ;
Map < String , String > send = send ( param , getUrl ( 9 ) , " pqAlarmBackCreate " ) ;
@@ -709,7 +712,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
return token ;
}
public Map < String , String > sendFile ( String url , SupvFile supvFile ) throws IOException {
public Map < String , String > sendFile ( String url , SupvFile supvFile ) {
String path = supvFile . getFileUrl ( ) ;
if ( StrUtil . isBlank ( path ) ) {
throw new BusinessException ( " 获取文件上传路径为空!请检查原始路径是否存在 " ) ;
@@ -752,7 +755,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
// 设置form请求参数
builder . putParamsMap ( " uuid " , supvFile . getFileUrl ( ) )
. putParamsMap ( " attachmentName " , supvFile . getAttachmentName ( ) )
. putParamsMap ( " provinceId " , " 13B9B47F1E483324E05338297A0A0595 " )
. putParamsMap ( " provinceId " , code )
. putParamsMap ( " attachmentType " , supvFile . getAttachmentType ( ) )
. putParamsMap ( " busiId " , supvFile . getBusiId ( ) )
. putParamsMap ( " uploaderName " , supvFile . getUploaderName ( ) )