mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-02 21:18:05 +08:00
update 集团列表
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.jsowell.pile.controller;
|
package com.jsowell.pile.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.jsowell.common.annotation.Log;
|
import com.jsowell.common.annotation.Log;
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
import com.jsowell.common.core.domain.AjaxResult;
|
import com.jsowell.common.core.domain.AjaxResult;
|
||||||
@@ -9,6 +10,9 @@ import com.jsowell.common.util.poi.ExcelUtil;
|
|||||||
import com.jsowell.pile.domain.MemberGroup;
|
import com.jsowell.pile.domain.MemberGroup;
|
||||||
import com.jsowell.pile.dto.MemberGroupDTO;
|
import com.jsowell.pile.dto.MemberGroupDTO;
|
||||||
import com.jsowell.pile.service.MemberGroupService;
|
import com.jsowell.pile.service.MemberGroupService;
|
||||||
|
import com.jsowell.pile.util.UserUtils;
|
||||||
|
import com.jsowell.pile.vo.base.LoginUserDetailVO;
|
||||||
|
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -16,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员组Controller
|
* 会员组Controller
|
||||||
@@ -34,7 +39,12 @@ public class MemberGroupController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(MemberGroup memberGroup) {
|
public TableDataInfo list(MemberGroupDTO memberGroup) {
|
||||||
|
LoginUserDetailVO loginUserDetail = UserUtils.getLoginUserDetail();
|
||||||
|
logger.info("获取登录用户信息:{}", JSON.toJSONString(loginUserDetail));
|
||||||
|
List<MerchantInfoVO> merchantInfoVOList = loginUserDetail.getMerchantInfoVOList();
|
||||||
|
List<String> collect = merchantInfoVOList.stream().map(MerchantInfoVO::getMerchantId).collect(Collectors.toList());
|
||||||
|
memberGroup.setMerchantIdList(collect);
|
||||||
startPage();
|
startPage();
|
||||||
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@@ -46,7 +56,7 @@ public class MemberGroupController extends BaseController {
|
|||||||
@PreAuthorize("@ss.hasPermi('member:memberGroup:export')")
|
@PreAuthorize("@ss.hasPermi('member:memberGroup:export')")
|
||||||
@Log(title = "会员组", businessType = BusinessType.EXPORT)
|
@Log(title = "会员组", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, MemberGroup memberGroup) {
|
public void export(HttpServletResponse response, MemberGroupDTO memberGroup) {
|
||||||
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
List<MemberGroupVO> list = memberGroupService.selectMemberGroupList(memberGroup);
|
||||||
ExcelUtil<MemberGroup> util = new ExcelUtil<MemberGroup>(MemberGroup.class);
|
ExcelUtil<MemberGroup> util = new ExcelUtil<MemberGroup>(MemberGroup.class);
|
||||||
// util.exportExcel(response, list, "会员组数据");
|
// util.exportExcel(response, list, "会员组数据");
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.jsowell.pile.dto;
|
|||||||
import com.jsowell.common.core.domain.BaseEntity;
|
import com.jsowell.common.core.domain.BaseEntity;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@@ -14,4 +16,6 @@ public class MemberGroupDTO extends BaseEntity {
|
|||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
private String groupCode;
|
private String groupCode;
|
||||||
|
|
||||||
|
private List<String> merchantIdList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.mapper;
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.MemberGroup;
|
import com.jsowell.pile.domain.MemberGroup;
|
||||||
|
import com.jsowell.pile.dto.MemberGroupDTO;
|
||||||
import com.jsowell.pile.vo.uniapp.MemberVO;
|
import com.jsowell.pile.vo.uniapp.MemberVO;
|
||||||
import com.jsowell.pile.vo.web.MemberDiscountVO;
|
import com.jsowell.pile.vo.web.MemberDiscountVO;
|
||||||
import com.jsowell.pile.vo.web.MemberGroupVO;
|
import com.jsowell.pile.vo.web.MemberGroupVO;
|
||||||
@@ -65,7 +66,7 @@ public interface MemberGroupMapper {
|
|||||||
*/
|
*/
|
||||||
public int deleteMemberGroupByIds(Long[] ids);
|
public int deleteMemberGroupByIds(Long[] ids);
|
||||||
|
|
||||||
List<MemberGroupVO> queryMemberGroupList(MemberGroup memberGroup);
|
List<MemberGroupVO> queryMemberGroupList(MemberGroupDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员折扣
|
* 查询会员折扣
|
||||||
|
|||||||
@@ -10,15 +10,14 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员组Service接口
|
* 会员组Service接口
|
||||||
*
|
*
|
||||||
* @author jsowell
|
* @author jsowell
|
||||||
* @date 2023-12-26
|
* @date 2023-12-26
|
||||||
*/
|
*/
|
||||||
public interface MemberGroupService
|
public interface MemberGroupService {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* 查询会员组
|
* 查询会员组
|
||||||
*
|
*
|
||||||
* @param id 会员组主键
|
* @param id 会员组主键
|
||||||
* @return 会员组
|
* @return 会员组
|
||||||
*/
|
*/
|
||||||
@@ -26,15 +25,12 @@ public interface MemberGroupService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员组列表
|
* 查询会员组列表
|
||||||
*
|
|
||||||
* @param memberGroup 会员组
|
|
||||||
* @return 会员组集合
|
|
||||||
*/
|
*/
|
||||||
public List<MemberGroupVO> selectMemberGroupList(MemberGroup memberGroup);
|
public List<MemberGroupVO> selectMemberGroupList(MemberGroupDTO dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增会员组
|
* 新增会员组
|
||||||
*
|
*
|
||||||
* @param memberGroup 会员组
|
* @param memberGroup 会员组
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -42,7 +38,7 @@ public interface MemberGroupService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改会员组
|
* 修改会员组
|
||||||
*
|
*
|
||||||
* @param memberGroup 会员组
|
* @param memberGroup 会员组
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -50,7 +46,7 @@ public interface MemberGroupService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除会员组
|
* 批量删除会员组
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的会员组主键集合
|
* @param ids 需要删除的会员组主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -58,7 +54,7 @@ public interface MemberGroupService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除会员组信息
|
* 删除会员组信息
|
||||||
*
|
*
|
||||||
* @param id 会员组主键
|
* @param id 会员组主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -66,6 +62,7 @@ public interface MemberGroupService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员折扣
|
* 查询会员折扣
|
||||||
|
*
|
||||||
* @param merchantId
|
* @param merchantId
|
||||||
* @param stationId
|
* @param stationId
|
||||||
* @param memberId
|
* @param memberId
|
||||||
|
|||||||
@@ -56,18 +56,21 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public MemberGroup selectMemberGroupById(Long id) {
|
public MemberGroup selectMemberGroupById(Long id) {
|
||||||
return memberGroupMapper.selectMemberGroupById(id);
|
MemberGroup memberGroup = memberGroupMapper.selectMemberGroupById(id);
|
||||||
|
if (memberGroup != null) {
|
||||||
|
BigDecimal discount = memberGroup.getDiscount();
|
||||||
|
// 返回给前端乘以10
|
||||||
|
memberGroup.setDiscount(discount.multiply(BigDecimal.TEN));
|
||||||
|
}
|
||||||
|
return memberGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询会员组列表
|
* 查询会员组列表
|
||||||
*
|
|
||||||
* @param memberGroup 会员组
|
|
||||||
* @return 会员组
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<MemberGroupVO> selectMemberGroupList(MemberGroup memberGroup) {
|
public List<MemberGroupVO> selectMemberGroupList(MemberGroupDTO dto) {
|
||||||
List<MemberGroupVO> resultList = memberGroupMapper.queryMemberGroupList(memberGroup);
|
List<MemberGroupVO> resultList = memberGroupMapper.queryMemberGroupList(dto);
|
||||||
if (CollectionUtils.isEmpty(resultList)) {
|
if (CollectionUtils.isEmpty(resultList)) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,12 @@
|
|||||||
left join pile_merchant_info t2 on t1.merchant_id = t2.id
|
left join pile_merchant_info t2 on t1.merchant_id = t2.id
|
||||||
left join pile_station_info t3 on t3.id = t1.station_id
|
left join pile_station_info t3 on t3.id = t1.station_id
|
||||||
where t1.del_flag = '0'
|
where t1.del_flag = '0'
|
||||||
|
<if test="merchantIdList != null and merchantIdList.size() != 0">
|
||||||
|
and t1.merchant_id in
|
||||||
|
<foreach collection="merchantIdList" item="merchantId" open="(" separator="," close=")">
|
||||||
|
#{merchantId,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryMemberDiscount" resultType="com.jsowell.pile.vo.web.MemberDiscountVO">
|
<select id="queryMemberDiscount" resultType="com.jsowell.pile.vo.web.MemberDiscountVO">
|
||||||
|
|||||||
Reference in New Issue
Block a user