@ -17,6 +17,7 @@ import com.nm.gsgl.common.utils.HttpSendUtil;
import com.nm.gsgl.common.utils.MD5Util ;
import com.nm.gsgl.common.utils.NetUtils ;
import com.nm.gsgl.common.utils.PathUtil ;
import com.nm.gsgl.common.utils.PropertiesUtil ;
import com.nm.gsgl.common.utils.UuidUtil ;
import com.nm.gsgl.common.utils.ZLibUtils ;
import com.nm.gsgl.entity.CmsDataSynchro ;
@ -314,12 +315,21 @@ public class ManualIssueServiceImpl implements ManualIssueService {
log . info ( "[uuid:{}]-开始手动下发最小费额文件" , uuid ) ;
CmsParameter cmsParameter = cmsParameterMapper . selectById ( Constant . INT_59 ) ;
Integer paraId = cmsParameter . getParaId ( ) ;
//文件类型
String paraName = cmsParameter . getParaName ( ) ;
//查询当前最新版本号
String verNo = cmsParameter . getQgCsVerNo ( ) ;
String isDocker = PropertiesUtil . getValue ( "isDocker" ) ;
//分中心WEB地址
String ip ;
if ( Constant . STR_ONE . equals ( isDocker ) ) {
ip = PropertiesUtil . getValue ( "server.ip" ) ;
} else {
ip = PathUtil . hostAddress ;
}
if ( list ! = null & & list . size ( ) > 0 ) {
for ( SetUpTable setUpTable : list ) {
//文件类型
String paraName = cmsParameter . getParaName ( ) ;
if ( StringUtils . isNotBlank ( setUpTable . getPORTIP ( ) ) ) {
//路段号
Integer roadNo = setUpTable . getROADNO ( ) ;
@ -337,8 +347,8 @@ public class ManualIssueServiceImpl implements ManualIssueService {
if ( FileUtil . fileExists ( DownloadPath + File . separator + fileName ) ) {
//是否压缩
int isZlib = 1 ;
// 分中心WEB地址
String ip = PathUtil . hostAddress ;
// // 分中心WEB地址
//String ip = PathUtil.hostAddress;
//String ip = "8.142.95.188";
log . info ( "[uuid:{}]-下发程序ip: {},端口号:{}" , uuid , ip , tomcatPort ) ;
//ALLROADMINFEE#站编码.SQB, 0.28, 0.29需要,普通的车道应该还是不带站编码
@ -348,7 +358,7 @@ public class ManualIssueServiceImpl implements ManualIssueService {
if ( paraName . contains ( "#" ) ) {
paraName = paraName . split ( "#" ) [ 0 ] + "#" + roadNo + "#" + staNo + Constant . STR_SQB ;
} else {
paraName = paraName . replace ( Constant . STR_SQB , " #" + roadNo + "# " + staNo + Constant . STR_SQB ) ;
paraName = paraName . replace ( Constant . STR_SQB , " _" + roadNo + "_ " + staNo + Constant . STR_SQB ) ;
}
//下载文件地址
@ -431,6 +441,14 @@ public class ManualIssueServiceImpl implements ManualIssueService {
} else {
String isDocker = PropertiesUtil . getValue ( "isDocker" ) ;
//分中心WEB地址
String ip ;
if ( Constant . STR_ONE . equals ( isDocker ) ) {
ip = PropertiesUtil . getValue ( "server.ip" ) ;
} else {
ip = PathUtil . hostAddress ;
}
if ( list ! = null & & list . size ( ) > 0 ) {
for ( SetUpTable setUpTable : list ) {
if ( StringUtils . isNotBlank ( setUpTable . getPORTIP ( ) ) ) {
@ -444,8 +462,8 @@ public class ManualIssueServiceImpl implements ManualIssueService {
if ( FileUtil . fileExists ( DownloadPath + File . separator + fileName ) ) {
//是否压缩
int isZlib = 1 ;
// 分中心WEB地址
String ip = PathUtil . hostAddress ;
// // 分中心WEB地址
//String ip = PathUtil.hostAddress;
//String ip = "8.142.95.188";
//String ip = "192.168.10.219";
log . info ( "[uuid:{}]-下发程序ip: {},端口号:{}" , uuid , ip , tomcatPort ) ;
@ -509,8 +527,14 @@ public class ManualIssueServiceImpl implements ManualIssueService {
//是否压缩
int isZlib = 1 ;
Date now = new Date ( ) ;
String isDocker = PropertiesUtil . getValue ( "isDocker" ) ;
//分中心WEB地址
String ip = PathUtil . hostAddress ;
String ip ;
if ( Constant . STR_ONE . equals ( isDocker ) ) {
ip = PropertiesUtil . getValue ( "server.ip" ) ;
} else {
ip = PathUtil . hostAddress ;
}
//String ip = "8.142.95.188";
//版本号
String version = DateTimeUtil . getFormateString ( now , Constant . YYYYMMDDHHMMSS ) ;
@ -529,6 +553,8 @@ public class ManualIssueServiceImpl implements ManualIssueService {
sqlStr = cmsParameter . getSqlStr ( ) ;
} else if ( Constant . STR_TWO . equals ( DBType ) ) {
sqlStr = cmsParameter . getOraStr ( ) ;
} else if ( Constant . STR_FOUR . equals ( DBType ) ) {
sqlStr = cmsParameter . getOraStr ( ) ;
}
String newName = fileName . replace ( Constant . STR_DBF , Constant . STR_ ) + version + Constant . STR_ZLIB ;
if ( StringUtils . isNotBlank ( sqlStr ) & & paraId ! = 2 ) {
@ -560,6 +586,10 @@ public class ManualIssueServiceImpl implements ManualIssueService {
Integer staNo = setUpTable . getSTANO ( ) ;
//paraId=2需要路段号和站编号( 下发时根据路段号和站编号做替换)
if ( paraId = = 2 ) {
Date now2 = new Date ( ) ;
version = DateTimeUtil . getFormateString ( now2 , Constant . MMDDHHMMSSSSS ) ;
newName = fileName . replace ( Constant . STR_DBF , Constant . STR_ ) + version + Constant . STR_ZLIB ;
String newFileName = fileName . replace ( Constant . STR_DBF , Constant . STR_ ) + version + Constant . STR_DBF ;
sqlStr = sqlStr . replace ( "%ROADNO%" , String . valueOf ( roadNo ) ) . replace ( "%STANO%" , String . valueOf ( staNo ) ) ;
List < Map < String , Object > > mapList = sysMapper . selectList ( sqlStr ) ;
CreateDbfUtil . createDbfFile ( uuid , paraId , fileName , mapList , DownloadPath ) ;
@ -633,15 +663,15 @@ public class ManualIssueServiceImpl implements ManualIssueService {
} ) ;
Optional < ServerInfo > serverInfoOptional = serverInfos . stream ( ) . filter ( item - > item . getNAME ( ) . equals ( PathUtil . webName ) ) . findFirst ( ) ;
//获取分中心/收费站程序的IP
String fzxOrSfzIp = "" ;
String fzxOrSfzIp = ip ;
//获取分中心/收费站应用程序端口
String fzxOrSfzPort = "0" ;
String fzxOrSfzPort = tomcatPort ;
if ( serverInfoOptional . isPresent ( ) ) {
fzxOrSfzIp = serverInfoOptional . get ( ) . getIP ( ) ;
fzxOrSfzPort = serverInfoOptional . get ( ) . getPORT ( ) ;
//} else {
// log.error("[uuid:{}]-在NAME_TABLE_DCOM表字段SERVERINFO中未找到程序{}的IP和端口号", uuid, PathUtil.webName);
// throw new PPException(MessageEnum.获取NAME_TABLE_DCOM程序IP端口号失败.getCode(), MessageEnum.获取NAME_TABLE_DCOM程序IP端口号失败.getMessage());
//} else {
// log.error("[uuid:{}]-在NAME_TABLE_DCOM表字段SERVERINFO中未找到程序{}的IP和端口号", uuid, PathUtil.webName);
// throw new PPException(MessageEnum.获取NAME_TABLE_DCOM程序IP端口号失败.getCode(), MessageEnum.获取NAME_TABLE_DCOM程序IP端口号失败.getMessage());
}
// 分中心/收费站文件地址
String staUrl = Constant . HTTP + fzxOrSfzIp + Constant . STR_COLON + fzxOrSfzPort + Constant . STR_SLASH + PathUtil . webName