mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-17 00:08:35 +08:00
update 查询首页数据
This commit is contained in:
@@ -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.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首页数据展示DTO
|
* 首页数据展示DTO
|
||||||
*
|
*
|
||||||
@@ -15,4 +17,6 @@ public class IndexQueryDTO extends BaseEntity {
|
|||||||
* 站点id
|
* 站点id
|
||||||
*/
|
*/
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
|
||||||
|
private List<String> stationIdList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.pile.mapper;
|
package com.jsowell.pile.mapper;
|
||||||
|
|
||||||
import com.jsowell.pile.domain.PileMerchantInfo;
|
import com.jsowell.pile.domain.PileMerchantInfo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -67,4 +68,6 @@ public interface PileMerchantInfoMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePileMerchantInfoByIds(Long[] ids);
|
public int deletePileMerchantInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
List<String> queryByMerchantDeptIds(@Param("merchantDeptIds") List<String> merchantDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,4 +77,6 @@ public interface PileStationInfoMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PileStationInfo> getStationInfoForLianLian();
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
|
|
||||||
|
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,4 +63,11 @@ public interface IPileMerchantInfoService {
|
|||||||
String getMerchantIdByAppId(String appId);
|
String getMerchantIdByAppId(String appId);
|
||||||
|
|
||||||
MerchantInfoVO getMerchantInfo(String merchantId);
|
MerchantInfoVO getMerchantInfo(String merchantId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据运营商部门ids 查询所有站点id
|
||||||
|
* @param merchantDeptIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> queryByMerchantDeptIds(List<String> merchantDeptIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,4 +92,6 @@ public interface IPileStationInfoService {
|
|||||||
PileStationVO getStationInfoByPileSn(String pileSn);
|
PileStationVO getStationInfoByPileSn(String pileSn);
|
||||||
|
|
||||||
List<PileStationInfo> getStationInfoForLianLian();
|
List<PileStationInfo> getStationInfoForLianLian();
|
||||||
|
|
||||||
|
List<String> queryByStationDeptIds(List<String> stationIds);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import com.jsowell.pile.service.IPileConnectorInfoService;
|
|||||||
import com.jsowell.pile.service.IPileMerchantInfoService;
|
import com.jsowell.pile.service.IPileMerchantInfoService;
|
||||||
import com.jsowell.pile.service.IPileModelInfoService;
|
import com.jsowell.pile.service.IPileModelInfoService;
|
||||||
import com.jsowell.pile.service.IPileSimInfoService;
|
import com.jsowell.pile.service.IPileSimInfoService;
|
||||||
|
import com.jsowell.pile.service.IPileStationInfoService;
|
||||||
import com.jsowell.pile.service.SimCardService;
|
import com.jsowell.pile.service.SimCardService;
|
||||||
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
import com.jsowell.pile.vo.base.MerchantInfoVO;
|
||||||
import com.jsowell.pile.vo.base.PileInfoVO;
|
import com.jsowell.pile.vo.base.PileInfoVO;
|
||||||
@@ -71,6 +72,9 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IPileMerchantInfoService pileMerchantInfoService;
|
private IPileMerchantInfoService pileMerchantInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IPileStationInfoService pileStationInfoService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPileSimInfoService pileSimInfoService;
|
private IPileSimInfoService pileSimInfoService;
|
||||||
|
|
||||||
@@ -565,9 +569,27 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
|
|||||||
if (authorizedMap == null) {
|
if (authorizedMap == null) {
|
||||||
return new IndexGeneralSituationVO();
|
return new IndexGeneralSituationVO();
|
||||||
}
|
}
|
||||||
dto.setStationDeptIds(authorizedMap.getStationDeptIds());
|
// dto.setStationDeptIds(authorizedMap.getStationDeptIds());
|
||||||
dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
|
// dto.setMerchantDeptIds(authorizedMap.getMerchantDeptIds());
|
||||||
|
List<String> stationIdList = Lists.newArrayList();
|
||||||
|
List<String> stationDeptIds = authorizedMap.getStationDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(stationDeptIds)) {
|
||||||
|
// 根据部门id查询站点id
|
||||||
|
List<String> list = pileStationInfoService.queryByStationDeptIds(stationDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<String> merchantDeptIds = authorizedMap.getMerchantDeptIds();
|
||||||
|
if (CollectionUtils.isNotEmpty(merchantDeptIds)) {
|
||||||
|
// 根据运营商部门id查询下面所有站点id
|
||||||
|
List<String> list = pileMerchantInfoService.queryByMerchantDeptIds(merchantDeptIds);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
stationIdList.addAll(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
log.info("后管首页基本信息查询 authorizedMap:{}, dto:{}", JSONObject.toJSONString(authorizedMap), JSONObject.toJSONString(dto));
|
log.info("后管首页基本信息查询 authorizedMap:{}, dto:{}", JSONObject.toJSONString(authorizedMap), JSONObject.toJSONString(dto));
|
||||||
|
dto.setStationIdList(stationIdList);
|
||||||
return pileBasicInfoMapper.getGeneralSituation(dto);
|
return pileBasicInfoMapper.getGeneralSituation(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,4 +175,9 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
|||||||
.build();
|
.build();
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> queryByMerchantDeptIds(List<String> merchantDeptIds) {
|
||||||
|
return pileMerchantInfoMapper.queryByMerchantDeptIds(merchantDeptIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
|
|||||||
return pileStationInfoMapper.getStationInfoForLianLian();
|
return pileStationInfoMapper.getStationInfoForLianLian();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> queryByStationDeptIds(List<String> stationIds) {
|
||||||
|
return pileStationInfoMapper.queryByStationDeptIds(stationIds);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询充电站信息列表
|
* 查询充电站信息列表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -330,10 +330,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
|
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
<if test="IndexQueryDTO.stationDeptIds != null and IndexQueryDTO.stationDeptIds.size() != 0">
|
<if test="IndexQueryDTO.stationIdList != null and IndexQueryDTO.stationIdList.size() != 0">
|
||||||
and t1.station_id in
|
and t1.station_id in
|
||||||
<foreach collection="IndexQueryDTO.stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
|
<foreach collection="IndexQueryDTO.stationIdList" item="item" open="(" separator="," close=")">
|
||||||
#{stationDeptId}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
group by t4.totalMemberAmount
|
group by t4.totalMemberAmount
|
||||||
|
|||||||
@@ -264,4 +264,18 @@
|
|||||||
where
|
where
|
||||||
app_id = #{appId,jdbcType=VARCHAR}
|
app_id = #{appId,jdbcType=VARCHAR}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryByMerchantDeptIds" resultType="java.lang.String">
|
||||||
|
SELECT
|
||||||
|
t2.id
|
||||||
|
FROM
|
||||||
|
pile_merchant_info t1
|
||||||
|
LEFT JOIN pile_station_info t2 ON t2.merchant_id = t1.id and t2.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
t1.del_flag = '0'
|
||||||
|
AND t1.dept_id IN
|
||||||
|
<foreach collection="merchantDeptIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -373,4 +373,14 @@
|
|||||||
<include refid="selectPileStationInfoVo"/>
|
<include refid="selectPileStationInfoVo"/>
|
||||||
where public_flag = '1'
|
where public_flag = '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryByStationDeptIds" resultType="java.lang.String">
|
||||||
|
select id
|
||||||
|
from pile_station_info
|
||||||
|
where del_flag = '0'
|
||||||
|
and dept_id in
|
||||||
|
<foreach collection="stationDeptIds" item="item" open="(" separator="," close=")">
|
||||||
|
#{item,jdbcType=VARCHAR}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user