# Conflicts:
#	jsowell-netty/src/main/java/com/jsowell/netty/handler/LoginRequestHandler.java
This commit is contained in:
Lemon
2023-05-15 10:30:53 +08:00
16 changed files with 154 additions and 88 deletions

View File

@@ -3,6 +3,8 @@ package com.jsowell.pile.dto;
import com.jsowell.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* 首页数据展示DTO
*
@@ -15,4 +17,6 @@ public class IndexQueryDTO extends BaseEntity {
* 站点id
*/
private String stationId;
private List<String> stationIdList;
}

View File

@@ -1,6 +1,7 @@
package com.jsowell.pile.mapper;
import com.jsowell.pile.domain.PileMerchantInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -67,4 +68,6 @@ public interface PileMerchantInfoMapper {
* @return 结果
*/
public int deletePileMerchantInfoByIds(Long[] ids);
List<String> queryByMerchantDeptIds(@Param("merchantDeptIds") List<String> merchantDeptIds);
}

View File

@@ -77,4 +77,6 @@ public interface PileStationInfoMapper {
* @return
*/
List<PileStationInfo> getStationInfoForLianLian();
List<String> queryByStationDeptIds(@Param("stationDeptIds") List<String> stationDeptIds);
}

View File

@@ -63,4 +63,11 @@ public interface IPileMerchantInfoService {
String getMerchantIdByAppId(String appId);
MerchantInfoVO getMerchantInfo(String merchantId);
/**
* 根据运营商部门ids 查询所有站点id
* @param merchantDeptIds
* @return
*/
List<String> queryByMerchantDeptIds(List<String> merchantDeptIds);
}

View File

@@ -92,4 +92,6 @@ public interface IPileStationInfoService {
PileStationVO getStationInfoByPileSn(String pileSn);
List<PileStationInfo> getStationInfoForLianLian();
List<String> queryByStationDeptIds(List<String> stationIds);
}

View File

@@ -55,6 +55,8 @@ import com.jsowell.pile.service.IPileAuthCardService;
import com.jsowell.pile.service.IPileBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.service.IPileConnectorInfoService;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.OrderMonitorDataService;
import com.jsowell.pile.service.WechatPayService;
import com.jsowell.pile.service.WxpayCallbackRecordService;
@@ -159,6 +161,12 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
@Autowired
private OrderMonitorDataService orderMonitorDataService;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
/**
* 条件查询订单基本信息
*
@@ -1094,6 +1102,28 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
*/
@Override
public List<IndexOrderInfoVO> getIndexOrderInfo(IndexQueryDTO dto) {
AuthorizedDeptVO authorizedMap = SecurityUtils.getAuthorizedMap();
if (authorizedMap == null) {
return Lists.newArrayList();
}
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);
}
}
dto.setStationIdList(stationIdList);
return orderBasicInfoMapper.getIndexOrderInfo(dto);
}

View File

@@ -27,6 +27,7 @@ import com.jsowell.pile.service.IPileConnectorInfoService;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.service.IPileModelInfoService;
import com.jsowell.pile.service.IPileSimInfoService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.SimCardService;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.PileInfoVO;
@@ -71,6 +72,9 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Autowired
private IPileSimInfoService pileSimInfoService;
@@ -565,8 +569,25 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
if (authorizedMap == null) {
return new IndexGeneralSituationVO();
}
dto.setStationDeptIds(authorizedMap.getStationDeptIds());
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));
dto.setStationIdList(stationIdList);
return pileBasicInfoMapper.getGeneralSituation(dto);
}

View File

@@ -175,4 +175,9 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
.build();
return vo;
}
@Override
public List<String> queryByMerchantDeptIds(List<String> merchantDeptIds) {
return pileMerchantInfoMapper.queryByMerchantDeptIds(merchantDeptIds);
}
}

View File

@@ -163,6 +163,11 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService {
return pileStationInfoMapper.getStationInfoForLianLian();
}
@Override
public List<String> queryByStationDeptIds(List<String> stationIds) {
return pileStationInfoMapper.queryByStationDeptIds(stationIds);
}
/**
* 查询充电站信息列表
*

View File

@@ -779,7 +779,13 @@
date(t1.create_time) >= DATE_SUB(CURDATE(),INTERVAL 30 day)
and t1.order_status = '6'
<if test="dto.stationId != null and dto.stationId != ''">
and t1,station_id = #{dto.stationId,jdbcType=VARCHAR}
and t1.station_id = #{dto.stationId,jdbcType=VARCHAR}
</if>
<if test="dto.stationIdList != null and dto.stationIdList.size() != 0">
and t1.station_id in
<foreach collection="dto.stationIdList" item="item" open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
group by DATE_FORMAT(t1.create_time,'%Y-%m-%d')
</select>

View File

@@ -330,10 +330,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and t1.station_id = #{IndexQueryDTO.stationId,jdbcType=VARCHAR}
</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
<foreach collection="IndexQueryDTO.stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId}
<foreach collection="IndexQueryDTO.stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by t4.totalMemberAmount

View File

@@ -264,4 +264,18 @@
where
app_id = #{appId,jdbcType=VARCHAR}
</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>

View File

@@ -373,4 +373,14 @@
<include refid="selectPileStationInfoVo"/>
where public_flag = '1'
</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>