Merge pull request 'demand: oms小程序、oms网页端订单录入/修改订单打通tms系统客户地址库,实现小程序/oms下单转运单自动填充对应的企业名称、企业税号' (#168) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/168
This commit is contained in:
heyu 2025-08-30 15:09:31 +08:00
commit faac84205a
3 changed files with 16 additions and 5 deletions

View File

@ -3567,10 +3567,18 @@ public class EmisBaseService {
return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddressNew);
} else {
if ("1".equals(emisCustomerAddressNew.getAddressType()) && "0086".equals(emisCustomerAddressNew.getCountry())) {
List<Long> emisCustomerAddressIds = emisCustomerAddressList.stream().filter(i -> (StringUtil.isBlank(i.getEnterpriseTaxId()) || StringUtil.isBlank(i.getEnterpriseName()))).map(EmisCustomerAddress::getId).collect(Collectors.toList());
List<Long> emisCustomerAddressIds = emisCustomerAddressList.stream().filter(i -> (!emisCustomerAddressNew.getEnterpriseTaxId().equals(i.getEnterpriseTaxId()) || !emisCustomerAddressNew.getEnterpriseName().equals(i.getEnterpriseName()))).map(EmisCustomerAddress::getId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(emisCustomerAddressIds)) {
return 1;
}
if (emisCustomerAddressNew.getId() != null) {
EmisCustomerAddress emisCustomerAddress = new EmisCustomerAddress();
emisCustomerAddress.setId(emisCustomerAddressNew.getId());
emisCustomerAddress.setEnterpriseTaxId(emisCustomerAddressNew.getEnterpriseTaxId());
emisCustomerAddress.setEnterpriseName(emisCustomerAddressNew.getEnterpriseName());
emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress);
return 1;
}
for (Long id : emisCustomerAddressIds) {
EmisCustomerAddress emisCustomerAddress = new EmisCustomerAddress();
emisCustomerAddress.setId(id);

View File

@ -2524,6 +2524,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
sendAddress.setAddressType("1");
sendAddress.setEnterpriseName(emisWaybillSave.getEnterpriseName());
sendAddress.setEnterpriseTaxId(emisWaybillSave.getEnterpriseTaxId());
if (emisWaybillSave.getSendCustomerAddressId() != null) {
sendAddress.setId(Long.valueOf(emisWaybillSave.getSendCustomerAddressId()));
}
// 收件地址
EmisCustomerAddress recieveAddress = new EmisCustomerAddress();

View File

@ -302,11 +302,11 @@
<if test="company != null and company != ''">and company = #{company}</if>
<if test="company == null">and company is null</if>
<if test="enterpriseName != null and enterpriseName != ''">and enterprise_name = #{enterpriseName}</if>
<if test="enterpriseName == null">and enterprise_name is null</if>
<!-- <if test="enterpriseName != null and enterpriseName != ''">and enterprise_name = #{enterpriseName}</if>-->
<!-- <if test="enterpriseName == null">and enterprise_name is null</if>-->
<if test="enterpriseTaxId != null and enterpriseTaxId != ''">and enterprise_tax_id = #{enterpriseTaxId}</if>
<if test="enterpriseTaxId == null">and enterprise_tax_id is null</if>
<!-- <if test="enterpriseTaxId != null and enterpriseTaxId != ''">and enterprise_tax_id = #{enterpriseTaxId}</if>-->
<!-- <if test="enterpriseTaxId == null">and enterprise_tax_id is null</if>-->
and address_type = #{addressType}
</select>