Commit b0b8fd9f by wangnb

代码变量前面去掉this--think.wang

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@27088 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 1ec540e3
......@@ -47,7 +47,7 @@ public class OraReturnInsurancePdfTask implements Runnable{
@Override
public void run() {
try {
this.semaphore.acquire();
semaphore.acquire();
//系统参数获取
String oraUrl = PropertiesUtil.getProperty("ora.api.url");
String appKey = PropertiesUtil.getProperty("ora.appKey");
......@@ -56,13 +56,13 @@ public class OraReturnInsurancePdfTask implements Runnable{
String format = PropertiesUtil.getProperty("ora.format");
String method = PropertiesUtil.getProperty("ora.insurance.updateOrder");
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
if(insurancePolicy == null){
this.logger.error("通过id={}未找到保单数据", id);
logger.error("通过id={}未找到保单数据", id);
return;
}
if(insurancePolicy.getStatus().byteValue() != InsuranceStatus.APPLIED.getStatus()){
this.logger.error("id={}保单数据未成功投保", id);
logger.error("id={}保单数据未成功投保", id);
return;
}
//业务参数封装
......@@ -73,7 +73,7 @@ public class OraReturnInsurancePdfTask implements Runnable{
object.put("startTime",startTime);
object.put("endTime",DateUtil.addMonthDate(startTime, insurancePolicy.getInsurancePeriod(), "yyyy-MM-dd 00:00:00"));
String params = JSON.toJSONString(object);
this.logger.info("回传pdf路径给欧拉业务参数:{}", params);
logger.info("回传pdf路径给欧拉业务参数:{}", params);
Map<String, String> map = new HashMap<>();
//系统参数封装
......@@ -97,25 +97,25 @@ public class OraReturnInsurancePdfTask implements Runnable{
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
HttpUtils httpUtils = new HttpUtils();
result = httpUtils.postJson(urlBuf.toString(), params);
this.logger.info("保单号:{}回传保单响应数据:{}", insurancePolicy.getInsuranceNo() , result);
logger.info("保单号:{}回传保单响应数据:{}", insurancePolicy.getInsuranceNo() , result);
OraResultObject oreResult = JSON.parseObject(result, OraResultObject.class);
if("0".equals(oreResult.getCode())){
break;
}
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
} catch (Exception e) {
this.logger.error("调用欧拉接口回传保单接口异常:{}", e);
logger.error("调用欧拉接口回传保单接口异常:{}", e);
}finally {
this.semaphore.release();
semaphore.release();
}
}
......
......@@ -65,11 +65,11 @@ public class OraReturnOrderSetupTask implements Runnable {
SysOrder order = orderMapper.selectByPrimaryKey(id);
if (order == null) {
this.logger.error("通过id={}未找到工单数据", id);
logger.error("通过id={}未找到工单数据", id);
return;
}
//业务参数封装
JSONObject object = this.setBusinessParams(order);
JSONObject object = setBusinessParams(order);
String params = JSON.toJSONString(object);
logger.info("回传工单安装结果业务参数为:{}", params);
......@@ -95,7 +95,7 @@ public class OraReturnOrderSetupTask implements Runnable {
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
HttpUtils httpUtils = new HttpUtils();
......@@ -106,7 +106,7 @@ public class OraReturnOrderSetupTask implements Runnable {
break;
}
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
......
......@@ -58,11 +58,11 @@ public class OraReturnReserveOrderInfoTask implements Runnable{
SysOrder order = orderMapper.selectByPrimaryKey(id);
if(order == null){
this.logger.error("通过id={}未找到工单数据", id);
logger.error("通过id={}未找到工单数据", id);
return;
}
//业务参数封装
JSONObject object = this.setBusinessParams(order);
JSONObject object = setBusinessParams(order);
String params = JSON.toJSONString(object);
logger.info("预约信息修改业务参数为:{}", params);
......@@ -88,7 +88,7 @@ public class OraReturnReserveOrderInfoTask implements Runnable{
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
HttpUtils httpUtils = new HttpUtils();
......@@ -99,7 +99,7 @@ public class OraReturnReserveOrderInfoTask implements Runnable{
break;
}
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
......
......@@ -47,7 +47,7 @@ public class TspGetInsurancePdfTask implements Runnable{
@Override
public void run() {
try {
this.semaphore.acquire();
semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.pdf"); //调用获取pdf方法
......@@ -57,13 +57,13 @@ public class TspGetInsurancePdfTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
if(insurancePolicy == null){
this.logger.error("通过id={}未找到保单数据", id);
logger.error("通过id={}未找到保单数据", id);
return;
}
if(insurancePolicy.getStatus().byteValue() != InsuranceStatus.APPLIED.getStatus()){
this.logger.error("id={}保单数据未成功投保", id);
logger.error("id={}保单数据未成功投保", id);
return;
}
//业务参数封装
......@@ -71,7 +71,7 @@ public class TspGetInsurancePdfTask implements Runnable{
map.put("insuranceCompany", insurancePolicy.getInsuranceCompany());
map.put("fullInsuranceNo", insurancePolicy.getInsuranceNo());
map.put("seqNo", insurancePolicy.getInsuranceSeqNo());
this.logger.info("获取pdf业务参数为:{}", map);
logger.info("获取pdf业务参数为:{}", map);
//系统参数封装
map.put("method", method);
......@@ -85,31 +85,31 @@ public class TspGetInsurancePdfTask implements Runnable{
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
this.logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result);
logger.info("保单号:{}获取pdf信息响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(this.id);
policy.setId(id);
TspRespData respData = tspResp.getData();
policy.setInsurancePdf(respData.getObj()); //得到pdf路径
this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
}else{
this.logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo"));
logger.error("获取保单pdf失败,保单号为:{}", map.get("fullInsuranceNo"));
}
} catch (Exception e) {
this.logger.error("调用TSP获取pdf接口异常:{}", e);
logger.error("调用TSP获取pdf接口异常:{}", e);
}finally {
this.semaphore.release();
semaphore.release();
}
}
......
......@@ -53,7 +53,7 @@ public class TspSaveInsuranceDataTask implements Runnable{
@Override
public void run() {
try {
this.semaphore.acquire();
semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.save"); //调用投保方法
......@@ -63,15 +63,15 @@ public class TspSaveInsuranceDataTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
if(insurancePolicy == null){
this.logger.error("通过id={}未找到保单数据", id);
logger.error("通过id={}未找到保单数据", id);
return;
}
//业务参数封装
TspSaveReq saveData = this.setSendData(insurancePolicy);
TspSaveReq saveData = setSendData(insurancePolicy);
//对象转map进行签名
this.logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData));
logger.info("投保签名的对象为:{}", JSON.toJSONString(saveData));
Map<String, String> map = ObjectUtils.objectToMap(saveData);
//系统参数封装
......@@ -86,17 +86,17 @@ public class TspSaveInsuranceDataTask implements Runnable{
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
this.logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result);
logger.info("车架号:{}投保响应数据:{}", map.get("standNo"), result);
SysInsurancePolicy policy = new SysInsurancePolicy();
policy.setId(id);
Date now = new Date();
......@@ -113,11 +113,11 @@ public class TspSaveInsuranceDataTask implements Runnable{
}
policy.setUpdateTime(now);
policy.setUpdateBy(0);
this.policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
policyMapper.updateByPrimaryKeySelective(policy); //保存返回数据
} catch (Exception e) {
this.logger.error("调用TSP投保接口异常:{}", e);
logger.error("调用TSP投保接口异常:{}", e);
}finally {
this.semaphore.release();
semaphore.release();
}
}
......
......@@ -49,7 +49,7 @@ public class TspUpdateInsuranceDataTask implements Runnable{
@Override
public void run() {
try {
this.semaphore.acquire();
semaphore.acquire();
//系统参数获取
String insuranceUrl = PropertiesUtil.getProperty("insurance.picc.url");
String method = PropertiesUtil.getProperty("insurance.picc.update"); //修改保单方法
......@@ -59,15 +59,15 @@ public class TspUpdateInsuranceDataTask implements Runnable{
String format = PropertiesUtil.getProperty("insurance.picc.format");
String source = PropertiesUtil.getProperty("insurance.picc.source");
SysInsurancePolicy insurancePolicy = this.policyMapper.selectByPrimaryKey(id);
SysInsurancePolicy insurancePolicy = policyMapper.selectByPrimaryKey(id);
if(insurancePolicy == null){
this.logger.error("通过id={}未找到保单数据", id);
logger.error("通过id={}未找到保单数据", id);
return;
}
//业务参数封装
TspUpdateReq updateData = this.setSendData(insurancePolicy);
TspUpdateReq updateData = setSendData(insurancePolicy);
//对象转map进行签名
this.logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData));
logger.info("修改保单签名的对象为:{}", JSON.toJSONString(updateData));
Map<String, String> map = ObjectUtils.objectToMap(updateData);
//系统参数封装
......@@ -82,27 +82,27 @@ public class TspUpdateInsuranceDataTask implements Runnable{
//发送请求
String result = null;
int tryCount = this.TRY_COUNT;
int tryCount = TRY_COUNT;
while (tryCount-- > 0) {
try {
result = HttpUtil.postData(insuranceUrl, JSON.toJSONString(map), ContentType.APPLICATION_JSON);
break;
} catch (Exception e) {
Thread.sleep(this.TRY_WAIT_TIME);
Thread.sleep(TRY_WAIT_TIME);
continue;
}
}
this.logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result);
logger.info("保单号:{}修改投保响应数据:{}", map.get("fullInsuranceNo"), result);
TspResp tspResp = JSON.parseObject(result, TspResp.class);
if(tspResp != null && "0".equals(tspResp.getCode())){ //请求成功
this.logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo"));
logger.info("修改保单数据成功,保单号为:{}", map.get("fullInsuranceNo"));
}else{
this.logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo"));
logger.error("修改保单数据失败,保单号为:{}", map.get("fullInsuranceNo"));
}
} catch (Exception e) {
this.logger.error("调用TSP投保接口异常:{}", e);
logger.error("调用TSP投保接口异常:{}", e);
}finally {
this.semaphore.release();
semaphore.release();
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!