|
|
|
@ -14,6 +14,7 @@ import com.nmgs.mapper.GreenTrafficCheckResultMapper;
|
|
|
|
import com.nmgs.mapper.GreenTrafficMapper;
|
|
|
|
import com.nmgs.mapper.GreenTrafficMapper;
|
|
|
|
import com.nmgs.service.IGreenTrafficService;
|
|
|
|
import com.nmgs.service.IGreenTrafficService;
|
|
|
|
import com.nmgs.util.PropertiesUtil;
|
|
|
|
import com.nmgs.util.PropertiesUtil;
|
|
|
|
|
|
|
|
import com.trkf.PasswordEncryption.PassWordUtils;
|
|
|
|
import org.apache.commons.codec.Charsets;
|
|
|
|
import org.apache.commons.codec.Charsets;
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
import org.apache.cxf.endpoint.Client;
|
|
|
|
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
|
|
|
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
|
|
|
@ -23,6 +24,7 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -268,7 +270,6 @@ public class GreenTrafficServiceImpl implements IGreenTrafficService {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//从配置文件中读取数据库连接类型
|
|
|
|
//从配置文件中读取数据库连接类型
|
|
|
|
params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
|
|
|
|
params.put("DBTYPE", PropertiesUtil.getValue("DBType"));
|
|
|
|
|
|
|
|
|
|
|
|
@ -280,10 +281,10 @@ public class GreenTrafficServiceImpl implements IGreenTrafficService {
|
|
|
|
throw new Exception("绿通流水号为空");
|
|
|
|
throw new Exception("绿通流水号为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//定义循环次数,先定义5次
|
|
|
|
//定义每次取图片的线程数,先定义5次
|
|
|
|
int taskCount = 5; // 任务数量
|
|
|
|
int taskCount = 5; // 任务数量
|
|
|
|
|
|
|
|
|
|
|
|
//定义是第几次取
|
|
|
|
//定义是第几轮次取图片
|
|
|
|
int round = 1;
|
|
|
|
int round = 1;
|
|
|
|
|
|
|
|
|
|
|
|
//是否停止线程
|
|
|
|
//是否停止线程
|
|
|
|
@ -324,13 +325,13 @@ public class GreenTrafficServiceImpl implements IGreenTrafficService {
|
|
|
|
//执行线程
|
|
|
|
//执行线程
|
|
|
|
|
|
|
|
|
|
|
|
//定义每张图片要放置的位置,避免顺序错乱
|
|
|
|
//定义每张图片要放置的位置,避免顺序错乱
|
|
|
|
int finalI = i-1;
|
|
|
|
int picIndex = i-1;
|
|
|
|
greenTrafficThreadPool.execute( () -> {
|
|
|
|
greenTrafficThreadPool.execute( () -> {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//取出该位置的JSONArray,放置图片
|
|
|
|
//取出该位置的JSONArray,放置图片
|
|
|
|
JSONArray pic = (JSONArray) jsonArray.get(finalI);
|
|
|
|
JSONArray pic = (JSONArray) jsonArray.get(picIndex);
|
|
|
|
pic.set(1,getPic(paramsWebService));
|
|
|
|
pic.set(1,getPic(paramsWebService));
|
|
|
|
jsonArray.set(finalI,pic);
|
|
|
|
jsonArray.set(picIndex,pic);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.info("获取图片失败========"+e);
|
|
|
|
logger.info("获取图片失败========"+e);
|
|
|
|
@ -795,20 +796,11 @@ public class GreenTrafficServiceImpl implements IGreenTrafficService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*@Test
|
|
|
|
@Test
|
|
|
|
public void test() throws Exception{
|
|
|
|
public void test() throws Exception{
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
System.out.println(PassWordUtils.encrypt("nmjk90[]"));
|
|
|
|
params.put("listNO", "GetImgByListNO2");
|
|
|
|
System.out.println(PassWordUtils.decrypt("dnEoSz5AdTBybzZPdHU3VUtrYlBGZEoq"));
|
|
|
|
params.put("imgType", "1");
|
|
|
|
}
|
|
|
|
Client client = getClient(PropertiesUtil.getValue("LWZXCommonServiceUrl2"));
|
|
|
|
|
|
|
|
Object[] objects;
|
|
|
|
|
|
|
|
//json的形式
|
|
|
|
|
|
|
|
objects = client.invoke("GetWebServiceData", "10",new JSONObject(params).toString());
|
|
|
|
|
|
|
|
if (objects.length > 0) {
|
|
|
|
|
|
|
|
System.out.println(objects.toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static Client getClient(String path) {
|
|
|
|
public static Client getClient(String path) {
|
|
|
|
|