update 添加会员到集团组

This commit is contained in:
2024-01-18 14:07:15 +08:00
parent cee330d287
commit 39e4dfbcdf
2 changed files with 10 additions and 7 deletions

View File

@@ -1,11 +1,13 @@
package com.jsowell.pile.service.impl; package com.jsowell.pile.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.jsowell.pile.mapper.MemberGroupRelationMapper;
import java.util.List;
import com.jsowell.pile.domain.MemberGroupRelation; import com.jsowell.pile.domain.MemberGroupRelation;
import com.jsowell.pile.mapper.MemberGroupRelationMapper;
import com.jsowell.pile.service.MemberGroupRelationService; import com.jsowell.pile.service.MemberGroupRelationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service @Service
public class MemberGroupRelationServiceImpl implements MemberGroupRelationService{ public class MemberGroupRelationServiceImpl implements MemberGroupRelationService{
@@ -64,6 +66,9 @@ public class MemberGroupRelationServiceImpl implements MemberGroupRelationServic
@Override @Override
public int batchInsert(List<MemberGroupRelation> list) { public int batchInsert(List<MemberGroupRelation> list) {
if (CollectionUtils.isEmpty(list)) {
return 0;
}
return memberGroupRelationMapper.batchInsert(list); return memberGroupRelationMapper.batchInsert(list);
} }

View File

@@ -175,14 +175,12 @@ public class MemberGroupServiceImpl implements MemberGroupService {
return 0; return 0;
} }
// 校验通过,关系存入数据库 // 校验通过,关系存入数据库
List<MemberGroupRelation> list = Lists.newArrayList();
MemberGroupRelation relation = new MemberGroupRelation(); MemberGroupRelation relation = new MemberGroupRelation();
relation.setMemberId(memberBasicInfo.getMemberId()); relation.setMemberId(memberBasicInfo.getMemberId());
relation.setGroupCode(groupCode); relation.setGroupCode(groupCode);
relation.setCreateTime(DateUtils.getNowDate()); relation.setCreateTime(DateUtils.getNowDate());
relation.setDelFlag(DelFlagEnum.NORMAL.getValue()); relation.setDelFlag(DelFlagEnum.NORMAL.getValue());
memberGroupRelationService.batchInsert(list); return memberGroupRelationService.batchInsert(Lists.newArrayList(relation));
return memberGroupRelationService.batchInsert(list);
} }
@Override @Override