|
|
|
@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
package com.nm.gsgl.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.Constant;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.config.MyEnvironmentPostProcessor;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.dbfmodule.CMinFeeCreator;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.DatabaseUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.DateTimeUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.FileUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.LogUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.MD5Util;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.PathUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.PropertiesUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.common.utils.UnzipUtil;
|
|
|
|
|
|
|
|
import com.nm.gsgl.entity.business.NameTable;
|
|
|
|
|
|
|
|
import com.nm.gsgl.entity.dis.DisMinFeeFile;
|
|
|
|
|
|
|
|
import com.nm.gsgl.entity.sqlite.BusinessTasks;
|
|
|
|
|
|
|
|
import com.nm.gsgl.mapper.NameTableMapper;
|
|
|
|
|
|
|
|
import com.nm.gsgl.mapper.dis.DisMinFeeFileMapper;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @author: shuguang
|
|
|
|
|
|
|
|
* @date: 2024年10月30日 21:15
|
|
|
|
|
|
|
|
* @description:
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
|
|
|
public class CreateMinFeeSqbServiceImpl implements CreateMinFeeSqbService{
|
|
|
|
|
|
|
|
@Value("${sqliteDriverName}")
|
|
|
|
|
|
|
|
private String sqliteDriverName;
|
|
|
|
|
|
|
|
@Value("${sqliteUrl}")
|
|
|
|
|
|
|
|
private String sqliteUrl;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private NameTableMapper nameTableMapper;
|
|
|
|
|
|
|
|
@Value("${NFSFilePath}")
|
|
|
|
|
|
|
|
public String NFSFilePath;
|
|
|
|
|
|
|
|
private static final String driverName = MyEnvironmentPostProcessor.driverClassName;
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 华软中介库数据库相关信息
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Value("${HRConnectionStringOracle}")
|
|
|
|
|
|
|
|
private String HRConnectionStringOracle;
|
|
|
|
|
|
|
|
@Value("${HROracleName}")
|
|
|
|
|
|
|
|
private String HROracleName;
|
|
|
|
|
|
|
|
@Value("${HROraclePass}")
|
|
|
|
|
|
|
|
private String HROraclePass;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private DisMinFeeFileMapper disMinFeeFileMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 通过dll或os动态库生成SQB文件(最小费额)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param uuid uuid
|
|
|
|
|
|
|
|
* @param businessTask Sqlite业务状态表
|
|
|
|
|
|
|
|
* @author shuguang
|
|
|
|
|
|
|
|
* @date 2024-10-30 21:13
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void createMinFeeSqbNew(String uuid, BusinessTasks businessTask) {
|
|
|
|
|
|
|
|
byte[] bytMd5 = new byte[256];
|
|
|
|
|
|
|
|
String protocolType = businessTask.getProtocolType();
|
|
|
|
|
|
|
|
String fileName = businessTask.getFileName();
|
|
|
|
|
|
|
|
String version = businessTask.getNewVersion();
|
|
|
|
|
|
|
|
String id = businessTask.getId();
|
|
|
|
|
|
|
|
//获取本地路径,将文件复制到本地路径生成SQB然后再移动到nfs共享目录中
|
|
|
|
|
|
|
|
String localDownZipPath = PropertiesUtil.getValue("localDownZipPath");
|
|
|
|
|
|
|
|
String localUnZipPath = PropertiesUtil.getValue("localUnZipPath")+File.separator + id;
|
|
|
|
|
|
|
|
String localSqbPath = PropertiesUtil.getValue("localSqbPath");
|
|
|
|
|
|
|
|
FileUtil.fileCreat(localDownZipPath);
|
|
|
|
|
|
|
|
FileUtil.fileCreat(localUnZipPath);
|
|
|
|
|
|
|
|
FileUtil.fileCreat(localSqbPath);
|
|
|
|
|
|
|
|
String nfsDownFilePath = NFSFilePath + PathUtil.downFile;
|
|
|
|
|
|
|
|
String nfsSqbPath = NFSFilePath + PathUtil.sqbPath;
|
|
|
|
|
|
|
|
FileUtil.fileCreat(nfsSqbPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//String localPath = NFSFilePath + PathUtil.downFile;
|
|
|
|
|
|
|
|
//String sqlLiteDir = NFSFilePath + PathUtil.sqbPath;
|
|
|
|
|
|
|
|
//String unZip = sqlLiteDir + "sqbUnZip";
|
|
|
|
|
|
|
|
//FileUtil.fileCreat(sqlLiteDir);
|
|
|
|
|
|
|
|
//FileUtil.fileCreat(unZip);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//压缩文件存放-会被删除
|
|
|
|
|
|
|
|
if (!FileUtil.fileExists(nfsDownFilePath + fileName)) {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-下载的zip文件不存在" + nfsDownFilePath + fileName, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
//更新sqlite任务表的任务状态为2-报错,轮询下次再处理
|
|
|
|
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, Constant.ERROR_UPDATE_BUSINESS_HANDLER + businessTask.getId());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
FileUtil.copyFile(nfsDownFilePath + fileName,localDownZipPath + fileName);
|
|
|
|
|
|
|
|
//解压之前先清空解压目标目录
|
|
|
|
|
|
|
|
FileUtil.removeFiles(new File(localUnZipPath));
|
|
|
|
|
|
|
|
List<String> stringList = UnzipUtil.decompress(localDownZipPath + fileName, localUnZipPath);
|
|
|
|
|
|
|
|
String unzipFilePath = "";
|
|
|
|
|
|
|
|
for (String s : stringList) {
|
|
|
|
|
|
|
|
unzipFilePath = s;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String[] split = unzipFilePath.split(Constant.STR_);
|
|
|
|
|
|
|
|
String exId = split[1];
|
|
|
|
|
|
|
|
String fileDt = split[2].replace(Constant.STR_ZIP, Constant.NULL_STRING);
|
|
|
|
|
|
|
|
QueryWrapper<NameTable> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
queryWrapper.eq("GBSTATIONID", exId);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-查询的NAME_TABLE中GBSTATIONID=" + exId, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
NameTable nameTable = nameTableMapper.selectOne(queryWrapper);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-查询的NAME_TABLE中GBSTATIONID=" + exId + "的数据为" + nameTable, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
if (nameTable != null) {
|
|
|
|
|
|
|
|
String subComNO;
|
|
|
|
|
|
|
|
subComNO = String.valueOf(nameTable.getSubComNo());
|
|
|
|
|
|
|
|
switch (subComNO) {
|
|
|
|
|
|
|
|
case "37"://十大
|
|
|
|
|
|
|
|
subComNO = "38";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "34"://大东 和城大
|
|
|
|
|
|
|
|
subComNO = "33";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "29"://东察
|
|
|
|
|
|
|
|
subComNO = "35";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Integer staNo = nameTable.getStaNo();
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取分公司编号为=" + subComNO, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
String zlibName = "ALLROADMINFEE_" + fileDt + Constant.STR_ + staNo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//版本号_gb编号_分公司号_站号
|
|
|
|
|
|
|
|
String staInfo = fileDt + Constant.STR_ + exId + Constant.STR_ + subComNO + Constant.STR_ + staNo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String localSqbPathDll = localSqbPath + "SQLLITE" + File.separator + fileDt + File.separator + subComNO + File.separator;
|
|
|
|
|
|
|
|
FileUtil.fileCreat(localSqbPathDll);
|
|
|
|
|
|
|
|
String nfsSqbPathDll = nfsSqbPath + "SQLLITE" + File.separator + fileDt + File.separator + subComNO + File.separator;
|
|
|
|
|
|
|
|
FileUtil.fileCreat(nfsSqbPathDll);
|
|
|
|
|
|
|
|
//zip文件备份
|
|
|
|
|
|
|
|
String backUpDir = NFSFilePath + PathUtil.downFileBackup + "SQB" + File.separator + fileDt + File.separator + subComNO;
|
|
|
|
|
|
|
|
FileUtil.fileCreat(backUpDir);
|
|
|
|
|
|
|
|
FileUtil.copyFile(nfsDownFilePath + fileName, backUpDir + File.separator + fileName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取上一版本最新的文件夹
|
|
|
|
|
|
|
|
//上一版本路径
|
|
|
|
|
|
|
|
List<Long> longs = FileUtil.folderNames(nfsSqbPath + File.separator + "SQLLITE" + File.separator);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取SQB下的文件夹个数为=" + longs.size(), "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
//排序
|
|
|
|
|
|
|
|
longs.sort(Comparator.naturalOrder());
|
|
|
|
|
|
|
|
String sqlLiteName = "ALLROADMINFEE_" + staInfo + Constant.STR_SQB;
|
|
|
|
|
|
|
|
String localSqbFileDll = localSqbPathDll + sqlLiteName;
|
|
|
|
|
|
|
|
if (longs.size() > 1) {
|
|
|
|
|
|
|
|
String pre_Version = String.valueOf(longs.get(longs.size() - 2));
|
|
|
|
|
|
|
|
String pre_sqlLitePath = nfsSqbPath + "SQLLITE" + File.separator + pre_Version + File.separator + subComNO;
|
|
|
|
|
|
|
|
//从上一版本的文件夹下找到当前站的文件
|
|
|
|
|
|
|
|
String pre_sqlLiteName = FileUtil.zlibFileName(pre_sqlLitePath, exId);
|
|
|
|
|
|
|
|
String preSqlLitePath = pre_sqlLitePath + File.separator + pre_sqlLiteName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取SQB上一个版本号是" + pre_Version + "sqb文件全路径是" + preSqlLitePath, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
//前一版本拷贝新版本-并重新命名
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(pre_sqlLiteName) && FileUtil.fileExists(pre_sqlLitePath + File.separator + pre_sqlLiteName)) {
|
|
|
|
|
|
|
|
FileUtil.fileCopyReName(pre_sqlLitePath + File.separator + pre_sqlLiteName, localSqbFileDll);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取上一版本SQB文件不存在,新创建文件" + localSqbFileDll, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
FileUtil.newFileCreat(localSqbFileDll);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取上一版本SQB文件不存在,新创建文件" + localSqbFileDll, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
FileUtil.newFileCreat(localSqbFileDll);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String zlibFileDll = localSqbPathDll + zlibName + Constant.STR_ZLIB;
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-调用动态库生成最小费额SQB文件中,协议类型为" + protocolType + "zip文件名为" + fileName, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
String zipFilePath = (localDownZipPath + fileName).replace("\\", "/");
|
|
|
|
|
|
|
|
String sqbFileDllPath = localSqbFileDll.replace("\\", "/");
|
|
|
|
|
|
|
|
String zlibFileDllPath = zlibFileDll.replace("\\", "/");
|
|
|
|
|
|
|
|
int count = CMinFeeCreator.INSTANCE.MakeMinFee(zipFilePath, sqbFileDllPath, zlibFileDllPath, bytMd5);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-调用动态库生成最小费额SQB文件返回count为" + count, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
if (count >= 0) {
|
|
|
|
|
|
|
|
String sqbInsertPath = NFSFilePath + File.separator + "ParamInsertDb" + File.separator + "MinFeeInToDataBase" + File.separator;
|
|
|
|
|
|
|
|
FileUtil.fileCreat(sqbInsertPath);
|
|
|
|
|
|
|
|
String newSqbBackUpName = exId + Constant.STR_ + sqlLiteName;
|
|
|
|
|
|
|
|
//sqb源文件复制到备份文件夹,再重命名
|
|
|
|
|
|
|
|
FileUtil.copyFile(sqbFileDllPath, sqbInsertPath + newSqbBackUpName);
|
|
|
|
|
|
|
|
FileUtil.copyFile(sqbFileDllPath, nfsSqbPathDll + sqlLiteName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取生成的zlib的文件名
|
|
|
|
|
|
|
|
String zlibFileNameMd5 = FileUtil.zlibFileName(localSqbPathDll, zlibName.replace(Constant.STR_ZLIB, Constant.NULL_STRING) + Constant.STR_);
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-获取zlib的文件名称为" + zlibFileNameMd5, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
FileUtil.copyFile(localSqbPathDll+ File.separator +zlibFileNameMd5, nfsSqbPathDll + zlibFileNameMd5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取高路分中心需要下发的收费站编码,如果是多个站,站编码用,间隔
|
|
|
|
|
|
|
|
String glMinFeeFZXs = PropertiesUtil.getValue("GLMinFeeFZXs");
|
|
|
|
|
|
|
|
String glMinFeeStaNos = PropertiesUtil.getValue("GLMinFeeStaNos");
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(glMinFeeFZXs) && StringUtils.isNotBlank(glMinFeeStaNos)) {
|
|
|
|
|
|
|
|
String[] split1 = glMinFeeFZXs.split(Constant.FIELD_SEPARATE);
|
|
|
|
|
|
|
|
String[] split2 = glMinFeeStaNos.split(Constant.FIELD_SEPARATE);
|
|
|
|
|
|
|
|
for (String subcomno : split1) {
|
|
|
|
|
|
|
|
for (String stano : split2) {
|
|
|
|
|
|
|
|
if (zlibFileNameMd5.contains(Constant.STR_ + stano + Constant.STR_)) {
|
|
|
|
|
|
|
|
//按照分中心的编码存入数据库表联网中心最小费额下发分中心表
|
|
|
|
|
|
|
|
QueryWrapper<DisMinFeeFile> query = new QueryWrapper<>();
|
|
|
|
|
|
|
|
query.eq("SUBCOMNO", subcomno).eq("STANO", stano);
|
|
|
|
|
|
|
|
//判断是否存在此分公司和收费站的最小费额数据
|
|
|
|
|
|
|
|
boolean exists = disMinFeeFileMapper.exists(query);
|
|
|
|
|
|
|
|
if (!exists) {
|
|
|
|
|
|
|
|
DisMinFeeFile file = new DisMinFeeFile();
|
|
|
|
|
|
|
|
file.setSubComNO(Integer.valueOf(subcomno));
|
|
|
|
|
|
|
|
file.setStaNo(Integer.valueOf(stano));
|
|
|
|
|
|
|
|
file.setZlibName(zlibFileNameMd5);
|
|
|
|
|
|
|
|
file.setZlibPath(nfsSqbPathDll);
|
|
|
|
|
|
|
|
file.setMd5(MD5Util.getMd5ByFilePath(nfsSqbPathDll + File.separator + zlibFileNameMd5));
|
|
|
|
|
|
|
|
file.setVersion(version);
|
|
|
|
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
|
|
|
|
file.setState(0);
|
|
|
|
|
|
|
|
disMinFeeFileMapper.insert(file);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//更新
|
|
|
|
|
|
|
|
UpdateWrapper<DisMinFeeFile> updateWrap = new UpdateWrapper<>();
|
|
|
|
|
|
|
|
updateWrap.eq("SUBCOMNO", Integer.valueOf(subcomno)).eq("STANO", Integer.valueOf(stano)).set("ZLIBNAME", zlibFileNameMd5).set("ZLIBPATH", nfsSqbPathDll).set("MD5", MD5Util.getMd5ByFilePath(nfsSqbPathDll + File.separator + zlibFileNameMd5)).set("VERSION", version).set("UPDATETIME", new Date()).set("STATE", 0);
|
|
|
|
|
|
|
|
disMinFeeFileMapper.update(null, updateWrap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//最小费额按照分中心下发,下发到分中心后,分中心手动下发到车道
|
|
|
|
|
|
|
|
//按照分中心的编码存入数据库表联网中心最小费额下发分中心表
|
|
|
|
|
|
|
|
QueryWrapper<DisMinFeeFile> query = new QueryWrapper<>();
|
|
|
|
|
|
|
|
query.eq("SUBCOMNO", subComNO).eq("STANO", staNo);
|
|
|
|
|
|
|
|
//判断是否存在此分公司和收费站的最小费额数据
|
|
|
|
|
|
|
|
boolean exists = disMinFeeFileMapper.exists(query);
|
|
|
|
|
|
|
|
if (!exists) {
|
|
|
|
|
|
|
|
DisMinFeeFile file = new DisMinFeeFile();
|
|
|
|
|
|
|
|
file.setSubComNO(Integer.parseInt(subComNO));
|
|
|
|
|
|
|
|
file.setStaNo(staNo);
|
|
|
|
|
|
|
|
file.setZlibName(zlibFileNameMd5);
|
|
|
|
|
|
|
|
file.setZlibPath(nfsSqbPathDll);
|
|
|
|
|
|
|
|
file.setMd5(MD5Util.getMd5ByFilePath(nfsSqbPathDll + File.separator + zlibFileNameMd5));
|
|
|
|
|
|
|
|
file.setVersion(version);
|
|
|
|
|
|
|
|
file.setCreateTime(new Date());
|
|
|
|
|
|
|
|
file.setState(0);
|
|
|
|
|
|
|
|
disMinFeeFileMapper.insert(file);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//更新
|
|
|
|
|
|
|
|
UpdateWrapper<DisMinFeeFile> updateWrap = new UpdateWrapper<>();
|
|
|
|
|
|
|
|
updateWrap.eq("SUBCOMNO", Integer.parseInt(subComNO)).eq("STANO", staNo).set("ZLIBNAME", zlibFileNameMd5).set("ZLIBPATH", nfsSqbPathDll).set("MD5", MD5Util.getMd5ByFilePath(nfsSqbPathDll + File.separator + zlibFileNameMd5)).set("VERSION", version).set("UPDATETIME", new Date()).set("STATE", 0);
|
|
|
|
|
|
|
|
disMinFeeFileMapper.update(null, updateWrap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
FileUtil.delete(new File(sqbFileDllPath));
|
|
|
|
|
|
|
|
FileUtil.delete(new File(localUnZipPath +File.separator+ businessTask.getFileName()));
|
|
|
|
|
|
|
|
FileUtil.delete(new File(localDownZipPath + businessTask.getFileName()));
|
|
|
|
|
|
|
|
FileUtil.delete(new File(NFSFilePath + PathUtil.downFile + businessTask.getFileName()));
|
|
|
|
|
|
|
|
FileUtil.delete(new File(localSqbPathDll+ File.separator +zlibFileNameMd5));
|
|
|
|
|
|
|
|
String nowString = DateTimeUtil.getFormateString(new Date(), Constant.YYYY_MM_DD_HH_MM_SS);
|
|
|
|
|
|
|
|
String sqlParam = Constant.UPDATE_BUSINESS_HANDLER + nowString + Constant.PUBLISH_TIME + nowString + Constant.WHERE_ID + businessTask.getId();
|
|
|
|
|
|
|
|
if (DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqlParam) > 0) {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-更新business_tasks_info调用动态库任务列表成功,id为" + businessTask.getId(), "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-更新中介库TF_DOWNLOAD_NOTIFY(id为" + id + ")下载状态为1-已下载", "MinFeeServiceImpl");
|
|
|
|
|
|
|
|
DatabaseUtil.updateSql(driverName, HRConnectionStringOracle, HROracleName, HROraclePass, Constant.UPDATE_TF_DOWNLOAD_NOTIFY_HR + id, uuid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_Error("[uuid:" + uuid + "]-调用动态库生成最小费额SQB操作失败,返回值count为" + count, "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
//更新sqlite任务表的任务状态为2-报错
|
|
|
|
|
|
|
|
DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, Constant.ERROR_UPDATE_BUSINESS_HANDLER + businessTask.getId());
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-最小费额文件数据处理失败,中介下载任务(id为" + id + ")不更新", "MinFeeServiceImpl");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-查询的NAME_TABLE中GBSTATIONID=" + exId + "的数据为null,跳过本次处理", "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
String nowString = DateTimeUtil.getFormateString(new Date(), Constant.YYYY_MM_DD_HH_MM_SS);
|
|
|
|
|
|
|
|
String sqlParam = Constant.UPDATE_BUSINESS_HANDLER + nowString + Constant.PUBLISH_TIME + nowString + Constant.WHERE_ID + businessTask.getId();
|
|
|
|
|
|
|
|
if (DatabaseUtil.insertSqlite(sqliteDriverName, sqliteUrl, sqlParam) > 0) {
|
|
|
|
|
|
|
|
LogUtil.WriteLog_MinFee("[uuid:" + uuid + "]-更新business_tasks_info调用动态库任务列表成功,id为" + businessTask.getId(), "CreateMinFeeSqbServiceImpl");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|