增加字段

This commit is contained in:
YAS\29473
2025-04-08 08:44:34 +08:00
parent 931ecd42c5
commit 5bc268c922
8 changed files with 82 additions and 0 deletions

View File

@@ -403,4 +403,6 @@ public interface OrderBasicInfoMapper {
* @return * @return
*/ */
List<OrderVO> selectThirdPartyOrderList(@Param("dto") QueryStartChargeDTO dto); List<OrderVO> selectThirdPartyOrderList(@Param("dto") QueryStartChargeDTO dto);
LocalDateTime queryOrderCreateTimeByStationId(String id);
} }

View File

@@ -135,4 +135,11 @@ public interface PileConnectorInfoMapper {
* @return * @return
*/ */
List<ConnectorInfoVO> batchSelectConnectorList(@Param("stationIds") List<String> stationIds); List<ConnectorInfoVO> batchSelectConnectorList(@Param("stationIds") List<String> stationIds);
/**
* 查询异常设备数量
* @param stationId
* @return
*/
List<String> queryAbnormalDeviceCount(String stationId);
} }

View File

@@ -176,4 +176,11 @@ public interface PileConnectorInfoService {
* @return * @return
*/ */
public BusinessConnectorInfoVO getBusinessPileConnectorDetail(String pileConnectorCode); public BusinessConnectorInfoVO getBusinessPileConnectorDetail(String pileConnectorCode);
/**
* 查询异常设备数量
* @param id
* @return
*/
int queryAbnormalDeviceCount(String id);
} }

View File

@@ -1164,4 +1164,20 @@ public class PileConnectorInfoServiceImpl implements PileConnectorInfoService {
vo.setBusinessConnectorDetail(detailVO); vo.setBusinessConnectorDetail(detailVO);
return vo; return vo;
} }
/**
* 统计异常设备数量
* @param stationId
* @return
*/
@Override
public int queryAbnormalDeviceCount(String stationId) {
List<String> list = pileConnectorInfoMapper.queryAbnormalDeviceCount(stationId);
if (CollectionUtils.isEmpty(list)){
return 0;
}
Set<String> set = new HashSet<>(list);
return set.size();
}
} }

View File

@@ -25,6 +25,7 @@ import com.jsowell.pile.dto.business.StationBusinessAnalyzeInfoDTO;
import com.jsowell.pile.dto.business.StationStatisticsInfoDTO; import com.jsowell.pile.dto.business.StationStatisticsInfoDTO;
import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO; import com.jsowell.pile.dto.lutongyunting.BindParkingPlatformDTO;
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO; import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryStationInfoDTO;
import com.jsowell.pile.mapper.OrderBasicInfoMapper;
import com.jsowell.pile.mapper.PileStationInfoMapper; import com.jsowell.pile.mapper.PileStationInfoMapper;
import com.jsowell.pile.service.*; import com.jsowell.pile.service.*;
import com.jsowell.pile.util.UserUtils; import com.jsowell.pile.util.UserUtils;
@@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@@ -100,6 +102,8 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
@Autowired @Autowired
private SettleOrderReportService settleOrderReportService; private SettleOrderReportService settleOrderReportService;
@Autowired
private OrderBasicInfoMapper orderBasicInfoMapper;
/** /**
* 查询充电站信息 * 查询充电站信息
@@ -586,6 +590,18 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
stationVO.setVipServicePrice(currentTimePriceDetails.getVipServicePrice()); stationVO.setVipServicePrice(currentTimePriceDetails.getVipServicePrice());
stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice()); stationVO.setVipTotalPrice(currentTimePriceDetails.getVipTotalPrice());
} }
//根据站点id查询订单最后一次交易时间
LocalDateTime lastChargeTime = orderBasicInfoMapper.queryOrderCreateTimeByStationId(pileStationVO.getId());
if (lastChargeTime != null) {
String s = lastChargeTime.toString();
String replace = s.replace("T" , " ");
stationVO.setLastChargeTime(replace);
}
//根据站点id查询异常设备数量
stationVO.setAbnormalDeviceCount(pileConnectorInfoService.queryAbnormalDeviceCount(pileStationVO.getId()));
stationVOList.add(stationVO); stationVOList.add(stationVO);
} }

View File

@@ -133,6 +133,16 @@ public class StationInfoVO {
*/ */
private boolean collectedFlag; private boolean collectedFlag;
/**
* 当前站点最近充电的一次时间
*/
private String lastChargeTime;
/**
* 异常设备数量
*/
private int abnormalDeviceCount;
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;

View File

@@ -3119,4 +3119,16 @@
</where> </where>
</select> </select>
<select id="queryOrderCreateTimeByStationId" resultType="java.time.LocalDateTime">
SELECT
create_time
FROM
order_basic_info
WHERE
station_id = #{stationId}
ORDER BY
create_time DESC
LIMIT 1;
</select>
</mapper> </mapper>

View File

@@ -305,4 +305,16 @@
#{stationId, jdbcType=VARCHAR} #{stationId, jdbcType=VARCHAR}
</foreach> </foreach>
</select> </select>
<select id="queryAbnormalDeviceCount" resultType="java.lang.String">
SELECT
t1.pile_sn
FROM
pile_connector_info t1
LEFT JOIN pile_basic_info t2 ON t1.pile_sn = t2.sn
WHERE
t1.status = '255'
AND
t2.station_id = #{stationId,jdbcType=VARCHAR}
</select>
</mapper> </mapper>