main
parent
bbde3834c3
commit
10be376130
@ -0,0 +1,147 @@
|
||||
package com.nm.gsgl.common.utils;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.nio.channels.FileLock;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
public class LogUtil {
|
||||
|
||||
public static String TomcatPath = System.getProperty("catalina.home");
|
||||
|
||||
private static String getFilePath() {
|
||||
|
||||
return TomcatPath ;
|
||||
}
|
||||
|
||||
public static void WriteLog_Info(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_Info";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
public static void WriteLog_Error(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_Error";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_InsertDB(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_InsertDB";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_CallDisInterface(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_CallDisInterface";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
public static void WriteLog_MinFee(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_MinFee";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
public static void WriteLog_HRBlackCard(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_HRBlackCard";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_MDBlackCard(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_MDBlackCard";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_ValidateDual(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_ValidateDual";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_BackupSqlite(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_BackupSqlite";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_DeleteOverFile(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_DeleteOverFile";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
public static void WriteLog_HRZipDownloadFile(String msg, String disStr) {
|
||||
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd-HH");
|
||||
String fileName = f.format(new Date()) + "_HRZipDownloadFile";
|
||||
WriteLog(fileName, msg, disStr);
|
||||
}
|
||||
|
||||
|
||||
private static void WriteLog(String suffix, String content, String disStr) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
|
||||
String baseDir = getFilePath() + "/logs/ParamDownload/";
|
||||
FileUtil.fileCreat(baseDir);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
String str = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")) + "-->类【" + disStr + "】:";
|
||||
sb.append(str);
|
||||
sb.append(content);
|
||||
sb.append("\r\n");
|
||||
|
||||
String logPath = baseDir;
|
||||
File logPathFile = new File(logPath);
|
||||
if (!logPathFile.isDirectory()) {
|
||||
Boolean _f = logPathFile.mkdir();
|
||||
}
|
||||
|
||||
String fileDic = format.format(new Date());
|
||||
File filedir = new File(logPath + fileDic);
|
||||
if (!filedir.isDirectory()) {
|
||||
filedir.mkdir();
|
||||
File[] fs = logPathFile.listFiles();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int delFlag = Integer.parseInt(now.minus(30, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
|
||||
for (File f : fs) {
|
||||
int deldir = Integer.parseInt(f.getName());
|
||||
if (deldir < delFlag) {
|
||||
if (f.isDirectory()) {
|
||||
deleteDirectory(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String fullFilePath = logPath + fileDic + "/" + suffix + ".txt";
|
||||
|
||||
try (RandomAccessFile reader = new RandomAccessFile(new File(fullFilePath), "rw");
|
||||
FileLock lock1 = reader.getChannel().lock()) {
|
||||
|
||||
reader.seek(reader.length());
|
||||
reader.write(sb.toString().getBytes());
|
||||
|
||||
} catch (IOException e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
System.out.println(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void deleteDirectory(File file) {
|
||||
if (file.isFile()) {// 表示该文件不是文件夹
|
||||
file.delete();
|
||||
} else {
|
||||
// 首先得到当前的路径
|
||||
String[] childFilePaths = file.list();
|
||||
for (String childFilePath : childFilePaths) {
|
||||
File childFile = new File(file.getAbsolutePath() + "/" + childFilePath);
|
||||
deleteDirectory(childFile);
|
||||
}
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月17日 16:51
|
||||
* @description: 804
|
||||
*/
|
||||
@Data
|
||||
@TableName("CHECKRESULT_INFO_TABLE")
|
||||
public class CheckResultInfo {
|
||||
|
||||
|
||||
@TableField("CHECKID")
|
||||
private String checkId;
|
||||
|
||||
|
||||
@TableField("VEHICLESIGN")
|
||||
private String vehicleSign;
|
||||
|
||||
@TableField("VEHICLECLASS")
|
||||
private Integer vehicleClass;
|
||||
@TableField("APPOINTMENTID")
|
||||
private String appointmentId;
|
||||
@TableField("DRIVERTELEPHONE")
|
||||
private String driverTelephone;
|
||||
@TableField("VEHICLEID")
|
||||
private String vehicleId;
|
||||
@TableField("FREIGHTTYPES")
|
||||
private String freightTypes;
|
||||
@TableField("VEHICLETYPE")
|
||||
private Integer vehicleType;
|
||||
@TableField("CRATETYPE")
|
||||
private Integer crateType;
|
||||
@TableField("ENWEIGHT")
|
||||
private Integer enWeight;
|
||||
@TableField("EXWEIGHT")
|
||||
private Integer exWeight;
|
||||
@TableField(value = "CHECKTIME", jdbcType = JdbcType.DATE, update = "to_date(#{CHECKTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String checkTime;
|
||||
@TableField("ENSTATIONID")
|
||||
private String enStationId;
|
||||
@TableField("EXSTATIONID")
|
||||
private String exStationId;
|
||||
@TableField("GROUPID")
|
||||
private String groupId;
|
||||
@TableField("INSPECTOR")
|
||||
private String inspector;
|
||||
@TableField("REVIEWER")
|
||||
private String reviewer;
|
||||
@TableField("CHECKRESULT")
|
||||
private Integer checkResult;
|
||||
@TableField("REASON")
|
||||
private String reason;
|
||||
@TableField("MEDIATYPE")
|
||||
private Integer mediaType;
|
||||
@TableField("TRANSACTIONID")
|
||||
private String transactionId;
|
||||
@TableField("PASSID")
|
||||
private String passId;
|
||||
@TableField(value = "EXTIME", jdbcType = JdbcType.DATE, update = "to_date(#{EXTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String exTime;
|
||||
@TableField("transpaytype")
|
||||
private Integer transPayType;
|
||||
@TableField("FEE")
|
||||
private Long fee;
|
||||
@TableField("PAYFEE")
|
||||
private Long payFee;
|
||||
@TableField("MEMO")
|
||||
private String memo;
|
||||
@TableField("OPERATION")
|
||||
private Integer operation;
|
||||
@TableField("EXEMPTION")
|
||||
private Integer exemption;
|
||||
@TableField("BASICFILENAME")
|
||||
private String basicFilename;
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月17日 16:27
|
||||
* @description: 604
|
||||
*/
|
||||
@Data
|
||||
@TableName("CT_GATHERDETAIL_TABLE")
|
||||
public class CtGatherDetail {
|
||||
@TableField("PASSID")
|
||||
private String passId;
|
||||
@TableField("VEHICLEID")
|
||||
private String vehicleId;
|
||||
@TableField("VEHICLETYPE")
|
||||
private Integer vehicleType;
|
||||
@TableField("VEHICLECLASS")
|
||||
private Integer vehicleClass;
|
||||
@TableField("AXLECOUNT")
|
||||
private Integer axleCount ;
|
||||
@TableField("PAYERTYPE")
|
||||
private Integer payerType;
|
||||
@TableField("PAYERID")
|
||||
private String payerId;
|
||||
@TableField("RECEIVERID")
|
||||
private String receiverId;
|
||||
@TableField(value = "RECEIVETIME",jdbcType = JdbcType.DATE,update = "to_date(#{RECEIVETIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String receiveTime;
|
||||
@TableField("FEE")
|
||||
private Long fee;
|
||||
@TableField("BASICFILENAME")
|
||||
private String basicFilename;
|
||||
@TableField("DATEMARK")
|
||||
private Date dateMark;
|
||||
@TableField("BAK1")
|
||||
private Integer bak1;
|
||||
@TableField("BAK2")
|
||||
private Integer bak2;
|
||||
@TableField("BAK3")
|
||||
private String bak3;
|
||||
@TableField("BAK4")
|
||||
private String bak4;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月17日 16:32
|
||||
* @description: 502
|
||||
*/
|
||||
@Data
|
||||
@TableName("CT_OTHER_CLEAR")
|
||||
public class CtOtherClear {
|
||||
@TableField("MESSAGEID")
|
||||
private Integer messageId;
|
||||
@TableField("ID")
|
||||
private String id;
|
||||
@TableField("PAYFEE")
|
||||
private Long payFee;
|
||||
@TableField("FEE")
|
||||
private Long fee;
|
||||
@TableField("DISCOUNTFEE")
|
||||
private Long discountFee;
|
||||
@TableField("MEDIATYPE")
|
||||
private Integer mediaType;
|
||||
@TableField("OBUSIGN")
|
||||
private Integer obuSign;
|
||||
@TableField("MEDIANO")
|
||||
private String mediaNo;
|
||||
@TableField("ENTOLLLANEID")
|
||||
private String enTollLaneId;
|
||||
@TableField(value = "ENTIME",jdbcType = JdbcType.DATE,update = "to_date(#{ENTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String enTime;
|
||||
@TableField("ENWEIGHT")
|
||||
private Integer enWeight;
|
||||
@TableField("ENAXLECOUNT")
|
||||
private Integer enAxleCount ;
|
||||
@TableField("EXTOLLLANEID")
|
||||
private String exTollLaneId;
|
||||
@TableField("ENVEHICLEID")
|
||||
private String enVehicleId;
|
||||
@TableField("EXVEHICLEID")
|
||||
private String exVehicleId;
|
||||
@TableField("IDENTIFYVEHICLEID")
|
||||
private String identifyVehicleId;
|
||||
@TableField("ENVEHICLETYPE")
|
||||
private Integer enVehicleType;
|
||||
@TableField("EXVEHICLETYPE")
|
||||
private Integer exVehicleType;
|
||||
@TableField("VEHICLECLASS")
|
||||
private Integer vehicleClass;
|
||||
@TableField("ENTOLLSTATIONNAME")
|
||||
private String enTollStationName;
|
||||
@TableField("EXTOLLSTATIONNAME")
|
||||
private String exTollStationName;
|
||||
@TableField("PAYTYPE")
|
||||
private Integer payType;
|
||||
@TableField("IDENTIFICATION")
|
||||
private Integer identification;
|
||||
@TableField("DESCRIPTION")
|
||||
private String description;
|
||||
@TableField("SPECIALTYPE")
|
||||
private String specialType;
|
||||
@TableField("VEHICLESIGNID")
|
||||
private String vehicleSignId;
|
||||
@TableField("PASSID")
|
||||
private String passId;
|
||||
@TableField("SPLITPROVINCE")
|
||||
private String splitProvince;
|
||||
@TableField("AMOUNT")
|
||||
private Long amount;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月17日 16:43
|
||||
* @description: 503
|
||||
*/
|
||||
@Data
|
||||
@TableName("CT_OTHER_CLEAR_SUM")
|
||||
public class CtOtherClearSum {
|
||||
@TableField("SERPROVINCEID")
|
||||
private String serProvinceId;
|
||||
|
||||
@TableField(value = "CLEARDATE",jdbcType = JdbcType.DATE,update = "to_date(#{CLEARDATE},'yyyy-mm-dd')")
|
||||
private String clearDate;
|
||||
@TableField(value = "PROCESSTIME",jdbcType = JdbcType.DATE,update = "to_date(#{PROCESSTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String processTime;
|
||||
@TableField("PAYERAMOUNT")
|
||||
private Long payerAmount;
|
||||
@TableField("PAYERMESSAGECOUNT")
|
||||
private Integer payerMessageCount;
|
||||
@TableField("RECEIVERAMOUNT")
|
||||
private String receiverAmount;
|
||||
@TableField("RECEIVERMESSAGECOUNT")
|
||||
private Integer receiverMessageCount;
|
||||
@TableField("AMOUNTDUE")
|
||||
private Long amountDue;
|
||||
@TableField("RESULTOFPAYER")
|
||||
private String resultOfPayer;
|
||||
@TableField("RESULTOFRECEIVER")
|
||||
private String resultOfReceiver;
|
||||
@TableField("ISSPLIT")
|
||||
private Integer isSplit;
|
||||
@TableField("BASICFILENAME")
|
||||
private String basicFilename;
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月17日 16:15
|
||||
* @description: 605
|
||||
*/
|
||||
@Data
|
||||
@TableName("CT_PAYERDETAIL_TABLE")
|
||||
public class CtPayerDetail {
|
||||
|
||||
@TableField("PASSID")
|
||||
private String passId;
|
||||
@TableField("VEHICLEID")
|
||||
private String vehicleId;
|
||||
@TableField("ORIGIN")
|
||||
private Long origin;
|
||||
@TableField("PAYERTYPE")
|
||||
private Integer payerType;
|
||||
@TableField("PAYERID")
|
||||
private String payerId;
|
||||
@TableField(value = "PAYTIME",jdbcType = JdbcType.DATE,update = "to_date(#{PAYTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String payTime;
|
||||
@TableField("PAYFEE")
|
||||
private Long payFee;
|
||||
@TableField("BASICFILENAME")
|
||||
private String basicFilename;
|
||||
@TableField("DATEMARK")
|
||||
private Date dateMark;
|
||||
@TableField("BAK1")
|
||||
private Integer bak1;
|
||||
@TableField("BAK2")
|
||||
private Integer bak2;
|
||||
@TableField("BAK3")
|
||||
private String bak3;
|
||||
@TableField("BAK4")
|
||||
private String bak4;
|
||||
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.nm.gsgl.entity.business.db;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月27日 11:41
|
||||
* @description: 306
|
||||
*/
|
||||
@Data
|
||||
@TableName("CT_REFUND_LATERPAY_SUM")
|
||||
public class CtRefundLaterpaySum {
|
||||
@TableField(value = "CLEARDATE",jdbcType = JdbcType.DATE,update = "to_date(#{CLEARDATE},'yyyy-mm-dd')")
|
||||
private String clearDate;
|
||||
@TableField(value = "PROCESSTIME",jdbcType = JdbcType.DATE,update = "to_date(#{PROCESSTIME},'yyyy-mm-dd hh24:mi:ss')")
|
||||
private String processTime;
|
||||
@TableField("RECEIVEAMOUNT")
|
||||
private Integer receiveAmount;
|
||||
@TableField("PAYAMOUNT")
|
||||
private Integer payAmount;
|
||||
@TableField("AMOUNT")
|
||||
private Integer amount;
|
||||
@TableField("REFUNDCOUNT")
|
||||
private Integer refundCount;
|
||||
@TableField("RESTITUTIONCOUNT")
|
||||
private Integer restitutionCount;
|
||||
@TableField("RECEIVEDETAIL")
|
||||
private String receiveDetail;
|
||||
@TableField("PAYDETAIL")
|
||||
private String payDetail;
|
||||
@TableField("BASICFILENAME")
|
||||
private String basicFilename;
|
||||
@TableField("DATEMARK")
|
||||
private Date dateMark;
|
||||
@TableField("ISSPLIT")
|
||||
private Integer isSplit;
|
||||
@TableField("PROVRESTITUTIONCOUNT")
|
||||
private Integer provrestitutionCount;
|
||||
@TableField("PROVRECEIVEAMOUT")
|
||||
private Integer provreceiveAmout;
|
||||
@TableField("PROVREFUNDCOUNT")
|
||||
private Integer provrefundCount;
|
||||
@TableField("PROVPAYAMOUT")
|
||||
private Integer provpayAmout;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CheckResultInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月21日 10:32
|
||||
* @description: 804
|
||||
*/
|
||||
@Mapper
|
||||
public interface CheckResultInfoMapper extends BaseMapper<CheckResultInfo> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CtGatherDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月21日 10:30
|
||||
* @description: 604
|
||||
*/
|
||||
@Mapper
|
||||
public interface CtGatherDetailMapper extends BaseMapper<CtGatherDetail> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CtOtherClear;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月21日 10:27
|
||||
* @description: 502
|
||||
*/
|
||||
@Mapper
|
||||
public interface CtOtherClearMapper extends BaseMapper<CtOtherClear> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CtOtherClearSum;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月21日 10:29
|
||||
* @description: 503
|
||||
*/
|
||||
@Mapper
|
||||
public interface CtOtherClearSumMapper extends BaseMapper<CtOtherClearSum> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CtPayerDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月21日 10:31
|
||||
* @description: 605
|
||||
*/
|
||||
@Mapper
|
||||
public interface CtPayerDetailMapper extends BaseMapper<CtPayerDetail> {
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.nm.gsgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nm.gsgl.entity.business.db.CtRefundLaterpaySum;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月27日 14:27
|
||||
* @description: 306
|
||||
*/
|
||||
@Mapper
|
||||
public interface CtRefundLaterpaySumMapper extends BaseMapper<CtRefundLaterpaySum> {
|
||||
}
|
||||
@ -1,19 +1,19 @@
|
||||
package com.nm.gsgl.service;
|
||||
|
||||
import com.nm.gsgl.entity.sqlite.BusinessTasks;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年02月06日 14:04
|
||||
* @description: DBF写入service
|
||||
*/
|
||||
public interface CreateDbfService {
|
||||
/**
|
||||
* zip文件转json插入对应的DBF文件
|
||||
*
|
||||
* @param uuid uuid
|
||||
* @author shuguang
|
||||
* @date 2023-02-13 8:38
|
||||
*/
|
||||
void zipToDbf(String uuid, BusinessTasks businessTask);
|
||||
}
|
||||
//package com.nm.gsgl.service;
|
||||
//
|
||||
//import com.nm.gsgl.entity.sqlite.BusinessTasks;
|
||||
//
|
||||
///**
|
||||
// * @author: shuguang
|
||||
// * @date: 2023年02月06日 14:04
|
||||
// * @description: DBF写入service
|
||||
// */
|
||||
//public interface CreateDbfService {
|
||||
// /**
|
||||
// * zip文件转json插入对应的DBF文件
|
||||
// *
|
||||
// * @param uuid uuid
|
||||
// * @author shuguang
|
||||
// * @date 2023-02-13 8:38
|
||||
// */
|
||||
// void zipToDbf(String uuid, BusinessTasks businessTask);
|
||||
//}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,108 @@
|
||||
package com.nm.gsgl.test;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2024年05月23日 16:51
|
||||
* @description: 数据入库对比测试
|
||||
*/
|
||||
public class ContrastTest {
|
||||
public static void main(String[] args) {
|
||||
// 数据库连接信息
|
||||
String db1Url = "jdbc:oracle:thin:@192.168.101.70:1521/XE";
|
||||
String db2Url = "jdbc:oracle:thin:@10.15.100.5:1521/TORCL";
|
||||
String username = "nmgmpayadmin";
|
||||
String password = "nmgh90[]";
|
||||
//String query = "SELECT * FROM CT_ETC_CLEAR_SUM WHERE PROCESSTIME>=to_date('2024-05-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROCESSTIME<=to_date('2024-05-16 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROCESSTIME ";
|
||||
//String query = "SELECT SERPROVINCEID,CLEARDATE,PROCESSTIME,PAYERAMOUNT,PAYERMESSAGECOUNT,RECEIVERAMOUNT FROM CT_OTHER_CLEAR_SUM_1 WHERE PROCESSTIME>=to_date('2024-05-01 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROCESSTIME<=to_date('2024-05-16 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROCESSTIME ";
|
||||
//String query = "SELECT count(*) FROM CT_GANTRYPASSID WHERE EXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and EXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ";
|
||||
//String query = "SELECT ID,SPLITTIME,EXTIME FROM CT_OUT_PORT_ETC_NOPAY WHERE EXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and EXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY EXTIME";
|
||||
//String query = "SELECT ID,SPLITTIME,ENTIME FROM CT_OTHER_OUT_PORT WHERE ENTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and ENTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY EXTIME";
|
||||
//String query = "SELECT ID,SPLITTIME FROM CT_OTHER_GANTRYPASSID WHERE SPLITTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY ID " ;
|
||||
//String query = "SELECT ID,SPLITTIME FROM CT_OUTOTHER_GANTRY WHERE SPLITTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY ID" ;
|
||||
//String query = "SELECT ID,REFUNDID,PROCESSTIME FROM CT_SERVERREFUND_TABLE WHERE PROCESSTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROCESSTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROCESSTIME" ;
|
||||
//String query = "SELECT ID,RESTITUTIONID,PROCESSTIME FROM CT_SERVERLATERPAY_TABLE WHERE PROCESSTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROCESSTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROCESSTIME" ;
|
||||
//604数据不一致正式库无数据
|
||||
//String query = "SELECT PASSID,VEHICLEID,RECEIVERID,PAYERID,FEE,RECEIVETIME FROM CT_GATHERDETAIL_TABLE WHERE RECEIVETIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and RECEIVETIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY RECEIVETIME" ;
|
||||
//605数据不一致 正式库无数据
|
||||
//String query = "SELECT PASSID,VEHICLEID,ORIGIN,PAYERID,PAYFEE,PAYTIME FROM CT_PAYERDETAIL_TABLE WHERE PAYTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PAYTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PAYTIME" ;
|
||||
//804数据不一致 条数一致 CHECKID不一致
|
||||
//String query = "SELECT CHECKID FROM CHECKRESULT_INFO_TABLE WHERE CHECKTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and CHECKTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY CHECKTIME" ;
|
||||
//803数据不一致 条数一致 CHECKID不一致
|
||||
//String query = "SELECT CHECKID,VEHICLEID,CHECKTIME FROM CHECKRESULT_TABLE_NEW WHERE CHECKTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and CHECKTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY CHECKTIME" ;
|
||||
//String query = "SELECT ID,EXTIME FROM BSDZ_DISPUTE_PASSPROV WHERE EXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and EXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY EXTIME" ;
|
||||
//String query = "SELECT SPLITDATE,SERPROVINCEID FROM BSDZ_CLEAR_SUM WHERE SPLITDATE>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITDATE<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY SPLITDATE" ;
|
||||
//904数据不一致 条数不一致
|
||||
//String query = "SELECT ID,PROVEXTIME FROM BSDZ_NOOUTPORT_S2_DOWN WHERE PROVEXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROVEXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROVEXTIME" ;
|
||||
//String query = "SELECT ID,SPLITDATE FROM BSDZ_NOSPLIT_S2_DOWN WHERE SPLITDATE>=to_date('2024-05-11 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITDATE<=to_date('2024-05-13 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY SPLITDATE" ;
|
||||
//String query = "SELECT ID,EXTIME FROM BSDZ_DISPUTE_EXPROV WHERE EXTIME>=to_date('2024-05-11 00:00:00','yyyy-mm-dd hh24:mi:ss') and EXTIME<=to_date('2024-05-12 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY EXTIME" ;
|
||||
|
||||
//922数据不一致 条数不一致
|
||||
//String query = "SELECT ID,PROVEXTIME FROM BSDZ_NOOUTPORT_S3_DOWN WHERE PROVEXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROVEXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROVEXTIME" ;
|
||||
//923数据不一致 条数不一致
|
||||
String query = "SELECT ID,PROVEXTIME FROM BSDZ_NOOUTPORT_RESULT WHERE PROVEXTIME>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and PROVEXTIME<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY PROVEXTIME" ;
|
||||
//String query = "SELECT ID,SPLITDATE FROM BSDZ_NOSPLIT_S3_DOWN WHERE SPLITDATE>=to_date('2024-05-02 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITDATE<=to_date('2024-05-03 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY SPLITDATE" ;
|
||||
//String query = "SELECT ID,SPLITDATE FROM BSDZ_NOSPLIT_RESULT WHERE SPLITDATE>=to_date('2024-05-08 00:00:00','yyyy-mm-dd hh24:mi:ss') and SPLITDATE<=to_date('2024-05-09 00:00:00','yyyy-mm-dd hh24:mi:ss') ORDER BY SPLITDATE" ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 连接两个数据库
|
||||
try (Connection db1Connection = DriverManager.getConnection(db1Url, username, password);
|
||||
Connection db2Connection = DriverManager.getConnection(db2Url, username, password)) {
|
||||
|
||||
// 创建Statement对象
|
||||
Statement db1Statement = db1Connection.createStatement();
|
||||
Statement db2Statement = db2Connection.createStatement();
|
||||
|
||||
// 执行查询
|
||||
|
||||
ResultSet db1ResultSet = db1Statement.executeQuery(query);
|
||||
ResultSet db2ResultSet = db2Statement.executeQuery(query);
|
||||
|
||||
// 将查询结果转换为List
|
||||
List<String> db1Data = new ArrayList<>();
|
||||
List<String> db2Data = new ArrayList<>();
|
||||
while (db1ResultSet.next()) {
|
||||
String row = convertResultSetToString(db1ResultSet);
|
||||
db1Data.add(row);
|
||||
}
|
||||
while (db2ResultSet.next()) {
|
||||
String row = convertResultSetToString(db2ResultSet);
|
||||
db2Data.add(row);
|
||||
}
|
||||
System.out.println("db1Data的size"+db1Data.size());
|
||||
System.out.println("db2Data的size"+db2Data.size());
|
||||
// 比较数据
|
||||
if (db1Data.equals(db2Data)) {
|
||||
System.out.println("两个数据库中的数据一致。");
|
||||
} else {
|
||||
System.out.println("两个数据库中的数据不一致。");
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 将ResultSet转换为String
|
||||
private static String convertResultSetToString(ResultSet rs) throws SQLException {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int columnCount = rs.getMetaData().getColumnCount();
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
sb.append(rs.getObject(i));
|
||||
if (i < columnCount) {
|
||||
sb.append(", ");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@ -1,70 +1,70 @@
|
||||
package com.nm.gsgl.test;
|
||||
|
||||
import com.nm.gsgl.common.utils.DbfWriterAndReadUtil;
|
||||
import com.nm.gsgl.common.utils.UuidUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author: shuguang
|
||||
* @date: 2023年07月27日 16:02
|
||||
* @description:
|
||||
*/
|
||||
@Slf4j
|
||||
public class Test04 {
|
||||
public static void main(String[] args) throws IOException {
|
||||
////String s = Integer.toBinaryString(4);
|
||||
////十进制转二进制
|
||||
//String s = Integer.toBinaryString(24);
|
||||
//System.out.println(s);
|
||||
String uuid = UuidUtil.getUuid();
|
||||
log.info("[uuid:{}]当前时间={}", uuid, LocalDateTime.now());
|
||||
long start = System.currentTimeMillis();
|
||||
String dbfPath= "D:\\桌面\\增量\\20230727110001_CARDBLACKLISTINC.DBF";
|
||||
List<Map<String, Object>> mapList = DbfWriterAndReadUtil.readDbf(dbfPath, "UTF-8");
|
||||
System.out.println("=========================");
|
||||
System.out.println(mapList.size());
|
||||
String dbfPath2= "D:\\桌面\\增量\\20230727110647_TB_CARDBLACKINC_20230727110002_230727114.DBF";
|
||||
List<Map<String, Object>> mapList2 = DbfWriterAndReadUtil.readDbf(dbfPath2, "UTF-8");
|
||||
System.out.println("=========================");
|
||||
System.out.println(mapList2.size());
|
||||
List<Map<String, Object>> mapList3 = Stream.of(mapList,mapList2)
|
||||
.flatMap(Collection::stream)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
System.out.println("=========================");
|
||||
System.out.println(mapList3.size());
|
||||
FileWriter outFile = null;
|
||||
BufferedWriter writer = null;
|
||||
|
||||
try {
|
||||
outFile = new FileWriter("D:\\桌面\\增量\\test.txt");
|
||||
writer= new BufferedWriter(outFile);
|
||||
for (Map<String, Object> maps : mapList3) {
|
||||
String t = "";
|
||||
for (String key : maps.keySet()) {
|
||||
t += maps.get(key) + "\t\n";
|
||||
}
|
||||
t = t.substring(0, t.length() - 1);
|
||||
writer.write(t);
|
||||
writer.newLine();
|
||||
}
|
||||
writer.flush();
|
||||
writer.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
log.info("[uuid:{}]执行完成,耗时:{}毫秒", uuid, end - start);
|
||||
}
|
||||
}
|
||||
//package com.nm.gsgl.test;
|
||||
//
|
||||
//import com.nm.gsgl.common.utils.DbfWriterAndReadUtil;
|
||||
//import com.nm.gsgl.common.utils.UuidUtil;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//
|
||||
//import java.io.BufferedWriter;
|
||||
//import java.io.FileNotFoundException;
|
||||
//import java.io.FileWriter;
|
||||
//import java.io.IOException;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.Collection;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//import java.util.stream.Collectors;
|
||||
//import java.util.stream.Stream;
|
||||
//
|
||||
///**
|
||||
// * @author: shuguang
|
||||
// * @date: 2023年07月27日 16:02
|
||||
// * @description:
|
||||
// */
|
||||
//@Slf4j
|
||||
//public class Test04 {
|
||||
// public static void main(String[] args) throws IOException {
|
||||
// ////String s = Integer.toBinaryString(4);
|
||||
// ////十进制转二进制
|
||||
// //String s = Integer.toBinaryString(24);
|
||||
// //System.out.println(s);
|
||||
// String uuid = UuidUtil.getUuid();
|
||||
// log.info("[uuid:{}]当前时间={}", uuid, LocalDateTime.now());
|
||||
// long start = System.currentTimeMillis();
|
||||
// String dbfPath= "D:\\桌面\\增量\\20230727110001_CARDBLACKLISTINC.DBF";
|
||||
// List<Map<String, Object>> mapList = DbfWriterAndReadUtil.readDbf(dbfPath, "UTF-8");
|
||||
// System.out.println("=========================");
|
||||
// System.out.println(mapList.size());
|
||||
// String dbfPath2= "D:\\桌面\\增量\\20230727110647_TB_CARDBLACKINC_20230727110002_230727114.DBF";
|
||||
// List<Map<String, Object>> mapList2 = DbfWriterAndReadUtil.readDbf(dbfPath2, "UTF-8");
|
||||
// System.out.println("=========================");
|
||||
// System.out.println(mapList2.size());
|
||||
// List<Map<String, Object>> mapList3 = Stream.of(mapList,mapList2)
|
||||
// .flatMap(Collection::stream)
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
// System.out.println("=========================");
|
||||
// System.out.println(mapList3.size());
|
||||
// FileWriter outFile = null;
|
||||
// BufferedWriter writer = null;
|
||||
//
|
||||
// try {
|
||||
// outFile = new FileWriter("D:\\桌面\\增量\\test.txt");
|
||||
// writer= new BufferedWriter(outFile);
|
||||
// for (Map<String, Object> maps : mapList3) {
|
||||
// String t = "";
|
||||
// for (String key : maps.keySet()) {
|
||||
// t += maps.get(key) + "\t\n";
|
||||
// }
|
||||
// t = t.substring(0, t.length() - 1);
|
||||
// writer.write(t);
|
||||
// writer.newLine();
|
||||
// }
|
||||
// writer.flush();
|
||||
// writer.close();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// long end = System.currentTimeMillis();
|
||||
// log.info("[uuid:{}]执行完成,耗时:{}毫秒", uuid, end - start);
|
||||
// }
|
||||
//}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue