From 6add6b3044b74d654ccb065e63d24bbc96eb0d6f Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 22 Jan 2021 13:05:00 +0800 Subject: [PATCH] modify --- zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java index 75f839a..025715b 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java @@ -17,6 +17,7 @@ import com.matrix.system.common.tools.ServiceUtil; import com.matrix.system.constance.Dictionary; import com.matrix.system.constance.TableMapping; +import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; import com.matrix.system.hive.plugin.util.CollectionUtils; @@ -425,6 +426,7 @@ if (!DataAuthUtil.hasAllShopAuth()) { vipInfoListDto.setShopId(sysUsers.getShopId()); } + QueryUtil.setQueryLimitCom(vipInfoListDto); return sysVipInfoDao.selectVipAddressBookByList(vipInfoListDto); } @@ -448,6 +450,7 @@ } SysVipInfo vipInfo = new SysVipInfo(); + vipInfo.setPhoto(addVipDto.getPhoto()); vipInfo.setVipName(addVipDto.getVipName()); vipInfo.setVipNo(addVipDto.getVipNo()); @@ -482,7 +485,7 @@ int i=sysVipInfoDao.insert(vipInfo); if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { - batchInsertLabel(addVipDto.getLabels(), user.getSuName(), vipInfo.getId()); + batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); } //创建用户默认储值卡 @@ -533,23 +536,20 @@ int i = sysVipInfoDao.update(vipInfo); if (CollectionUtils.isNotEmpty(modifyVipDto.getLabels())) { - sysVipLabelDao.deleteByVipId(modifyVipDto.getVipId()); - - batchInsertLabel(modifyVipDto.getLabels(), user.getSuName(), vipInfo.getId()); + sysVipLabelDao.deleteRelateByVipId(modifyVipDto.getVipId()); + batchInsertLabel(modifyVipDto.getLabels(), vipInfo.getId()); } return i; } - private void batchInsertLabel(List<String> labelList, String suName, Long id) { + private void batchInsertLabel(List<String> labelList, Long id) { Set<String> labels = new HashSet<>(labelList); Iterator<String> iterator = labels.iterator(); if (iterator.hasNext()) { - SysVipLabel sysVipLabel = new SysVipLabel(); - sysVipLabel.setCreateTime(new Date()); - sysVipLabel.setCreateBy(suName); - sysVipLabel.setLabel(iterator.next()); - sysVipLabel.setVipId(id); - sysVipLabelDao.insert(sysVipLabel); + SysVipLabelRelate relate = new SysVipLabelRelate(); + relate.setLabelId(Long.parseLong(iterator.next())); + relate.setVipId(id); + sysVipLabelDao.insertRelate(relate); } } -- Gitblit v1.9.1