场站服务修改完成(租户和添加)
This commit is contained in:
parent
8b4bbb2cf1
commit
99c330627f
@ -5,9 +5,12 @@ import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||
import com.xhpc.charging.station.service.IXhpcTerminalService;
|
||||
import com.xhpc.common.domain.XhpcTerminal;
|
||||
import com.xhpc.common.log.annotation.Log;
|
||||
import com.xhpc.common.log.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -35,10 +38,10 @@ public class XhpcTerminalController extends BaseController {
|
||||
*/
|
||||
//@PreAuthorize(hasPermi = "system:station:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
public TableDataInfo list(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
|
||||
startPage();
|
||||
List<Map<String, Object>> list = xhpcTerminalService.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId);
|
||||
List<Map<String, Object>> list = xhpcTerminalService.getXhpcTerminalList(request,serialNumber, type, status, workStatus, chargingStationId);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -48,6 +51,7 @@ public class XhpcTerminalController extends BaseController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "终端-停用", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateStatus")
|
||||
public AjaxResult updateStatus(@RequestBody XhpcTerminal xhpcTerminal) {
|
||||
|
||||
@ -68,6 +72,7 @@ public class XhpcTerminalController extends BaseController {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "终端-修改", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateXhpcTerminalName")
|
||||
public AjaxResult updateXhpcTerminalName(@RequestBody XhpcTerminal xhpcTerminal) {
|
||||
|
||||
|
||||
@ -191,7 +191,7 @@ public interface XhpcChargingStationMapper {
|
||||
/**
|
||||
* 添加费率时段
|
||||
*/
|
||||
int addXhpcRateTime(XhpcRateTime xhpcRateTime);
|
||||
int insertXhpcRateTime(XhpcRateTime xhpcRateTime);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -26,7 +26,7 @@ public interface XhpcChargingStationPushStatusMapper {
|
||||
* @date 2021/11/4 12:54
|
||||
* @since version-1.0
|
||||
*/
|
||||
Integer saveStationPushStatus(@Param("chargingStationId") Integer chargingStationId, @Param("stationName") String stationName, @Param("pushStatus") Integer pushStatus);
|
||||
Integer insertStationPushStatus(@Param("chargingStationId") Integer chargingStationId, @Param("stationName") String stationName, @Param("pushStatus") Integer pushStatus);
|
||||
|
||||
/**
|
||||
* 查找电站id是否已经存在
|
||||
|
||||
@ -33,7 +33,7 @@ public interface XhpcTerminalMapper {
|
||||
* @param chargingStationId
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getXhpcTerminalList(@Param("serialNumber") String serialNumber, @Param("type") Integer type, @Param("status") Integer status, @Param("workStatus") String workStatus, @Param("chargingStationId") Long chargingStationId);
|
||||
List<Map<String, Object>> getXhpcTerminalList(@Param("serialNumber") String serialNumber, @Param("type") Integer type, @Param("status") Integer status, @Param("workStatus") String workStatus, @Param("chargingStationId") Long chargingStationId, @Param("tenantId") String tenantId);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xhpc.charging.station.service;
|
||||
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -24,7 +25,7 @@ public interface IXhpcTerminalService {
|
||||
/**
|
||||
* 列表接口
|
||||
*/
|
||||
List<Map<String, Object>> getXhpcTerminalList(String serialNumber, Integer type,Integer status,String workStatus, Long chargingStationId);
|
||||
List<Map<String, Object>> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 停用
|
||||
|
||||
@ -86,7 +86,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
if (map != null) {
|
||||
return 0;
|
||||
}
|
||||
return xhpcChargingStationPushStatusMapper.saveStationPushStatus(chargingStationId, stationName, pushStatus);
|
||||
return xhpcChargingStationPushStatusMapper.insertStationPushStatus(chargingStationId, stationName, pushStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -681,7 +681,7 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
xhpcRateTime.setType(type);
|
||||
xhpcRateTime.setRateValue(rateValue);
|
||||
xhpcRateTime.setCreateTime(Calendar.getInstance().getTime());
|
||||
xhpcChargingStationMapper.addXhpcRateTime(xhpcRateTime);
|
||||
xhpcChargingStationMapper.insertXhpcRateTime(xhpcRateTime);
|
||||
return sort++;
|
||||
}
|
||||
|
||||
|
||||
@ -4,9 +4,12 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.xhpc.charging.station.mapper.XhpcTerminalMapper;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.common.domain.XhpcTerminal;
|
||||
import com.xhpc.common.util.LogUserUtils;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@ -26,7 +29,8 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
||||
|
||||
@Autowired
|
||||
private IXhpcChargingStationService xhpcChargingStationService;
|
||||
|
||||
@Autowired
|
||||
private LogUserUtils logUserUtils;
|
||||
/**
|
||||
* PC端页面统计
|
||||
*
|
||||
@ -40,9 +44,9 @@ public class XhpcTerminalServiceImpl implements IXhpcTerminalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getXhpcTerminalList(String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
|
||||
List<Map<String, Object>> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId);
|
||||
public List<Map<String, Object>> getXhpcTerminalList(HttpServletRequest request, String serialNumber, Integer type, Integer status, String workStatus, Long chargingStationId) {
|
||||
LoginUser logUser = logUserUtils.getLogUser(request);
|
||||
List<Map<String, Object>> list = xhpcTerminalMapper.getXhpcTerminalList(serialNumber, type, status, workStatus, chargingStationId,logUser.getTenantId());
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
Map<String, Object> map = list.get(i);
|
||||
|
||||
@ -718,7 +718,7 @@
|
||||
</insert>
|
||||
|
||||
|
||||
<insert id="addXhpcRateTime" parameterType="com.xhpc.common.domain.XhpcRateTime" useGeneratedKeys="true"
|
||||
<insert id="insertXhpcRateTime" parameterType="com.xhpc.common.domain.XhpcRateTime" useGeneratedKeys="true"
|
||||
keyProperty="rateId">
|
||||
insert into xhpc_rate_time
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<insert id="saveStationPushStatus">
|
||||
<insert id="insertStationPushStatus">
|
||||
insert into xhpc_charging_station_push_status (charging_station_id, station_name, push_status)
|
||||
values (#{chargingStationId}, #{stationName}, #{pushStatus})
|
||||
</insert>
|
||||
|
||||
@ -107,6 +107,9 @@
|
||||
<if test="workStatus !=null and workStatus !=''">
|
||||
and te.work_status=#{chargingStationId}
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId !=''">
|
||||
and te.tenant_id=#{tenantId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user