通联卡扣添加日志及修改

This commit is contained in:
yjf 2023-09-12 10:04:43 +08:00
parent 2fef19f665
commit ef4ebbd986
2 changed files with 33 additions and 47 deletions

View File

@ -57,59 +57,43 @@ public class AllinpayPaymentQueryRun implements Runnable{
Map<String, String> mapXml = new HashMap<String, String>();
try {
BizObjectManager bomLCP = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_CARD_PAYMENT");
int start = 0;
int maxCount = 100;
List<BizObject> boLOEDs=null;
int size = bomLCP.createQuery("O.STATUS='正在处理' ").getTotalCount();
if (size == 0) {
logger.info("没有需要查询的通联支付信息");
List<BizObject> boLOEDs = bomLCP.createQuery("O.STATUS='正在处理'").getResultList(true);
if (boLOEDs == null || boLOEDs.size() == 0) {
logger.error("没有需要查询的通联支付信息");
return;
}
while (size > start) {
logger.info("开始第" + start + "" + (start + maxCount) + "次循环");
boLOEDs = bomLCP.createQuery("O.STATUS='正在处理' ").setFirstResult(start).setMaxResults(maxCount).getResultList(true);
for (BizObject boLCP : boLOEDs) {
try {
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO").createQuery("O.id=:id").setParameter("id", boLCP.getAttribute("PROJECT_ID").toString()).getSingleResult(false);
allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
String quertSn = boLCP.getAttribute("REQ_SN").toString();
String num = boLCP.getAttribute("NUM").toString();
localFilePath = boLCP.getAttribute("FULLPATH").toString();
String time = DateAssistant.getTodayNow();
sqlMap.put("QUERYTIME", time);
sqlMap.put("NUM", Integer.parseInt(num) + "");
mapXml.put("quertSn", quertSn);
sqlMap = sendMessageByProxy(mapXml, sqlMap);
if (boLOEDs == null || boLOEDs.size() == 0) {
logger.error("没有需要查询的通联支付信息>>>>>>>>>>:");
break;
}
for (BizObject boLCP : boLOEDs) {
try {
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO").createQuery("O.id=:id").setParameter("id", boLCP.getAttribute("PROJECT_ID").toString()).getSingleResult(false);
allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
String quertSn= boLCP.getAttribute("REQ_SN").toString();
String num = boLCP.getAttribute("NUM").toString();
localFilePath = boLCP.getAttribute("FULLPATH").toString();
String time = DateAssistant.getTodayNow();
sqlMap.put("QUERYTIME", time);
sqlMap.put("NUM", Integer.parseInt(num) + "");
mapXml.put("quertSn", quertSn);
sqlMap = sendMessageByProxy(mapXml, sqlMap);
if (localFilePath == null) {
LocalDateTime ldt = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
localFilePath = ConfigConstant.filePath.replaceAll("\\{uuid\\}",UUIDUtil.getUUID()).replaceAll("\\{YYYYMMDD\\}", dtf.format(ldt));
sqlMap.put("FULLPATH", localFilePath);
}
saveRequestTxt(sqlMap);
updateMessage(bomLCP, boLCP, sqlMap);
localFilePath = null;
} catch (Exception e) {
logger.error(">>>>>>>>>>>通联支付结果查询失败>>>>>>>>id:" +boLCP.getAttribute("id").toString());
e.printStackTrace();
}finally {
sqlMap.clear();
mapXml.clear();
if (localFilePath == null) {
LocalDateTime ldt = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
localFilePath = ConfigConstant.filePath.replaceAll("\\{uuid\\}", UUIDUtil.getUUID()).replaceAll("\\{YYYYMMDD\\}", dtf.format(ldt));
sqlMap.put("FULLPATH", localFilePath);
}
saveRequestTxt(sqlMap);//记录日志文件 文件路径 LC_CARD_PAYMENT:FULLPATH
updateMessage(bomLCP, boLCP, sqlMap);
localFilePath = null;
} catch (Exception e) {
logger.error(">>>>>>>>>>>通联支付结果查询失败>>>>>>>>id:" + boLCP.getAttribute("id").toString());
e.printStackTrace();
} finally {
sqlMap.clear();
mapXml.clear();
}
boLOEDs=null;
start +=100;
}
} catch (Exception e) {
logger.error(">>>>>>>>>>>通联支付结果查询失败>>>>>>>>:");
logger.error(">>>>>>>>>>>通联支付结果查询失败>>>>>>>>");
e.printStackTrace();
}
logger.info(">>>>>>>>>>>结束通联支付结果查询>>>>>>>>");
@ -289,6 +273,7 @@ public class AllinpayPaymentQueryRun implements Runnable{
String collectMsg = boLRP.getAttribute("batch_status")==null?"":boLRP.getAttribute("collect_msg").toString();
if("处理成功".equals(status)&&boLCP.getAttribute("FINISH_AMOUNT")!=null&&!"".equals(boLCP.getAttribute("FINISH_AMOUNT").toString())){
//插入实收记录
insertMessage(boLRP,finishAmount,tx);
//租金计划表状态处理
BizObjectManager bomIncome = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME,tx);

View File

@ -81,9 +81,10 @@ public class AutoRefresh implements Job {
caTj.queryBatchCollectStatus(tx);
}
tx.commit();
QuartzUtil.insertLog(plan_date, "com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "银联成功", curUserId);
//通联卡扣回盘
new AllinpayPaymentQueryRun().allinpayPaymentQuerySt();
QuartzUtil.insertLog(plan_date, "com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "成功", curUserId);
QuartzUtil.insertLog(plan_date, "com.tenwa.lease.app.quartzmession.AutoRefresh", "success", "通联成功", curUserId);
} catch (Exception e) {
if (tx != null) tx.rollback();
e.printStackTrace();