mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
根据汇付会员id查询配置分账的站点列表
This commit is contained in:
@@ -3,7 +3,9 @@ package com.jsowell.web.controller.pile;
|
|||||||
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;
|
||||||
import com.jsowell.common.core.page.TableDataInfo;
|
import com.jsowell.common.core.page.TableDataInfo;
|
||||||
|
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.pile.dto.SplitConfigDTO;
|
import com.jsowell.pile.dto.SplitConfigDTO;
|
||||||
import com.jsowell.pile.service.StationSplitConfigService;
|
import com.jsowell.pile.service.StationSplitConfigService;
|
||||||
import com.jsowell.pile.vo.web.SplitConfigVO;
|
import com.jsowell.pile.vo.web.SplitConfigVO;
|
||||||
@@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点分成配置controller
|
* 站点分成配置controller
|
||||||
@@ -56,4 +59,26 @@ public class StationSplitConfigController extends BaseController {
|
|||||||
}
|
}
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据汇付会员id查询配置分账的站点列表
|
||||||
|
* /station/splitconfig/queryStationList
|
||||||
|
* @param adapayMemberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryStationList")
|
||||||
|
public RestApiResponse<Map<String,List<SplitConfigVO>>> queryStationList(String adapayMemberId) {
|
||||||
|
RestApiResponse<?> response = null;
|
||||||
|
Map<String,List<SplitConfigVO>> result = null;
|
||||||
|
try {
|
||||||
|
result = stationSplitConfigService.queryStationList(adapayMemberId);
|
||||||
|
} catch (BusinessException e) {
|
||||||
|
logger.error("查询站点列表失败" , e);
|
||||||
|
response = new RestApiResponse<>(e.getCode() , e.getMessage());
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("查询站点列表失败" , e);
|
||||||
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_FAILED);
|
||||||
|
}
|
||||||
|
return new RestApiResponse<>(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.mapper;
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.StationSplitConfig;
|
import com.jsowell.pile.domain.StationSplitConfig;
|
||||||
|
import com.jsowell.pile.vo.web.SplitConfigVO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -26,4 +27,11 @@ public interface StationSplitConfigMapper {
|
|||||||
int deleteByMerchantIdAndStationId(@Param("merchantId") String merchantId, @Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
int deleteByMerchantIdAndStationId(@Param("merchantId") String merchantId, @Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||||
|
|
||||||
int deleteByStationId(@Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
int deleteByStationId(@Param("stationId") String stationId, @Param("updateBy") String updateBy, @Param("updateTime") Date updateTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据汇付会员id查询配置列表
|
||||||
|
* @param adapayMemberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SplitConfigVO> queryStationList(String adapayMemberId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.jsowell.pile.vo.web.SplitConfigVO;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点分成配置service
|
* 站点分成配置service
|
||||||
@@ -50,5 +51,10 @@ public interface StationSplitConfigService {
|
|||||||
*/
|
*/
|
||||||
List<ShareMemberVO> queryShareMembersByStationId(String stationId);
|
List<ShareMemberVO> queryShareMembersByStationId(String stationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据站点id查询站点分账配置信息
|
||||||
|
* @param adapayMemberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String,List<SplitConfigVO>> queryStationList(String adapayMemberId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,11 @@ import org.springframework.stereotype.Service;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -286,4 +289,29 @@ public class StationSplitConfigServiceImpl implements StationSplitConfigService{
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据汇付会员id查询配置分账的站点列表
|
||||||
|
*
|
||||||
|
* @param adapayMemberId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String,List<SplitConfigVO>> queryStationList(String adapayMemberId) {
|
||||||
|
List<SplitConfigVO> stationList = stationSplitConfigMapper.queryStationList(adapayMemberId);
|
||||||
|
if (stationList == null || stationList.isEmpty()){
|
||||||
|
throw new BusinessException("", "未查询到该汇付会员的分账配置信息");
|
||||||
|
}
|
||||||
|
//按照站点id进行去重,再将id按照降序排序,因为站点id为String类型,所以需要先转换为int类型
|
||||||
|
stationList = stationList.stream()
|
||||||
|
.filter(vo -> vo.getStationId() != null && vo.getStationId().matches("^\\d+"))
|
||||||
|
.distinct()
|
||||||
|
.sorted((o1, o2) -> Integer.parseInt(o1.getStationId()) - Integer.parseInt(o2.getStationId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<String,List<SplitConfigVO>> stationMap = new HashMap<>();
|
||||||
|
stationMap.put("stationList", stationList);
|
||||||
|
return stationMap;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,4 +39,15 @@ public class SplitConfigVO {
|
|||||||
*/
|
*/
|
||||||
private String feeFlag;
|
private String feeFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点id
|
||||||
|
*/
|
||||||
|
private String stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,15 @@
|
|||||||
order by fee_flag
|
order by fee_flag
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryStationList" resultType="com.jsowell.pile.vo.web.SplitConfigVO">
|
||||||
|
select
|
||||||
|
t2.id as stationId,
|
||||||
|
t2.station_name as stationName
|
||||||
|
from station_split_config t1
|
||||||
|
left join pile_station_info t2 on t1.station_id = t2.id
|
||||||
|
where t1.adapay_member_id = #{adapayMemberId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="batchInsert" parameterType="map">
|
<insert id="batchInsert" parameterType="map">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
insert into station_split_config
|
insert into station_split_config
|
||||||
|
|||||||
Reference in New Issue
Block a user