mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
会员组移除站点
This commit is contained in:
@@ -22,9 +22,9 @@ public class CreateOrUpdateBillingTemplateDTO {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 时段类型(1-尖时;2-峰时;3-平时;4-谷时)
|
||||
* 车辆类型(1-电动汽车;2-电动自行车)
|
||||
*/
|
||||
@ApiModelProperty("时段类型")
|
||||
@ApiModelProperty("车辆类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,4 +19,6 @@ public class MemberGroupDTO extends BaseEntity {
|
||||
private String groupCode;
|
||||
|
||||
private List<String> merchantIdList;
|
||||
|
||||
private String stationId;
|
||||
}
|
||||
|
||||
@@ -102,4 +102,6 @@ public interface MemberGroupService {
|
||||
* @return
|
||||
*/
|
||||
List<MemberGroupStationVO> queryStationList(MemberGroupDTO dto);
|
||||
|
||||
int removeStationFromMemberGroup(MemberGroupDTO dto);
|
||||
}
|
||||
|
||||
@@ -170,6 +170,8 @@ public interface PileBillingTemplateService {
|
||||
|
||||
List<PileBillingDetail> queryBillingDetailById(Long id);
|
||||
|
||||
int deletePreferentialBillingTemplate(String stationId);
|
||||
|
||||
// 批量查询站点计费模板
|
||||
List<BillingTemplateVO> selectBillingTemplateByStationIdList(List<String> stationIdList);
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 会员组Service业务层处理
|
||||
@@ -264,6 +265,29 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
return memberGroupMapper.queryStationList(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int removeStationFromMemberGroup(MemberGroupDTO dto) {
|
||||
String stationId = dto.getStationId();
|
||||
String groupCode = dto.getGroupCode();
|
||||
if (StringUtils.isBlank(stationId) || StringUtils.isBlank(groupCode)) {
|
||||
return 0;
|
||||
}
|
||||
MemberGroup memberGroup = memberGroupMapper.selectByGroupCode(groupCode);
|
||||
if (Objects.isNull(memberGroup)) {
|
||||
return 0;
|
||||
}
|
||||
List<String> stationIds = Lists.newArrayList(StringUtils.split(memberGroup.getStationId(), ","));
|
||||
if (CollectionUtils.isNotEmpty(stationIds)) {
|
||||
stationIds.remove(stationId);
|
||||
memberGroup.setStationId(StringUtils.join(stationIds, ","));
|
||||
memberGroupMapper.updateMemberGroup(memberGroup);
|
||||
}
|
||||
|
||||
// 删除该站点的会员优惠计费模板
|
||||
pileBillingTemplateService.deletePreferentialBillingTemplate(stationId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员与集团的关系保存到数据库
|
||||
* @param memberId 会员id
|
||||
|
||||
@@ -236,7 +236,7 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
||||
|
||||
// 查询站点信息
|
||||
billingTemplate.setName(dto.getName());
|
||||
billingTemplate.setType(String.valueOf(dto.getType()));
|
||||
billingTemplate.setType(dto.getType());
|
||||
billingTemplate.setTemplateRemark(dto.getTemplateRemark());
|
||||
billingTemplate.setUpdateBy(SecurityUtils.getUsername());
|
||||
billingTemplate.setFreeTime(dto.getFreeTime());
|
||||
@@ -524,6 +524,16 @@ public class PileBillingTemplateServiceImpl implements PileBillingTemplateServic
|
||||
return pileBillingTemplateMapper.queryPreferentialBillingTemplate(stationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePreferentialBillingTemplate(String stationId) {
|
||||
int i = 0;
|
||||
BillingTemplateVO billingTemplate = queryPreferentialBillingTemplate(stationId);
|
||||
if (Objects.nonNull(billingTemplate)) {
|
||||
i = pileBillingTemplateMapper.deletePileBillingTemplateById(Long.parseLong(billingTemplate.getTemplateId()));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingTemplateVO> selectBillingTemplateByStationIdList(List<String> stationIdList) {
|
||||
if (CollectionUtils.isEmpty(stationIdList)) {
|
||||
|
||||
Reference in New Issue
Block a user