更新桩运行日志增加查询参数
This commit is contained in:
parent
4fb0e210e5
commit
a5323c7df4
@ -1,4 +1,4 @@
|
|||||||
package com.xhpc.log;
|
package com.xhpc;
|
||||||
|
|
||||||
import com.xhpc.common.security.annotation.EnableCustomConfig;
|
import com.xhpc.common.security.annotation.EnableCustomConfig;
|
||||||
import com.xhpc.common.security.annotation.EnableRyFeignClients;
|
import com.xhpc.common.security.annotation.EnableRyFeignClients;
|
||||||
@ -4,11 +4,14 @@ import com.xhpc.common.core.utils.SecurityUtils;
|
|||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
import com.xhpc.common.enums.StationDeviceEnum;
|
import com.xhpc.common.enums.StationDeviceEnum;
|
||||||
|
import com.xhpc.common.util.LogUserUtils;
|
||||||
import com.xhpc.log.service.OrderLogService;
|
import com.xhpc.log.service.OrderLogService;
|
||||||
|
import com.xhpc.system.api.model.LoginUser;
|
||||||
import lombok.extern.java.Log;
|
import lombok.extern.java.Log;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -24,20 +27,29 @@ public class OrderLogController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
OrderLogService orderLogService;
|
OrderLogService orderLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
LogUserUtils logUserUtils;
|
||||||
|
|
||||||
@GetMapping("/getPage")
|
@GetMapping("/getPage")
|
||||||
public TableDataInfo getOrderPage(
|
public TableDataInfo getOrderPage(
|
||||||
|
HttpServletRequest request,
|
||||||
@RequestParam(required = false) String orderId,
|
@RequestParam(required = false) String orderId,
|
||||||
@RequestParam(required = false) String phone,
|
@RequestParam(required = false) String phone,
|
||||||
@RequestParam(required = false) String tenantId,
|
@RequestParam(required = false) String startTime,
|
||||||
|
@RequestParam(required = false) String endTime,
|
||||||
@RequestParam(required = false) Integer number){
|
@RequestParam(required = false) Integer number){
|
||||||
|
|
||||||
|
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||||
|
|
||||||
startPage();
|
startPage();
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("orderId", orderId);
|
params.put("orderId", orderId);
|
||||||
params.put("phone", phone);
|
params.put("phone", phone);
|
||||||
|
params.put("startTime", startTime);
|
||||||
|
params.put("endTime", endTime);
|
||||||
params.put("operatorId", SecurityUtils.getUserId());
|
params.put("operatorId", SecurityUtils.getUserId());
|
||||||
params.put("number", number);
|
params.put("number", number);
|
||||||
params.put("tenantId", tenantId);
|
params.put("tenantId", loginUser.getTenantId());
|
||||||
return getDataTable(orderLogService.getOrderPage(params));
|
return getDataTable(orderLogService.getOrderPage(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,10 +5,13 @@ import com.xhpc.common.core.utils.SecurityUtils;
|
|||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
import com.xhpc.common.enums.StationDeviceEnum;
|
import com.xhpc.common.enums.StationDeviceEnum;
|
||||||
|
import com.xhpc.common.util.LogUserUtils;
|
||||||
import com.xhpc.log.service.PileLogService;
|
import com.xhpc.log.service.PileLogService;
|
||||||
|
import com.xhpc.system.api.model.LoginUser;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -24,34 +27,43 @@ public class PileLogController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
PileLogService pileLogService;
|
PileLogService pileLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
LogUserUtils logUserUtils;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getPage")
|
@GetMapping("/getPage")
|
||||||
public TableDataInfo getPilePage(
|
public TableDataInfo getPilePage(
|
||||||
|
HttpServletRequest request,
|
||||||
@RequestParam(required = false) String stationName,
|
@RequestParam(required = false) String stationName,
|
||||||
@RequestParam(required = false) String tenantId,
|
@RequestParam(required = false) String pileName,
|
||||||
|
@RequestParam(required = false) String pileSerialNumber,
|
||||||
@RequestParam(required = false) Integer number) {
|
@RequestParam(required = false) Integer number) {
|
||||||
|
|
||||||
|
LoginUser loginUser = logUserUtils.getLogUser(request);
|
||||||
|
|
||||||
startPage();
|
startPage();
|
||||||
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
params.put("stationName", stationName);
|
params.put("stationName", stationName);
|
||||||
|
params.put("pileName", pileName);
|
||||||
params.put("operatorId", SecurityUtils.getUserId());
|
params.put("operatorId", SecurityUtils.getUserId());
|
||||||
params.put("number", number);
|
params.put("number", number);
|
||||||
params.put("tenantId", tenantId);
|
params.put("pileSerialNumber", pileSerialNumber);
|
||||||
|
params.put("tenantId", loginUser.getTenantId());
|
||||||
return getDataTable(pileLogService.getPilePage(params));
|
return getDataTable(pileLogService.getPilePage(params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public TableDataInfo getPileDetailPage(@RequestParam("pileId") String pileId,
|
public TableDataInfo getPileDetailPage(@RequestParam("pileId") String pileId,
|
||||||
@RequestParam(required = false) String startTime,
|
@RequestParam(required = false) String startTime,
|
||||||
@RequestParam(required = false) String endTime) {
|
@RequestParam(required = false) String endTime) {
|
||||||
|
|
||||||
startPage();
|
startPage();
|
||||||
return getDataTable(pileLogService.getPileRunLogPage(pileId, startTime, endTime));
|
return getDataTable(pileLogService.getPileRunLogPage(pileId, startTime, endTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response,
|
public void export(HttpServletResponse response,
|
||||||
@RequestParam("pileId") String pileId,
|
@RequestParam("pileId") String pileId,
|
||||||
|
|||||||
@ -98,6 +98,12 @@
|
|||||||
<!-- <if test="chargingStationId !=null and chargingStationId!=''">-->
|
<!-- <if test="chargingStationId !=null and chargingStationId!=''">-->
|
||||||
<!-- and cp.charging_station_id=#{chargingStationId}-->
|
<!-- and cp.charging_station_id=#{chargingStationId}-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
|
<if test="params.pileSerialNumber!=null and params.pileSerialNumber!=''">
|
||||||
|
and cp.serial_number = #{params.pileSerialNumber}
|
||||||
|
</if>
|
||||||
|
<if test="params.pileName!=null and params.pileName!=''">
|
||||||
|
and concat(cp.name,'号桩') like concat ('%', #{params.pileName},'%')
|
||||||
|
</if>
|
||||||
<if test="params.stationName!=null and params.stationName!=''">
|
<if test="params.stationName!=null and params.stationName!=''">
|
||||||
and st.name like CONCAT('%',#{params.stationName},'%')
|
and st.name like CONCAT('%',#{params.stationName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -27,6 +27,13 @@
|
|||||||
<if test="params.tenantId != null and params.tenantId != ''">
|
<if test="params.tenantId != null and params.tenantId != ''">
|
||||||
and co.tenant_id = #{params.tenantId}
|
and co.tenant_id = #{params.tenantId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="params.startTime!=null and params.startTime!=''">
|
||||||
|
and co.start_time <![CDATA[ >= ]]> #{params.startTime}
|
||||||
|
</if>
|
||||||
|
<if test="params.endTime !=null and params.endTime!=''">
|
||||||
|
and co.create_time <![CDATA[ <= ]]> #{params.endTime}
|
||||||
|
</if>
|
||||||
|
|
||||||
order by co.create_time desc
|
order by co.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user