From f5dba8617bad20e0031ac4e4efa3b939be8b2c43 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Tue, 26 Aug 2025 11:29:13 +0800 Subject: [PATCH] =?UTF-8?q?demand:=20=E7=BD=91=E7=82=B9=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=94=B3=E8=AF=B7=E6=97=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=AF=84=E4=BB=B6=E4=BA=BA=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit committer: heyu --- .../erp/emis/service/EmisBaseService.java | 46 ++++++++++--------- .../EmisWaybillAjustApplyServiceImpl.java | 42 ++++++++++++----- 2 files changed, 56 insertions(+), 32 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java index 3bce11c6f..4cfc23d59 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/EmisBaseService.java @@ -3560,6 +3560,31 @@ public class EmisBaseService { */ public int createCustomerAddressNew(EmisCustomerAddress emisCustomerAddressNew) throws EmisBizError { + checkAdress(emisCustomerAddressNew); + List emisCustomerAddressList = emisCustomerAddressMapper.checkAndQuery(emisCustomerAddressNew); + if (CollectionUtil.isEmpty(emisCustomerAddressList)) { + // 不重复的情况则 创建地址 + return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddressNew); + } else { + if ("1".equals(emisCustomerAddressNew.getAddressType()) && "0086".equals(emisCustomerAddressNew.getCountry())) { + List emisCustomerAddressIds = emisCustomerAddressList.stream().filter(i -> (StringUtil.isBlank(i.getEnterpriseTaxId()) || StringUtil.isBlank(i.getEnterpriseName()))).map(EmisCustomerAddress::getId).collect(Collectors.toList()); + if (CollectionUtil.isEmpty(emisCustomerAddressIds)) { + return 1; + } + for (Long id : emisCustomerAddressIds) { + EmisCustomerAddress emisCustomerAddress = new EmisCustomerAddress(); + emisCustomerAddress.setId(id); + emisCustomerAddress.setEnterpriseTaxId(emisCustomerAddressNew.getEnterpriseTaxId()); + emisCustomerAddress.setEnterpriseName(emisCustomerAddressNew.getEnterpriseName()); + emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress); + } + } + } + + return 1; + } + + public void checkAdress(EmisCustomerAddress emisCustomerAddressNew) throws EmisBizError { if ("1".equals(emisCustomerAddressNew.getAddressType())) { if ("0086".equals(emisCustomerAddressNew.getCountry())) { if (StringUtil.isBlank(emisCustomerAddressNew.getEnterpriseTaxId()) || StringUtil.isBlank(emisCustomerAddressNew.getEnterpriseName())) { @@ -3582,27 +3607,6 @@ public class EmisBaseService { emisCustomerAddressNew.setEnterpriseName(null); emisCustomerAddressNew.setEnterpriseTaxId(null); } - List emisCustomerAddressList = emisCustomerAddressMapper.checkAndQuery(emisCustomerAddressNew); - if (CollectionUtil.isEmpty(emisCustomerAddressList)) { - // 不重复的情况则 创建地址 - return emisCustomerAddressMapper.insertEmisCustomerAddress(emisCustomerAddressNew); - } else { - if ("1".equals(emisCustomerAddressNew.getAddressType()) && "0086".equals(emisCustomerAddressNew.getCountry())) { - List emisCustomerAddressIds = emisCustomerAddressList.stream().filter(i -> (StringUtil.isBlank(i.getEnterpriseTaxId()) || StringUtil.isBlank(i.getEnterpriseName()))).map(EmisCustomerAddress::getId).collect(Collectors.toList()); - if (CollectionUtil.isEmpty(emisCustomerAddressIds)) { - return 1; - } - for (Long id : emisCustomerAddressIds) { - EmisCustomerAddress emisCustomerAddress = new EmisCustomerAddress(); - emisCustomerAddress.setId(id); - emisCustomerAddress.setEnterpriseTaxId(emisCustomerAddressNew.getEnterpriseTaxId()); - emisCustomerAddress.setEnterpriseName(emisCustomerAddressNew.getEnterpriseName()); - emisCustomerAddressMapper.updateEmisCustomerAddress(emisCustomerAddress); - } - } - } - - return 1; } /** diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java index 5898979f4..fe4ba9d75 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisWaybillAjustApplyServiceImpl.java @@ -1,10 +1,10 @@ - /** + /** * @Project: emis * @Title: EmisWaybillAjustApplyServiceImpl.java * @author linfso * @date 2024-06-25 23:39:28 * @Copyright: ShangHai Duta 2022 All rights reserved. - * @version v1.0 + * @version v1.0 * @Description:

运单调整申请 实体类

*/ @@ -37,7 +37,7 @@ import org.springframework.transaction.annotation.Transactional; /** * 运单调整申请Service业务层处理 - * + * * @author linfso * @date 2024-06-25 23:39:28 */ @@ -72,7 +72,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 查询运单调整申请 - * + * * @param id 运单调整申请主键 * @return 运单调整申请 */ @@ -85,7 +85,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 查询运单调整申请列表 - * + * * @param emisWaybillAjustApply 运单调整申请 * @return 运单调整申请 */ @@ -97,8 +97,8 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 检查是否重复 - * - * @param emisWaybillAjustApply + * + * @param emisWaybillAjustApply * @return 数量 */ @Override @@ -109,13 +109,14 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 新增运单调整申请 - * + * * @param emisWaybillAjustApply 运单调整申请 * @return 结果 */ @Override public int insertEmisWaybillAjustApply(EmisWaybillAjustApply emisWaybillAjustApply) throws EmisBizError { + EmisWaybill emisWaybillSave = getEmisWaybillNewFromJson(emisWaybillAjustApply); // 判断单号是否存在 EmisWaybill emisWaybillOld=getWaybillByBillCode(emisWaybillAjustApply.getBillCode()); if(emisWaybillOld==null){ @@ -148,6 +149,25 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements checkVirtualParam(getEmisWaybillNewFromJson(emisWaybillAjustApply),emisWaybillOld); } + // 发件地址 + EmisCustomerAddress sendAddress = new EmisCustomerAddress(); + sendAddress.setCountry(emisWaybillSave.getSendCountry()); + sendAddress.setName(emisWaybillSave.getSendName()); + sendAddress.setPhone(emisWaybillSave.getSendMobile()); + sendAddress.setProvince(emisWaybillSave.getSendProvince()); + sendAddress.setCity(emisWaybillSave.getSendCity()); + sendAddress.setCounty(emisWaybillSave.getSendCounty()); + sendAddress.setTown(emisWaybillSave.getSendTown()); +// recieveAddress.setEmail(emisWaybillSave); + sendAddress.setAddress(emisWaybillSave.getSendAddress()); + sendAddress.setCompany(emisWaybillSave.getSendCompany()); + + sendAddress.setUseSiteCode(emisWaybillSave.getSendSiteCode()); + sendAddress.setAddressType("1"); + sendAddress.setEnterpriseName(emisWaybillSave.getEnterpriseName()); + sendAddress.setEnterpriseTaxId(emisWaybillSave.getEnterpriseTaxId()); + checkAdress(sendAddress); + // 插入数据 emisWaybillAjustApply.setApplyDate(new Date()); emisWaybillAjustApply.setApplySiteCode(SecurityUtils.getLoginUser().getUser().getOwnerSiteCode()); @@ -180,7 +200,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 修改运单调整申请 - * + * * @param emisWaybillAjustApply 运单调整申请 * @return 结果 */ @@ -192,7 +212,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 批量删除运单调整申请 - * + * * @param ids 需要删除的运单调整申请主键 * @return 结果 */ @@ -204,7 +224,7 @@ public class EmisWaybillAjustApplyServiceImpl extends EmisBaseService implements /** * 删除运单调整申请信息 - * + * * @param id 运单调整申请主键 * @return 结果 */