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