Merge remote-tracking branch 'origin/sw' into sw
# Conflicts: # base-buildpackage/src/main/java/com/hzya/frame/plugin/BackUpDatabase/plugin/BackUpDatabaseInitializer.java
This commit is contained in:
commit
dd0388e01f
|
@ -5,13 +5,13 @@ import com.hzya.frame.base.PluginBaseEntity;
|
||||||
import com.hzya.frame.web.entity.BaseResult;
|
import com.hzya.frame.web.entity.BaseResult;
|
||||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||||
|
|
||||||
//import com.jcraft.jsch.Channel;
|
/*import com.jcraft.jsch.Channel;
|
||||||
//import com.jcraft.jsch.ChannelSftp;
|
import com.jcraft.jsch.ChannelSftp;
|
||||||
//import com.jcraft.jsch.JSch;
|
import com.jcraft.jsch.JSch;
|
||||||
//import com.jcraft.jsch.Session;
|
import com.jcraft.jsch.Session;
|
||||||
//import com.jcraft.jsch.SftpATTRS;
|
import com.jcraft.jsch.SftpATTRS;
|
||||||
//import com.jcraft.jsch.SftpException;
|
import com.jcraft.jsch.SftpException;
|
||||||
//import org.apache.commons.net.ftp.FTPClient;
|
import org.apache.commons.net.ftp.FTPClient;*/
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
@ -107,12 +107,12 @@ public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||||
private String sftpFilePase;
|
private String sftpFilePase;
|
||||||
|
|
||||||
|
|
||||||
// private ChannelSftp sftp = null;
|
/*private ChannelSftp sftp = null;
|
||||||
// private Session sshSession = null;
|
private Session sshSession = null;*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
public JsonResultEntity executeBusiness(JSONObject requestJson) {
|
||||||
try {
|
/* try {
|
||||||
if(filePase == null || "".equals(filePase)
|
if(filePase == null || "".equals(filePase)
|
||||||
|| databaseName == null || "".equals(databaseName)
|
|| databaseName == null || "".equals(databaseName)
|
||||||
|| fileName == null || "".equals(fileName)
|
|| fileName == null || "".equals(fileName)
|
||||||
|
@ -185,14 +185,14 @@ public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
*//**
|
||||||
* @Author lvleigang
|
* @Author lvleigang
|
||||||
* @Description 创建目录及文件
|
* @Description 创建目录及文件
|
||||||
* @Date 8:59 上午 2024/10/22
|
* @Date 8:59 上午 2024/10/22
|
||||||
* @param filePath
|
* @param filePath
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* @return java.io.File
|
* @return java.io.File
|
||||||
**/
|
**//*
|
||||||
public File creatFile(String filePath, String fileName) {
|
public File creatFile(String filePath, String fileName) {
|
||||||
File folder = new File(filePath);
|
File folder = new File(filePath);
|
||||||
//文件夹路径不存在
|
//文件夹路径不存在
|
||||||
|
@ -224,57 +224,57 @@ public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connect() {
|
public void connect() {
|
||||||
// try {
|
try {
|
||||||
// JSch jsch = new JSch();
|
JSch jsch = new JSch();
|
||||||
// jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
||||||
// sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
sshSession = jsch.getSession(sftpUsername, sftpHost, sftpPort);
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("Session created.");
|
logger.info("Session created.");
|
||||||
// }
|
}
|
||||||
// sshSession.setPassword(sftpPassword);
|
sshSession.setPassword(sftpPassword);
|
||||||
// Properties sshConfig = new Properties();
|
Properties sshConfig = new Properties();
|
||||||
// sshConfig.put("StrictHostKeyChecking", "no");
|
sshConfig.put("StrictHostKeyChecking", "no");
|
||||||
// sshSession.setConfig(sshConfig);
|
sshSession.setConfig(sshConfig);
|
||||||
// sshSession.connect();
|
sshSession.connect();
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("Session connected.");
|
logger.info("Session connected.");
|
||||||
// }
|
}
|
||||||
// Channel channel = sshSession.openChannel("sftp");
|
Channel channel = sshSession.openChannel("sftp");
|
||||||
// channel.connect();
|
channel.connect();
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("Opening Channel.");
|
logger.info("Opening Channel.");
|
||||||
// }
|
}
|
||||||
// sftp = (ChannelSftp) channel;
|
sftp = (ChannelSftp) channel;
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("Connected to " + host + ".");
|
logger.info("Connected to " + host + ".");
|
||||||
// }
|
}
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 关闭连接
|
* 关闭连接
|
||||||
*/
|
*//*
|
||||||
public void disconnect() {
|
public void disconnect() {
|
||||||
// if (this.sftp != null) {
|
if (this.sftp != null) {
|
||||||
// if (this.sftp.isConnected()) {
|
if (this.sftp.isConnected()) {
|
||||||
// this.sftp.disconnect();
|
this.sftp.disconnect();
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("sftp is closed already");
|
logger.info("sftp is closed already");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// if (this.sshSession != null) {
|
if (this.sshSession != null) {
|
||||||
// if (this.sshSession.isConnected()) {
|
if (this.sshSession.isConnected()) {
|
||||||
// this.sshSession.disconnect();
|
this.sshSession.disconnect();
|
||||||
// if (logger.isInfoEnabled()) {
|
if (logger.isInfoEnabled()) {
|
||||||
// logger.info("sshSession is closed already");
|
logger.info("sshSession is closed already");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 上传单个文件
|
* 上传单个文件
|
||||||
*
|
*
|
||||||
* @param remotePath:远程保存目录
|
* @param remotePath:远程保存目录
|
||||||
|
@ -282,91 +282,91 @@ public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||||
* @param localPath:本地上传目录(以路径符号结束)
|
* @param localPath:本地上传目录(以路径符号结束)
|
||||||
* @param localFileName:上传的文件名
|
* @param localFileName:上传的文件名
|
||||||
* @return
|
* @return
|
||||||
*/
|
*//*
|
||||||
public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) {
|
public boolean uploadFile(String remotePath, String remoteFileName, String localPath, String localFileName) {
|
||||||
// FileInputStream in = null;
|
FileInputStream in = null;
|
||||||
// try {
|
try {
|
||||||
// createDir(remotePath);
|
createDir(remotePath);
|
||||||
// File file = new File(localPath + File.separator + localFileName);
|
File file = new File(localPath + File.separator + localFileName);
|
||||||
// in = new FileInputStream(file);
|
in = new FileInputStream(file);
|
||||||
// sftp.put(in, remoteFileName, 65536);
|
sftp.put(in, remoteFileName, 65536);
|
||||||
// return true;
|
return true;
|
||||||
// } catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
// } catch (SftpException e) {
|
} catch (SftpException e) {
|
||||||
// } finally {
|
} finally {
|
||||||
// if (in != null) {
|
if (in != null) {
|
||||||
// try {
|
try {
|
||||||
// in.close();
|
in.close();
|
||||||
// } catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 创建目录
|
* 创建目录
|
||||||
*
|
*
|
||||||
* @param createpath
|
* @param createpath
|
||||||
* @return
|
* @return
|
||||||
*/
|
*//*
|
||||||
public boolean createDir(String createpath) {
|
public boolean createDir(String createpath) {
|
||||||
// try {
|
try {
|
||||||
// if (isDirExist(createpath)) {
|
if (isDirExist(createpath)) {
|
||||||
// this.sftp.cd(createpath);
|
this.sftp.cd(createpath);
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
// String pathArry[] = createpath.split("/");
|
String pathArry[] = createpath.split("/");
|
||||||
// StringBuffer filePath = new StringBuffer("/");
|
StringBuffer filePath = new StringBuffer("/");
|
||||||
// for (String path : pathArry) {
|
for (String path : pathArry) {
|
||||||
// if (path.equals("")) {
|
if (path.equals("")) {
|
||||||
// continue;
|
continue;
|
||||||
// }
|
}
|
||||||
// filePath.append(path + "/");
|
filePath.append(path + "/");
|
||||||
// if (isDirExist(filePath.toString())) {
|
if (isDirExist(filePath.toString())) {
|
||||||
// sftp.cd(filePath.toString());
|
sftp.cd(filePath.toString());
|
||||||
// } else {
|
} else {
|
||||||
// // 建立目录
|
// 建立目录
|
||||||
// sftp.mkdir(filePath.toString());
|
sftp.mkdir(filePath.toString());
|
||||||
// // 进入并设置为当前目录
|
// 进入并设置为当前目录
|
||||||
// sftp.cd(filePath.toString());
|
sftp.cd(filePath.toString());
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
// this.sftp.cd(createpath);
|
this.sftp.cd(createpath);
|
||||||
// return true;
|
return true;
|
||||||
// } catch (SftpException e) {
|
} catch (SftpException e) {
|
||||||
// }
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 判断目录是否存在
|
* 判断目录是否存在
|
||||||
*
|
*
|
||||||
* @param directory
|
* @param directory
|
||||||
* @return
|
* @return
|
||||||
*/
|
*//*
|
||||||
public boolean isDirExist(String directory) {
|
public boolean isDirExist(String directory) {
|
||||||
boolean isDirExistFlag = false;
|
boolean isDirExistFlag = false;
|
||||||
// try {
|
try {
|
||||||
// SftpATTRS sftpATTRS = sftp.lstat(directory);
|
SftpATTRS sftpATTRS = sftp.lstat(directory);
|
||||||
// isDirExistFlag = true;
|
isDirExistFlag = true;
|
||||||
// return sftpATTRS.isDir();
|
return sftpATTRS.isDir();
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// if (e.getMessage().toLowerCase().equals("no such file")) {
|
if (e.getMessage().toLowerCase().equals("no such file")) {
|
||||||
// isDirExistFlag = false;
|
isDirExistFlag = false;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
return isDirExistFlag;
|
return isDirExistFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
*//**
|
||||||
* 如果目录不存在就创建目录
|
* 如果目录不存在就创建目录
|
||||||
*
|
*
|
||||||
* @param path
|
* @param path
|
||||||
*/
|
*//*
|
||||||
public void mkdirs(String path) {
|
public void mkdirs(String path) {
|
||||||
File f = new File(path);
|
File f = new File(path);
|
||||||
|
|
||||||
|
@ -376,7 +376,8 @@ public class BackUpDatabaseInitializer extends PluginBaseEntity {
|
||||||
|
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
f.mkdirs();
|
f.mkdirs();
|
||||||
}
|
}*/
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,24 @@ public class ServiceDataEntity extends BaseEntity {
|
||||||
|
|
||||||
private String summary_id;//summary_id
|
private String summary_id;//summary_id
|
||||||
|
|
||||||
|
private String bipAmountField;//BIP打款金额字段
|
||||||
|
private String bipAmount;//BIP打款金额
|
||||||
|
|
||||||
|
public String getBipAmountField() {
|
||||||
|
return bipAmountField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBipAmountField(String bipAmountField) {
|
||||||
|
this.bipAmountField = bipAmountField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBipAmount() {
|
||||||
|
return bipAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBipAmount(String bipAmount) {
|
||||||
|
this.bipAmount = bipAmount;
|
||||||
|
}
|
||||||
|
|
||||||
public String getSummary_id() {
|
public String getSummary_id() {
|
||||||
return summary_id;
|
return summary_id;
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
,summary_id
|
,summary_id
|
||||||
,bip_payment_number_field as bipPaymentNumberField
|
,bip_payment_number_field as bipPaymentNumberField
|
||||||
,bip_payment_number as bipPaymentNumber
|
,bip_payment_number as bipPaymentNumber
|
||||||
|
,bip_amount_field as bipAmountField
|
||||||
|
,bip_amount as bipAmount
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="entity_list_base" resultMap="get-ServiceDataEntity-result" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity">
|
<select id="entity_list_base" resultMap="get-ServiceDataEntity-result" parameterType = "com.hzya.frame.sysnew.comparison.serviceData.entity.ServiceDataEntity">
|
||||||
|
@ -89,6 +91,7 @@
|
||||||
update ${tabName} set
|
update ${tabName} set
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="payDate != null and payDate != ''"> ${payDateFiled} = #{payDate},</if>
|
<if test="payDate != null and payDate != ''"> ${payDateFiled} = #{payDate},</if>
|
||||||
|
<if test="bipAmount != null and bipAmount != ''"> ${bipAmountField} = #{bipAmount},</if>
|
||||||
<if test="payResult != null and payResult != ''"> ${payResultFiled} = #{payResult}</if>
|
<if test="payResult != null and payResult != ''"> ${payResultFiled} = #{payResult}</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id=#{id}
|
where id=#{id}
|
||||||
|
|
|
@ -162,6 +162,7 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
||||||
if (jsonObject.getString("billCode").equals(serviceDataEntity.getBillCode())) {
|
if (jsonObject.getString("billCode").equals(serviceDataEntity.getBillCode())) {
|
||||||
serviceDataEntity.setPayResult(jsonObject.getString("payResult"));
|
serviceDataEntity.setPayResult(jsonObject.getString("payResult"));
|
||||||
serviceDataEntity.setPayDate(jsonObject.getString("payDate"));
|
serviceDataEntity.setPayDate(jsonObject.getString("payDate"));
|
||||||
|
serviceDataEntity.setBipAmount(jsonObject.getString("bipAmount"));
|
||||||
serviceDataEntity.setDataSourceCode(jsonObject.getString("dataSourceCode"));
|
serviceDataEntity.setDataSourceCode(jsonObject.getString("dataSourceCode"));
|
||||||
logger.info("====开始根据单据号:{},表名称:{},表单id:{}更新支付状态和时间======", serviceDataEntity.getBillCode(), serviceDataEntity.getTabName(), serviceDataEntity.getId());
|
logger.info("====开始根据单据号:{},表名称:{},表单id:{}更新支付状态和时间======", serviceDataEntity.getBillCode(), serviceDataEntity.getTabName(), serviceDataEntity.getId());
|
||||||
integer = serviceDataDao.updatePayResult(serviceDataEntity);
|
integer = serviceDataDao.updatePayResult(serviceDataEntity);
|
||||||
|
@ -292,7 +293,7 @@ public class ServiceDataServiceImpl extends BaseService<ComparisonEntity,String>
|
||||||
try {
|
try {
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("select oa_id as data_id,tab_name,title,pay_company,bill_name,pay_result_field,pay_date_field,receipt_filed,\n" +
|
stringBuffer.append("select oa_id as data_id,tab_name,title,pay_company,bill_name,pay_result_field,pay_date_field,receipt_filed,\n" +
|
||||||
"push_status_field,summary_id,bip_payment_number_field,\n" +
|
"push_status_field,summary_id,bip_payment_number_field,bip_amount_field,\n" +
|
||||||
"vdef1,pk_acceptorg,creator,pk_group,pk_org,applydate,pk_trantypecode,pk_busitype,vdef2,pk_currtype,\n" +
|
"vdef1,pk_acceptorg,creator,pk_group,pk_org,applydate,pk_trantypecode,pk_busitype,vdef2,pk_currtype,\n" +
|
||||||
"pk_supplier,pk_bankacc_r,pk_bankacc_p,pk_decidedept,vdef10,vdef12,vdef3,vdef4,vdef5,vdef6,applysum,\n" +
|
"pk_supplier,pk_bankacc_r,pk_bankacc_p,pk_decidedept,vdef10,vdef12,vdef3,vdef4,vdef5,vdef6,applysum,\n" +
|
||||||
"vdef7,vdef8,vdef9 from v_cmp_apply where 1=1 and vdef1 is not null and push_status is null and applysum >0");
|
"vdef7,vdef8,vdef9 from v_cmp_apply where 1=1 and vdef1 is not null and push_status is null and applysum >0");
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -14,9 +14,9 @@
|
||||||
<!-- <module>fw-nc</module>-->
|
<!-- <module>fw-nc</module>-->
|
||||||
<!-- <module>fw-ncc</module>-->
|
<!-- <module>fw-ncc</module>-->
|
||||||
<!-- <module>fw-ningbobank</module>-->
|
<!-- <module>fw-ningbobank</module>-->
|
||||||
<!-- <module>fw-oa</module>-->
|
<module>fw-oa</module>
|
||||||
<!-- <module>fw-u8</module>-->
|
<!-- <module>fw-u8</module>-->
|
||||||
<!-- <module>fw-u8c</module>-->
|
<module>fw-u8c</module>
|
||||||
<!-- <module>fw-u9c</module>-->
|
<!-- <module>fw-u9c</module>-->
|
||||||
</modules>
|
</modules>
|
||||||
<groupId>com.hzya.frame</groupId>
|
<groupId>com.hzya.frame</groupId>
|
||||||
|
|
Loading…
Reference in New Issue