mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
update
This commit is contained in:
@@ -267,25 +267,29 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
|
||||
@Override
|
||||
public int removeStationFromMemberGroup(MemberGroupDTO dto) {
|
||||
int result = 0;
|
||||
String stationId = dto.getStationId();
|
||||
String groupCode = dto.getGroupCode();
|
||||
if (StringUtils.isBlank(stationId) || StringUtils.isBlank(groupCode)) {
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
MemberGroup memberGroup = memberGroupMapper.selectByGroupCode(groupCode);
|
||||
if (Objects.isNull(memberGroup)) {
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
List<String> stationIds = Lists.newArrayList(StringUtils.split(memberGroup.getStationId(), ","));
|
||||
if (CollectionUtils.isNotEmpty(stationIds)) {
|
||||
stationIds.remove(stationId);
|
||||
memberGroup.setStationId(StringUtils.join(stationIds, ","));
|
||||
memberGroupMapper.updateMemberGroup(memberGroup);
|
||||
result = memberGroupMapper.updateMemberGroup(memberGroup);
|
||||
}
|
||||
|
||||
// 删除该站点的会员优惠计费模板
|
||||
pileBillingTemplateService.deletePreferentialBillingTemplate(stationId);
|
||||
return 0;
|
||||
int i = pileBillingTemplateService.deletePreferentialBillingTemplate(stationId);
|
||||
if (i > 0) {
|
||||
result = result + i;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -467,17 +467,21 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
||||
}
|
||||
|
||||
// 站点id保存到数据库
|
||||
String groupCode = dto.getGroupCode();
|
||||
MemberGroupVO memberGroupVO = memberGroupService.queryByGroupCode(groupCode);
|
||||
MemberGroupVO memberGroupVO = memberGroupService.queryByGroupCode(dto.getGroupCode());
|
||||
if (Objects.nonNull(memberGroupVO)) {
|
||||
List<String> stationIdList = Lists.newArrayList(); // 站点id集合
|
||||
if (StringUtils.isNotBlank(memberGroupVO.getStationId())) {
|
||||
stationIdList = Lists.newArrayList(StringUtils.split(memberGroupVO.getStationId(), ","));
|
||||
}
|
||||
// 查询该站点是否已经创建过会员优惠计费模板了
|
||||
List<String> stationIdList = Lists.newArrayList(StringUtils.split(memberGroupVO.getStationId(), ","));
|
||||
if (CollectionUtils.isNotEmpty(stationIdList) && stationIdList.contains(dto.getStationId())) {
|
||||
throw new BusinessException("", "该站点已经创建过会员优惠计费模板");
|
||||
}
|
||||
// 更新数据
|
||||
MemberGroup updateData = new MemberGroup();
|
||||
updateData.setId(memberGroupVO.getId());
|
||||
updateData.setStationId(memberGroupVO.getStationId() + "," + dto.getStationId());
|
||||
stationIdList.add(dto.getStationId());
|
||||
updateData.setStationId(StringUtils.join(stationIdList.stream().sorted().collect(Collectors.toList()), ","));
|
||||
memberGroupService.updateMemberGroup(updateData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user