From 803bd32f4bb467e92a0727f4ee5896686c5cfcb3 Mon Sep 17 00:00:00 2001 From: fengtianyangyang Date: Mon, 15 Nov 2021 18:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=97=E9=93=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2'null'=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/store/entity/dos/StoreDetail.java | 17 +++++++++++++++++ .../serviceimpl/StoreDetailServiceImpl.java | 3 ++- .../store/serviceimpl/StoreServiceImpl.java | 1 - 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java index 87820fd7..eb9a8f65 100644 --- a/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java +++ b/framework/src/main/java/cn/lili/modules/store/entity/dos/StoreDetail.java @@ -180,11 +180,28 @@ public class StoreDetail extends BaseIdEntity { public StoreDetail(Store store, AdminStoreApplyDTO adminStoreApplyDTO) { this.storeId = store.getId(); + //过滤字段值 + isNotNull(adminStoreApplyDTO); //设置店铺公司信息、设置店铺银行信息、设置店铺其他信息 BeanUtil.copyProperties(adminStoreApplyDTO, this); this.settlementDay = DateUtil.date(); this.stockWarning = 10; } + public void isNotNull(AdminStoreApplyDTO adminStoreApplyDTO){ + if("null".equals(adminStoreApplyDTO.getSalesConsigneeName())){ + adminStoreApplyDTO.setSalesConsigneeName(""); + } + if("null".equals(adminStoreApplyDTO.getSalesConsigneeMobile())){ + adminStoreApplyDTO.setSalesConsigneeMobile(""); + } + if("null".equals(adminStoreApplyDTO.getSalesConsigneeDetail())){ + adminStoreApplyDTO.setSalesConsigneeDetail(""); + } + if("null".equals(adminStoreApplyDTO.getDdCode())){ + adminStoreApplyDTO.setDdCode(""); + } + } + } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java index 956a8bb9..5c752d51 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/StoreDetailServiceImpl.java @@ -75,7 +75,8 @@ public class StoreDetailServiceImpl extends ServiceImpl implements if (Boolean.TRUE.equals(member.getHaveStore())) { throw new ServiceException(ResultCode.STORE_APPLY_DOUBLE_ERROR); } - //添加店铺 Store store = new Store(member, adminStoreApplyDTO); this.save(store);