Merge branch 'dev' into dev_v3.0.5
This commit is contained in:
+2
@@ -25,6 +25,8 @@ public interface BillManageMapper extends BaseMapper<BillManage>
|
||||
|
||||
String getCustomerCodeNc(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||
|
||||
String getCustomerCodeNcJson(@Param("actualInvoiceCustomerId") String actualInvoiceCustomerId);
|
||||
|
||||
String getDocumentPreparerNcCode(@Param("salesmanId") String salesmanId);
|
||||
|
||||
String getsalespersonNcCode(@Param("salesmanId") String salesmanId);
|
||||
|
||||
+53
@@ -1,9 +1,13 @@
|
||||
package com.mhd.bms.domain.billManage.repository.persistence;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
@@ -66,6 +70,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 账单管理Service业务层处理
|
||||
@@ -211,6 +216,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
String appointShipper=make.getActualInvoiceCustomerName();
|
||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||
String customerCodeNcJson = billManageMapper.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 settlementCurrency=reconciliation.getSettlementCurrency();
|
||||
String orgCodeNc = billManageMapper.getOrgCodeNc(organizationId);
|
||||
String documentPreparerNcCode = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
||||
@@ -436,6 +461,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
reconciliation.setSynchronousStatus(2);
|
||||
billManageMapper.updateById(reconciliation);
|
||||
e.printStackTrace();
|
||||
} catch (JsonMappingException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -528,6 +557,26 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
String appointShipper=make.getActualInvoiceCustomerName();
|
||||
String actualInvoiceCustomerId = make.getActualInvoiceCustomerId();
|
||||
String customerCodeNc = billManageMapper.getCustomerCodeNc(actualInvoiceCustomerId);
|
||||
String customerCodeNcJson = billManageMapper.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 = billManageMapper.getDocumentPreparerNcCode(salesmanId);
|
||||
String settlementCurrency=reconciliation.getSettlementCurrency();
|
||||
String settlementCurrencyNcCode = settlementCurrency;
|
||||
@@ -722,6 +771,10 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
reconciliation.setSynchronousStatus(2);
|
||||
billManageMapper.updateById(reconciliation);
|
||||
e.printStackTrace();
|
||||
} catch (JsonMappingException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,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>
|
||||
|
||||
Reference in New Issue
Block a user