优化统计,优化订单结算

This commit is contained in:
yuyang 2022-05-23 15:16:42 +08:00
parent f531afb503
commit 23a4f56d86
2 changed files with 84 additions and 107 deletions

View File

@ -496,6 +496,8 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
Map<String, Double> params1 =new HashMap<>();
if("1".equals(judgeActivity.get("status").toString())){
judge =true;
logger.info("<<<<<<<<<<<<<<<价格、时间、公式都相同>>>>>>>>>>>>>>>>>");
params1.put("T",money.doubleValue());
params1.put("P",powerPrice.doubleValue());
params1.put("S",servicePrice.doubleValue());
@ -528,7 +530,8 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
promotionDiscount = money.subtract(activityTotalPriceTotal);
xhpcHistoryOrder.setActivityId(judgeActivity.get("activityId").toString());
}else if("2".equals(judgeActivity.get("status").toString())){
judge =true;
logger.info("<<<<<<<<<<<<<<<价格、时间都相同>>>>>>>>>>>>>>>>>");
String computeFormula = judgeActivity.get("computeFormula").toString();
BigDecimal powerPrice1 = new BigDecimal(judgeActivity.get("powerPrice").toString());
BigDecimal servicePrice1 = new BigDecimal(judgeActivity.get("servicePrice").toString());

View File

@ -44,9 +44,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public List<Map<String, Object>> getTimeIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -164,9 +162,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}
@Override
public List<Map<String, Object>> getDateIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -197,9 +193,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public List<Map<String, Object>> getStationIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -233,9 +227,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public List<Map<String, Object>> getOperatorIntervalPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId,String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if(getJudge(null,operatorId,type)){
return new ArrayList<>();
}
List<String> operatorUserId =new ArrayList<>();
if(!"".equals(operatorIds) && operatorIds !=null){
operatorUserId= Arrays.asList(operatorIds.split(","));
@ -264,9 +256,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public List<Map<String, Object>> getInternetUserIntervalPage(HttpServletRequest request,String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) {
if(getJudge(internetUserId,null,type)){
return new ArrayList<>();
}
List<String> internetIds =new ArrayList<>();
if(!"".equals(internetUserIds) && internetUserIds !=null){
internetIds= Arrays.asList(internetUserIds.split(","));
@ -514,9 +503,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public List<Map<String, Object>> getMechanismPage(HttpServletRequest request,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type,Integer source) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -566,7 +552,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}
private boolean getJudge(Long internetUserId, Long operatorId, Integer type) {
if (type == null) {
return true;
}
@ -674,9 +659,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public void dateIntervalExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException {
List<Map<String, Object>> list =new ArrayList<>();
if (getJudge(internetUserId, operatorId, type)){
}else{
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -699,7 +682,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}else{
list =xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId,chargingPileId,terminalId,chargingStationIdList, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId);
}
}
// 通过工具类创建writer默认创建xls格式
BigExcelWriter writer = ExcelUtil.getBigWriter("temp_" + System.currentTimeMillis() + ".xlsx");
writer.addHeaderAlias("createTime", "日期");
@ -744,9 +727,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public void stationIntervalExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException {
List<Map<String, Object>> list =new ArrayList<>();
if (getJudge(internetUserId, operatorId, type)){
}else{
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -771,7 +752,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}else{
list =xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,chargingPileId,terminalId,chargingStationIdList,operatorUserId,internetUserId,operatorId,startTime,endTime,0,sysUserId,tenantId);
}
}
// 通过工具类创建writer默认创建xls格式
BigExcelWriter writer = ExcelUtil.getBigWriter("temp_" + System.currentTimeMillis() + ".xlsx");
@ -819,9 +799,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public void operatorIntervalExport(HttpServletRequest request,HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type) throws IOException {
List<Map<String, Object>> list =new ArrayList<>();
if(getJudge(null,operatorId,type)){
}else{
List<String> operatorUserId =new ArrayList<>();
if(!"".equals(operatorIds) && operatorIds !=null){
operatorUserId= Arrays.asList(operatorIds.split(","));
@ -842,7 +820,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}else{
list =xhpcStatisticsServiceMapper.getOperatorIntervalPage(chargingStationId,chargingPileId,terminalId,operatorUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId);
}
}
// 通过工具类创建writer默认创建xls格式
BigExcelWriter writer = ExcelUtil.getBigWriter("temp_" + System.currentTimeMillis() + ".xlsx");
writer.addHeaderAlias("operatorName", "运营商名称");
@ -1004,9 +981,7 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
@Override
public void getMechanismExport(HttpServletRequest request, HttpServletResponse response,String tenantId,Long chargingStationId,Long chargingPileId,Long terminalId, String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type, Integer source) throws IOException {
List<Map<String, Object>> list =new ArrayList<>();
if (getJudge(internetUserId, operatorId, type)){
}else{
List<String> chargingStationIdList =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationIdList= Arrays.asList(chargingStationIds.split(","));
@ -1028,7 +1003,6 @@ public class XhpcStatisticsServiceImpl extends BaseService implements IXhpcStati
}else{
list =xhpcStatisticsServiceMapper.getMechanismPage(chargingStationId,chargingPileId,terminalId,chargingStationIdList, internetUserId, operatorId, startTime, endTime, 0,sysUserId,tenantId,source);
}
}
// 通过工具类创建writer默认创建xls格式
BigExcelWriter writer = ExcelUtil.getBigWriter("temp_" + System.currentTimeMillis() + ".xlsx");
writer.addHeaderAlias("internetUserName", "流量方名称");