信用明细查询
This commit is contained in:
+8
-4
@@ -1604,6 +1604,7 @@ public class UserShipperApplicationService {
|
|||||||
// 根据查询结果同步数据
|
// 根据查询结果同步数据
|
||||||
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
|
com.alibaba.fastjson.JSONObject dataJson = resultJson.getJSONObject("data");
|
||||||
if (dataJson != null) {
|
if (dataJson != null) {
|
||||||
|
// 同步额度数据(limitdatas)
|
||||||
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
|
com.alibaba.fastjson.JSONArray limitdatas = dataJson.getJSONArray("limitdatas");
|
||||||
if (limitdatas != null && !limitdatas.isEmpty()) {
|
if (limitdatas != null && !limitdatas.isEmpty()) {
|
||||||
com.alibaba.fastjson.JSONObject limitData = limitdatas.getJSONObject(0);
|
com.alibaba.fastjson.JSONObject limitData = limitdatas.getJSONObject(0);
|
||||||
@@ -1612,8 +1613,13 @@ public class UserShipperApplicationService {
|
|||||||
userShipperEntity1.setAuthorizedUsedAmount(limitData.getBigDecimal("nengrossmny"));
|
userShipperEntity1.setAuthorizedUsedAmount(limitData.getBigDecimal("nengrossmny"));
|
||||||
userShipperEntity1.setSettlementCurrency(limitData.getString("currencycode"));
|
userShipperEntity1.setSettlementCurrency(limitData.getString("currencycode"));
|
||||||
userShipperEntity1.setCreditAmount(limitData.getBigDecimal("nbalancemny"));
|
userShipperEntity1.setCreditAmount(limitData.getBigDecimal("nbalancemny"));
|
||||||
|
userShipperMapper.updateById(userShipperEntity1);
|
||||||
|
log.info("更新货主额度同步成功,custcode={},shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
|
||||||
|
} else {
|
||||||
|
log.info("赊销额度查询无limitdatas返回,跳过额度更新,custcode={}", userShipperEntity1.getCustomerNcCode());
|
||||||
|
}
|
||||||
|
|
||||||
//关联明细表:同步agreedaydatas到agreement_details
|
// 同步协议明细(agreedaydatas),与limitdatas独立
|
||||||
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
|
com.alibaba.fastjson.JSONArray agreedaydatas = dataJson.getJSONArray("agreedaydatas");
|
||||||
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
|
if (agreedaydatas != null && !agreedaydatas.isEmpty()) {
|
||||||
// 先删除该货主已有的协议明细,避免重复
|
// 先删除该货主已有的协议明细,避免重复
|
||||||
@@ -1636,10 +1642,8 @@ public class UserShipperApplicationService {
|
|||||||
userShipperEntity1.setAgreementCount(i);
|
userShipperEntity1.setAgreementCount(i);
|
||||||
userShipperMapper.updateById(userShipperEntity1);
|
userShipperMapper.updateById(userShipperEntity1);
|
||||||
log.info("同步协议明细成功,custcode={},shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId(), agreedaydatas.size());
|
log.info("同步协议明细成功,custcode={},shipperId={},共{}条", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId(), agreedaydatas.size());
|
||||||
}
|
|
||||||
log.info("更新货主额度同步成功,custcode={},shipperId={}", userShipperEntity1.getCustomerNcCode(), userShipperEntity1.getShipperId());
|
|
||||||
} else {
|
} else {
|
||||||
log.info("赊销额度查询无limitdatas返回,跳过更新,custcode={}", userShipperEntity1.getCustomerNcCode());
|
log.info("赊销额度查询无agreedaydatas返回,跳过协议明细同步,custcode={}", userShipperEntity1.getCustomerNcCode());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("赊销额度查询无data返回,跳过更新,custcode={}", userShipperEntity1.getCustomerNcCode());
|
log.info("赊销额度查询无data返回,跳过更新,custcode={}", userShipperEntity1.getCustomerNcCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user