小时统计增加判断
This commit is contained in:
parent
18e4f0a99d
commit
d9df9cb82c
@ -434,6 +434,9 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
if(list !=null && list.size()>0){
|
||||
for (XhpcChargeHistoryOrder xhpc:list) {
|
||||
try{
|
||||
Long historyOrderId = xhpc.getHistoryOrderId();
|
||||
int count = xhpcStatisticsService.getStatisticsTimeHistoryOrderId(historyOrderId);
|
||||
if(count==0){
|
||||
//开始时间、结束时间、模型id、状态、用户id、运营商、订单id、场站id、终端id、历史订单id、时间
|
||||
Date startTime = xhpc.getStartTime();
|
||||
Date endTime = xhpc.getEndTime();
|
||||
@ -441,7 +444,6 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
Long operatorId =xhpc.getOperatorId();
|
||||
Long chargingStationId = xhpc.getChargingStationId();
|
||||
Long terminalId = xhpc.getTerminalId();
|
||||
Long historyOrderId = xhpc.getHistoryOrderId();
|
||||
//Date data = Calendar.getInstance().getTime();
|
||||
// if(xhpc.getTotalPrice().compareTo(new BigDecimal(0)) !=1){
|
||||
// continue;
|
||||
@ -492,6 +494,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
xhpcStatisticsService.addStatisticsTime(xhpcSt);
|
||||
//修改历史订单表状态
|
||||
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),1);
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info(">>>>>>>>>>>>>>>>>>>>>>>小时统计定时任务异常>>>>>>>>>>>>>>>>>>>>>"+xhpc.getHistoryOrderId());
|
||||
}
|
||||
@ -933,6 +936,11 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
//场站、运营商、流量方
|
||||
if(list !=null && list.size()>0){
|
||||
for (XhpcChargeHistoryOrder xhpc:list) {
|
||||
Long historyOrderId = xhpc.getHistoryOrderId();
|
||||
for (int i = type; i <4 ; i++) {
|
||||
//查询统计表是否有已添加的数据
|
||||
int count = xhpcStatisticsService.getStatisticsStationHistoryOrderId(historyOrderId, i);
|
||||
if(count==0){
|
||||
XhpcStatisticsStation xhpcSt =new XhpcStatisticsStation();
|
||||
xhpcSt.setChargingDegree(xhpc.getChargingDegree());
|
||||
if(xhpc.getChargingTimeNumber() !=null){
|
||||
@ -960,17 +968,18 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
xhpcSt.setCreateTime(Calendar.getInstance().getTime());
|
||||
xhpcSt.setTerminalId(xhpc.getTerminalId());
|
||||
xhpcSt.setChargingMode(xhpc.getChargingMode());
|
||||
xhpcSt.setHistoryOrderId(xhpc.getHistoryOrderId());
|
||||
|
||||
xhpcSt.setHistoryOrderId(historyOrderId);
|
||||
xhpcSt.setChargingPileId(xhpc.getChargingPileId());
|
||||
xhpcSt.setCreateTime(xhpc.getEndTime());
|
||||
xhpcSt.setSource(xhpc.getSource());
|
||||
xhpcSt.setInternetDegreeCommission(xhpc.getInternetDegreeCommission());
|
||||
for (int i = type; i <4 ; i++) {
|
||||
xhpcSt.setType(i);
|
||||
xhpcStatisticsService.addStatisticsStation(xhpcSt);
|
||||
}
|
||||
}
|
||||
//修改历史订单表状态
|
||||
xhpcHistoryOrderService.updateXhpcHistoryOrder(xhpc.getHistoryOrderId(),type+1);
|
||||
xhpcHistoryOrderService.updateXhpcHistoryOrder(historyOrderId,type+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,13 +155,19 @@ public interface XhpcStatisticsServiceMapper {
|
||||
*/
|
||||
void addStatisticsStation(XhpcStatisticsStation xhpcStatisticsStation);
|
||||
|
||||
/**
|
||||
* 查询是否重复录入数据
|
||||
* @param historyOrderId
|
||||
* @return
|
||||
*/
|
||||
int getStatisticsTimeHistoryOrderId(@Param("historyOrderId")Long historyOrderId);
|
||||
/**
|
||||
* 获取流量方列表
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,String>> getInternetList(@Param("userId")Long userId,@Param("tenantId")String tenantId);
|
||||
|
||||
|
||||
int getStatisticsStationHistoryOrderId(@Param("historyOrderId")Long historyOrderId,@Param("type")Integer type);
|
||||
/**
|
||||
* 订单来源列表
|
||||
* @param userId 用户id
|
||||
|
||||
@ -175,7 +175,12 @@ public interface IXhpcStatisticsService {
|
||||
*/
|
||||
void addStatisticsTime(XhpcStatisticsTimeInterval xhpcStatisticsTimeInterval);
|
||||
|
||||
|
||||
/**
|
||||
* 查询是否重复录入数据
|
||||
* @param historyOrderId
|
||||
* @return
|
||||
*/
|
||||
int getStatisticsTimeHistoryOrderId(Long historyOrderId);
|
||||
/**
|
||||
* 添加订单统计
|
||||
*
|
||||
@ -183,6 +188,13 @@ public interface IXhpcStatisticsService {
|
||||
*/
|
||||
void addStatisticsStation(XhpcStatisticsStation xhpcStatisticsStation);
|
||||
|
||||
/**
|
||||
* 查询是否重复录入数据
|
||||
* @param historyOrderId
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
int getStatisticsStationHistoryOrderId(Long historyOrderId,Integer type);
|
||||
|
||||
// -------------------- 导出功能 ------------------
|
||||
|
||||
|
||||
@ -469,11 +469,21 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
|
||||
xhpcStatisticsServiceMapper.addStatisticsTime(xhpcStatisticsTimeInterval);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatisticsTimeHistoryOrderId(Long historyOrderId) {
|
||||
return xhpcStatisticsServiceMapper.getStatisticsTimeHistoryOrderId(historyOrderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStatisticsStation(XhpcStatisticsStation xhpcStatisticsStation) {
|
||||
xhpcStatisticsServiceMapper.addStatisticsStation(xhpcStatisticsStation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatisticsStationHistoryOrderId(Long historyOrderId, Integer type) {
|
||||
return xhpcStatisticsServiceMapper.getStatisticsStationHistoryOrderId(historyOrderId, type);
|
||||
}
|
||||
|
||||
private boolean getJudge(Long internetUserId, Long operatorId, Integer type) {
|
||||
|
||||
if (type == null) {
|
||||
|
||||
@ -917,4 +917,11 @@
|
||||
</if>
|
||||
group by ss.charging_mode
|
||||
</select>
|
||||
|
||||
<select id="getStatisticsTimeHistoryOrderId" resultType="int">
|
||||
select count(statistics_time_interval_id) from xhpc_statistics_time_interval where history_order_id=#{historyOrderId}
|
||||
</select>
|
||||
<select id="getStatisticsStationHistoryOrderId" resultType="int">
|
||||
select count(statistics_station_id) from xhpc_statistics_station where history_order_id=#{historyOrderId} and type=#{type}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user