活动同步问题修复
This commit is contained in:
parent
accd09409d
commit
10fa6fd739
@ -186,8 +186,8 @@ public class BaseDao {
|
|||||||
int total=0;
|
int total=0;
|
||||||
Connection connection=getConnection(ip,username,password,portNumber,dataBaseName);
|
Connection connection=getConnection(ip,username,password,portNumber,dataBaseName);
|
||||||
try {
|
try {
|
||||||
String sql="select count(1) from t_pub_plan_detail_b d left join t_pub_plan_master m on " +
|
String sql="select count(1) from t_pub_plan_detail_b d left join t_pub_plan_master t on " +
|
||||||
" d.plan_no =m.plan_no %s";
|
" d.plan_no =t.plan_no %s";
|
||||||
sql=String.format(sql,where);
|
sql=String.format(sql,where);
|
||||||
log.info(sql);
|
log.info(sql);
|
||||||
PreparedStatement ps= connection.prepareStatement(sql);
|
PreparedStatement ps= connection.prepareStatement(sql);
|
||||||
|
|||||||
@ -178,8 +178,12 @@ public class SxDataDao extends BaseDao{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int getTBditemInfoJoninTotal(DataBaseInfo dataBaseInfo){
|
public int getTBditemInfoJoninTotal(DataBaseInfo dataBaseInfo){
|
||||||
|
String stockOperateWhere="";
|
||||||
|
if(StringUtils.isNotEmpty(dataBaseInfo.getStockOperateWhere())){
|
||||||
|
stockOperateWhere="where "+dataBaseInfo.getStockOperateWhere();
|
||||||
|
}
|
||||||
return getBaseGoodsJoinTotal(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
return getBaseGoodsJoinTotal(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
||||||
,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere(),"where "+dataBaseInfo.getStockOperateWhere());
|
,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere(),stockOperateWhere);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -200,8 +204,12 @@ public class SxDataDao extends BaseDao{
|
|||||||
* @param pageSize
|
* @param pageSize
|
||||||
*/
|
*/
|
||||||
public List<SxSyncGoods> findBditemInfoListPage(DataBaseInfo dataBaseInfo,int pageNo,int pageSize){
|
public List<SxSyncGoods> findBditemInfoListPage(DataBaseInfo dataBaseInfo,int pageNo,int pageSize){
|
||||||
|
String stockOperateWhere="";
|
||||||
|
if(StringUtils.isNotEmpty(dataBaseInfo.getStockOperateWhere())){
|
||||||
|
stockOperateWhere=" and "+dataBaseInfo.getStockOperateWhere();
|
||||||
|
}
|
||||||
ResultDto resultDto=baseFindGoodsListJoinPage(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
ResultDto resultDto=baseFindGoodsListJoinPage(dataBaseInfo.getIp(),dataBaseInfo.getUserName(),dataBaseInfo.getPassword(),dataBaseInfo.getDbPort(),dataBaseInfo.getDataBaseName()
|
||||||
,pageNo,pageSize,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere()," and "+dataBaseInfo.getStockOperateWhere());
|
,pageNo,pageSize,dataBaseInfo.getWhere()==null?DEFALTWHERE:dataBaseInfo.getWhere(),stockOperateWhere);
|
||||||
ResultSet rs= resultDto.getResultSet();
|
ResultSet rs= resultDto.getResultSet();
|
||||||
List<SxSyncGoods> sxSyncGoodses=new ArrayList<>();
|
List<SxSyncGoods> sxSyncGoodses=new ArrayList<>();
|
||||||
SxSyncGoods sxSyncGoods=null;
|
SxSyncGoods sxSyncGoods=null;
|
||||||
@ -1134,7 +1142,7 @@ public class SxDataDao extends BaseDao{
|
|||||||
,dataBaseInfo.getPassword()
|
,dataBaseInfo.getPassword()
|
||||||
,dataBaseInfo.getDbPort()
|
,dataBaseInfo.getDbPort()
|
||||||
,dataBaseInfo.getDataBaseName()
|
,dataBaseInfo.getDataBaseName()
|
||||||
,T_PUB_PLAN_MASTER
|
,T_PUB_PLAN_MASTER +" b"
|
||||||
,PLAN_NO
|
,PLAN_NO
|
||||||
,pageNo
|
,pageNo
|
||||||
,pageSize
|
,pageSize
|
||||||
|
|||||||
@ -22,31 +22,22 @@ import com.small.client.service.WebClientService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
|
||||||
import org.apache.http.impl.client.HttpClients;
|
|
||||||
import org.apache.http.impl.client.LaxRedirectStrategy;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.*;
|
import org.springframework.http.*;
|
||||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.MultiValueMap;
|
import org.springframework.util.MultiValueMap;
|
||||||
import org.springframework.util.StreamUtils;
|
import org.springframework.util.StreamUtils;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
import org.springframework.web.util.UriComponentsBuilder;
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
import javax.net.ssl.SSLContext;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.security.KeyManagementException;
|
|
||||||
import java.security.KeyStoreException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -694,7 +685,8 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
log.error("文件下载失败:{}",e.getMessage());
|
log.error("文件下载失败:{}",e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return downloadDirectory+originalFileName;
|
File file=new File(downloadDirectory+originalFileName);
|
||||||
|
return file.length()>0?downloadDirectory+originalFileName:null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -845,7 +837,7 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
String where="where 1=1";
|
String where="where 1=1";
|
||||||
Integer total =0;
|
Integer total =0;
|
||||||
if(StringUtils.isNotEmpty(commentModel.getSyncTime())){
|
if(StringUtils.isNotEmpty(commentModel.getSyncTime())){
|
||||||
where+=" and m.oper_date>'"+commentModel.getSyncTime()+"' ";
|
where+=" and t.oper_date>'"+commentModel.getSyncTime()+"' ";
|
||||||
// where+=" or m.oper_date>'"+commentModel.getSyncTime()+"') ";
|
// where+=" or m.oper_date>'"+commentModel.getSyncTime()+"') ";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,35 +890,4 @@ public class SxDataServiceImp extends SxDataAbstService implements SxDataService
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建跳过SSL验证的RestTemplate
|
|
||||||
* 仅用于测试环境,生产环境不安全
|
|
||||||
*/
|
|
||||||
private RestTemplate createUnsafeRestTemplate() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException {
|
|
||||||
// 配置请求参数
|
|
||||||
RequestConfig config = RequestConfig.custom()
|
|
||||||
.setConnectTimeout(30000)
|
|
||||||
.setSocketTimeout(30000)
|
|
||||||
.setRedirectsEnabled(true)
|
|
||||||
.setMaxRedirects(10)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 创建SSL上下文(信任所有证书 - 仅测试环境使用)
|
|
||||||
SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom()
|
|
||||||
.loadTrustMaterial((chain, authType) -> true)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 创建HttpClient,配置SSL和重定向
|
|
||||||
CloseableHttpClient httpClient = HttpClients.custom()
|
|
||||||
.setDefaultRequestConfig(config)
|
|
||||||
.setSSLContext(sslContext)
|
|
||||||
.setRedirectStrategy(new LaxRedirectStrategy())
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// 创建请求工厂
|
|
||||||
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
|
||||||
|
|
||||||
return new RestTemplate(factory);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user