更新清分模块待清分金额的计算,待清分订单审核的判断
This commit is contained in:
parent
8f280f701f
commit
0ed2f618be
@ -83,7 +83,7 @@ public class XhpcClearingCheckoutController extends BaseController {
|
|||||||
|
|
||||||
LoginUser loginUser = logUserUtils.getLogUser(request);
|
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||||
Long operatorId = loginUser.getSysUser().getOperatorId();
|
Long operatorId = loginUser.getSysUser().getOperatorId();
|
||||||
if(operatorId == null || operatorId < 0){
|
if(operatorId == null){
|
||||||
throw new CustomException("运营商ID错误,请登陆运营商账户再试");
|
throw new CustomException("运营商ID错误,请登陆运营商账户再试");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,9 @@ public class XhpcClearingCheckoutController extends BaseController {
|
|||||||
if (domain.getOperatorId() == null || domain.getOperatorId() == 0){
|
if (domain.getOperatorId() == null || domain.getOperatorId() == 0){
|
||||||
domain.setOperatorId(loginUser.getSysUser().getOperatorId());
|
domain.setOperatorId(loginUser.getSysUser().getOperatorId());
|
||||||
}
|
}
|
||||||
|
if(domain.getOperatorId() == null){
|
||||||
|
throw new CustomException("运营商ID错误,请登陆运营商账户再试");
|
||||||
|
}
|
||||||
return R.ok(checkoutService.insertDomain(domain));
|
return R.ok(checkoutService.insertDomain(domain));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,11 @@ import cn.hutool.poi.excel.ExcelUtil;
|
|||||||
import cn.hutool.poi.excel.ExcelWriter;
|
import cn.hutool.poi.excel.ExcelWriter;
|
||||||
import com.xhpc.activity.domain.XhpcClearingHistoryOrderDomain;
|
import com.xhpc.activity.domain.XhpcClearingHistoryOrderDomain;
|
||||||
import com.xhpc.activity.domain.XhpcOperatorDomain;
|
import com.xhpc.activity.domain.XhpcOperatorDomain;
|
||||||
import com.xhpc.activity.mapper.*;
|
import com.xhpc.activity.mapper.XhpcClearingBankMapper;
|
||||||
|
import com.xhpc.activity.mapper.XhpcClearingCheckoutMapper;
|
||||||
|
import com.xhpc.activity.mapper.XhpcClearingHistoryOrderMapper;
|
||||||
|
import com.xhpc.activity.mapper.XhpcHistoryOrderMapper;
|
||||||
|
import com.xhpc.activity.mapper.XhpcOperatorMapper;
|
||||||
import com.xhpc.activity.service.XhpcClearingHistoryOrderService;
|
import com.xhpc.activity.service.XhpcClearingHistoryOrderService;
|
||||||
import com.xhpc.activity.vo.ClearingOrderVo;
|
import com.xhpc.activity.vo.ClearingOrderVo;
|
||||||
import com.xhpc.common.core.exception.CustomException;
|
import com.xhpc.common.core.exception.CustomException;
|
||||||
@ -23,7 +27,9 @@ import javax.servlet.ServletOutputStream;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -55,23 +61,23 @@ public class XhpcClearingHistoryOrderServiceImpl extends BaseService implements
|
|||||||
LoginUser loginUser = tokenService.getLoginUser();
|
LoginUser loginUser = tokenService.getLoginUser();
|
||||||
SysUser sysUser = loginUser.getSysUser();
|
SysUser sysUser = loginUser.getSysUser();
|
||||||
Long sysUserId = sysUser.getUserId();
|
Long sysUserId = sysUser.getUserId();
|
||||||
if(!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())){
|
if (!UserTypeUtil.SYS_USER_TYPE_ADMIN.equals(sysUser.getUserId())) {
|
||||||
|
|
||||||
if(UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())){
|
if (UserTypeUtil.SYS_USER_TYPE_ONE.equals(sysUser.getUserType())) {
|
||||||
Long logOperatorId = sysUser.getOperatorId();
|
Long logOperatorId = sysUser.getOperatorId();
|
||||||
//运营商看自己的场站
|
//运营商看自己的场站
|
||||||
params.put("type", 1);
|
params.put("type", 1);
|
||||||
params.put("logOperatorId",logOperatorId);
|
params.put("logOperatorId", logOperatorId);
|
||||||
return historyOrderMapper.getListPage(params);
|
return historyOrderMapper.getListPage(params);
|
||||||
}else{
|
} else {
|
||||||
//查询赋值的场站
|
//查询赋值的场站
|
||||||
params.put("type", 1);
|
params.put("type", 1);
|
||||||
params.put("logOperatorId",sysUserId);
|
params.put("logOperatorId", sysUserId);
|
||||||
return historyOrderMapper.getListPage(params);
|
return historyOrderMapper.getListPage(params);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
params.put("type", 0);
|
params.put("type", 0);
|
||||||
params.put("logOperatorId",sysUserId);
|
params.put("logOperatorId", sysUserId);
|
||||||
return historyOrderMapper.getListPage(params);
|
return historyOrderMapper.getListPage(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,26 +89,24 @@ public class XhpcClearingHistoryOrderServiceImpl extends BaseService implements
|
|||||||
throw new CustomException("缺少订单ID");
|
throw new CustomException("缺少订单ID");
|
||||||
}
|
}
|
||||||
|
|
||||||
String orderIds = "";
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("startTime", orderVo.getStartTime());
|
||||||
|
params.put("endTime", orderVo.getEndTime());
|
||||||
|
params.put("orderNo", orderVo.getOrderNo());
|
||||||
|
params.put("userType", orderVo.getUserType());
|
||||||
|
params.put("internetName", orderVo.getInternetName());
|
||||||
|
params.put("operatorId", orderVo.getOperatorId());
|
||||||
|
params.put("stationId", orderVo.getStationId());
|
||||||
|
params.put("tenantId", orderVo.getTenantId());
|
||||||
|
params.put("orderIds", orderVo.getOrderIds());
|
||||||
|
|
||||||
if (orderVo.getOrderIds().equals("-1")) {
|
List<XhpcClearingHistoryOrderDomain> orderDomainList = historyOrderMapper.getListPage(params);
|
||||||
Map<String, Object> params = new HashMap<>();
|
String orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(","));
|
||||||
params.put("startTime", orderVo.getStartTime());
|
|
||||||
params.put("endTime", orderVo.getEndTime());
|
|
||||||
params.put("orderNo", orderVo.getOrderNo());
|
|
||||||
params.put("userType", orderVo.getUserType());
|
|
||||||
params.put("internetName", orderVo.getInternetName());
|
|
||||||
params.put("operatorId", orderVo.getOperatorId());
|
|
||||||
params.put("stationId", orderVo.getStationId());
|
|
||||||
|
|
||||||
List<XhpcClearingHistoryOrderDomain> orderDomainList = historyOrderMapper.getListPage(params);
|
if (StringUtils.isNotEmpty(orderIds)){
|
||||||
orderIds = orderDomainList.stream().map(n -> n.getClearingOrderId().toString()).collect(Collectors.joining(","));
|
historyOrderMapper.updateStatusBatchByOrderIds(orderIds, orderVo.getStatus(), orderVo.getCheckBy());
|
||||||
} else {
|
|
||||||
orderIds = orderVo.getOrderIds();
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
return historyOrderMapper.updateStatusBatchByOrderIds(orderIds, orderVo.getStatus(), orderVo.getCheckBy()) > 0;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,7 +193,7 @@ public class XhpcClearingHistoryOrderServiceImpl extends BaseService implements
|
|||||||
bankDomain = new HashMap<>();
|
bankDomain = new HashMap<>();
|
||||||
|
|
||||||
XhpcOperatorDomain operatorDomain = operatorMapper.selectByPrimaryKey(Long.parseLong(operatorId));
|
XhpcOperatorDomain operatorDomain = operatorMapper.selectByPrimaryKey(Long.parseLong(operatorId));
|
||||||
if(operatorDomain != null){
|
if (operatorDomain != null) {
|
||||||
bankDomain.put("operatorName", operatorDomain.getName());
|
bankDomain.put("operatorName", operatorDomain.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public class ClearingOrderVo {
|
|||||||
private String orderIds;
|
private String orderIds;
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
private String checkBy;
|
private String checkBy;
|
||||||
|
|
||||||
private String startTime;
|
private String startTime;
|
||||||
@ -19,5 +19,6 @@ public class ClearingOrderVo {
|
|||||||
private String internetName;
|
private String internetName;
|
||||||
private String operatorId;
|
private String operatorId;
|
||||||
private String stationId;
|
private String stationId;
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,13 +92,12 @@
|
|||||||
select
|
select
|
||||||
ifnull(sum(ho.act_power_price + ho.act_service_price), 0) as 'unClearingAmount',
|
ifnull(sum(ho.act_power_price + ho.act_service_price), 0) as 'unClearingAmount',
|
||||||
ct.operator_id as 'operatorId'
|
ct.operator_id as 'operatorId'
|
||||||
from xhpc_history_order as ho
|
from xhpc_clearing_history_order as ho
|
||||||
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
|
||||||
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
left join xhpc_operator as op on op.operator_id = ct.operator_id
|
||||||
where ho.state <![CDATA[ <> ]]> 3 and ho.del_flag=0
|
where ho.check_status not in (1,2) and ho.del_flag=0
|
||||||
GROUP BY ct.operator_id
|
GROUP BY ct.operator_id
|
||||||
) ho on ho.operatorId = xo.operator_id
|
) ho on ho.operatorId = xo.operator_id
|
||||||
|
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
select
|
select
|
||||||
ifnull(sum(ho.act_power_price + ho.act_service_price), 0) as 'cashAmount',
|
ifnull(sum(ho.act_power_price + ho.act_service_price), 0) as 'cashAmount',
|
||||||
|
|||||||
@ -284,13 +284,13 @@
|
|||||||
and find_in_set(ho.clearing_order_id, #{params.orderIds})
|
and find_in_set(ho.clearing_order_id, #{params.orderIds})
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<if test="params.operatorId !=null">
|
<if test="params.operatorId !=null and params.operatorId !=''">
|
||||||
and ho.operator_id =#{params.operatorId}
|
and ho.operator_id =#{params.operatorId}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.chargingStationId !=null">
|
<if test="params.chargingStationId !=null and params.chargingStationId !=''">
|
||||||
and ho.charging_station_id =#{params.chargingStationId}
|
and ho.charging_station_id =#{params.chargingStationId}
|
||||||
</if>
|
</if>
|
||||||
<if test="params.chargingPileId !=null">
|
<if test="params.chargingPileId !=null and params.chargingPileId !=''">
|
||||||
and ho.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{params.chargingPileId} and del_flag =0)
|
and ho.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{params.chargingPileId} and del_flag =0)
|
||||||
</if>
|
</if>
|
||||||
<if test="params.type==1">
|
<if test="params.type==1">
|
||||||
@ -299,6 +299,9 @@
|
|||||||
<if test="params.type==2">
|
<if test="params.type==2">
|
||||||
and ho.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.logOperatorId})
|
and ho.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{params.logOperatorId})
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.orderIds != null and params.orderIds!='' and params.orderIds !='-1'">
|
||||||
|
and find_in_set(ho.clearing_order_id, #{params.orderIds})
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user