执行及取消执行;nc推送客户nc编码查询逻辑修改;

This commit is contained in:
王奎兴
2026-06-26 18:27:24 +08:00
parent 293fedda12
commit 8893eda62d
28 changed files with 521 additions and 61 deletions
@@ -39,6 +39,8 @@ public interface ReconciliationMapper extends BaseMapper<Reconciliation>
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
String getSettlementCurrencyNcCode(@Param("settlementCurrency") String settlementCurrency);
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.linke.finance.domain.approvalDocument.entity.ApprovalDocument;
import com.linke.finance.domain.approvalDocument.repository.mapper.ApprovalDocumentMapper;
@@ -725,6 +727,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> list = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (list != null && list.size() > 0) {
Map<String, Object> targetMap = list.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String settlementCurrency=order.getSettlementCurrency();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
@@ -952,6 +974,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1008,6 +1034,27 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> list = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (list != null && list.size() > 0) {
Map<String, Object> targetMap = list.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String settlementCurrency=order.getSettlementCurrency();
String salesmanId = order.getSalesmanId();
String customerUserDept = reconciliationMapper.getCustomerUserDept(salesmanId);
@@ -1235,6 +1282,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1560,6 +1611,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
String settlementCurrency=order.getSettlementCurrency();
String settlementCurrencyNcCode = settlementCurrency;
@@ -1759,6 +1830,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -1844,6 +1919,26 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
String appointShipper=make.getActualInvoiceCustomerName();
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
String customerCodeNc = reconciliationMapper.getCustomerCodeNc(actualInvoiceCustomerId);
String customerCodeNcJson = reconciliationMapper.getCustomerCodeNcJson(actualInvoiceCustomerId);
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = objectMapper.readValue(
customerCodeNcJson,
new TypeReference<List<Map<String, Object>>>() {}
);
if (listNc != null && listNc.size() > 0) {
Map<String, Object> targetMap = listNc.stream()
.filter(map -> {
Object codeObj = map.get("code");
return codeObj != null && codeObj.toString().equals(reconciliation.getOrganizationId().toString());
})
.findFirst()
.orElse(null);
if (targetMap != null) {
customerCodeNc = (String) targetMap.get("ncCustomer");
}
}
}
String documentPreparerNcCode = reconciliationMapper.getDocumentPreparerNcCode(salesmanId);
String settlementCurrency=order.getSettlementCurrency();
String settlementCurrencyNcCode = settlementCurrency;
@@ -2046,6 +2141,10 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
reconciliation.setSynchronousStatus(2);
reconciliationMapper.updateById(reconciliation);
e.printStackTrace();
} catch (JsonMappingException e) {
throw new RuntimeException(e);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
return true;
}
@@ -373,6 +373,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT CUSTOMER_NC_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getCustomerCodeNcJson" parameterType="java.lang.String" resultType="java.lang.String">
SELECT ORG_CODE FROM NGWL_TEST_USER."USER_SHIPPER" where del_flag = 1 and SHIPPER_ID = #{actualInvoiceCustomerId} limit 1
</select>
<select id="getDocumentPreparerNcCode" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DOCUMENT_PREPARER_NC_CODE FROM NGWL_TEST_USER."USER" where del_flag = 1 and user_id = #{salesmanId} limit 1
</select>