场站(启用停用、APP端小程序是否可见、合作流量方)
This commit is contained in:
parent
7ebef46eb1
commit
f1fbedd575
@ -9,6 +9,7 @@ import com.ruoyi.common.log.enums.BusinessType;
|
|||||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||||
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -97,4 +98,44 @@ public class XhpcChargingStationController extends BaseController {
|
|||||||
{
|
{
|
||||||
return toAjax(xhpcChargingStationService.updateXhpcChargingStationByIds(chargingStationIds));
|
return toAjax(xhpcChargingStationService.updateXhpcChargingStationByIds(chargingStationIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*/
|
||||||
|
//@PreAuthorize(hasPermi = "system:station:remove")
|
||||||
|
//@Log(title = "电站", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/status")
|
||||||
|
public AjaxResult status(@Param("status")Integer status,@Param("chargingStationId")Long chargingStationId)
|
||||||
|
{
|
||||||
|
return toAjax(xhpcChargingStationService.status(status,chargingStationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP端、小程序是否可见
|
||||||
|
* @param type 0可见 1不可见
|
||||||
|
* @param clientVisible 值
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
//@PreAuthorize(hasPermi = "system:station:remove")
|
||||||
|
//@Log(title = "电站", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/clientVisible")
|
||||||
|
public AjaxResult status(@Param("type")Integer type,@Param("clientVisible")String clientVisible,@Param("chargingStationId")Long chargingStationId)
|
||||||
|
{
|
||||||
|
return toAjax(xhpcChargingStationService.clientVisible(type,clientVisible,chargingStationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合作的电站
|
||||||
|
*/
|
||||||
|
//@PreAuthorize(hasPermi = "system:station:remove")
|
||||||
|
//@Log(title = "电站", businessType = BusinessType.DELETE)
|
||||||
|
@GetMapping(value = "/stationInternetBlackList")
|
||||||
|
public AjaxResult stationInternetBlackList(@Param("chargingStationId") Long chargingStationId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(xhpcChargingStationService.stationInternetBlackList(chargingStationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,4 +61,30 @@ public interface XhpcChargingStationMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateXhpcChargingStationByIds(Long[] chargingStationIds);
|
int updateXhpcChargingStationByIds(Long[] chargingStationIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*
|
||||||
|
* @param status 0正常 1停用
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
void status(@Param("status") Integer status,@Param("chargingStationId")Long chargingStationId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP端、小程序是否可见
|
||||||
|
*
|
||||||
|
* @param clientVisible app可见值
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
void clientVisible(@Param("clientVisible") String clientVisible,@Param("chargingStationId")Long chargingStationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合作的电站
|
||||||
|
*
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,8 @@ public interface IXhpcChargingStationService {
|
|||||||
/**
|
/**
|
||||||
* 查询电站列表
|
* 查询电站列表
|
||||||
*
|
*
|
||||||
* @param xhpcChargingStation 电站
|
* @param name 电站名称
|
||||||
|
* @param operatorName 运营商名称
|
||||||
* @return 电站集合
|
* @return 电站集合
|
||||||
*/
|
*/
|
||||||
public List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName);
|
public List<Map<String,Object>> selectXhpcChargingStationList(String name,String operatorName);
|
||||||
@ -60,4 +61,31 @@ public interface IXhpcChargingStationService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateXhpcChargingStationById(Long chargingStationId);
|
public int updateXhpcChargingStationById(Long chargingStationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*
|
||||||
|
* @param status 0正常 1停用
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int status(Integer status,Long chargingStationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP端、小程序是否可见
|
||||||
|
*
|
||||||
|
* @param type 0可见 1不可见
|
||||||
|
* @param clientVisible 值
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int clientVisible(Integer type,String clientVisible,Long chargingStationId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合作的电站
|
||||||
|
*
|
||||||
|
* @param chargingStationId 电站ID
|
||||||
|
* @return 电站
|
||||||
|
*/
|
||||||
|
public List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,7 @@ import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电站Service业务层处理
|
* 电站Service业务层处理
|
||||||
@ -42,7 +40,8 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
/**
|
/**
|
||||||
* 查询电站列表
|
* 查询电站列表
|
||||||
*
|
*
|
||||||
* @param xhpcChargingStation 电站
|
* @param name 电站名称
|
||||||
|
* @param operatorName 运营商名称
|
||||||
* @return 电站
|
* @return 电站
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -118,4 +117,63 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
|||||||
{
|
{
|
||||||
return xhpcChargingStationMapper.updateXhpcChargingStationById(chargingStationId);
|
return xhpcChargingStationMapper.updateXhpcChargingStationById(chargingStationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*
|
||||||
|
* @param status 0正常 1停用
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int status(Integer status,Long chargingStationId) {
|
||||||
|
if(status !=null && (status ==0 || status==1)){
|
||||||
|
xhpcChargingStationMapper.status(status,chargingStationId);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP端、小程序是否可见
|
||||||
|
*
|
||||||
|
* @param type 0可见 1不可见
|
||||||
|
* @param clientVisible 值
|
||||||
|
* @param chargingStationId 场站id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int clientVisible(Integer type, String clientVisible, Long chargingStationId) {
|
||||||
|
|
||||||
|
//判断状态
|
||||||
|
if(type !=null && (type ==0 || type==1)){
|
||||||
|
//获取场站数据
|
||||||
|
XhpcChargingStation xhpcChargingStation = xhpcChargingStationMapper.selectXhpcChargingStationById(chargingStationId);
|
||||||
|
String clientVisibleValue = xhpcChargingStation.getClientVisible();
|
||||||
|
if(clientVisibleValue ==null || clientVisibleValue ==""){
|
||||||
|
if(type ==0){
|
||||||
|
xhpcChargingStationMapper.clientVisible(clientVisible,chargingStationId);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//去掉重复的值
|
||||||
|
String[] split = clientVisibleValue.split(",");
|
||||||
|
Set<String> set= new HashSet<>(Arrays.asList(split));
|
||||||
|
if(type ==0){
|
||||||
|
set.add(clientVisible);
|
||||||
|
}else{
|
||||||
|
set.remove(clientVisible);
|
||||||
|
}
|
||||||
|
String str = String.join(",", set);
|
||||||
|
xhpcChargingStationMapper.clientVisible(str,chargingStationId);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String,Object>> stationInternetBlackList(Long chargingStationId) {
|
||||||
|
return xhpcChargingStationMapper.stationInternetBlackList(chargingStationId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,4 +154,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{chargingStationId}
|
#{chargingStationId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="status">
|
||||||
|
update xhpc_charging_station set status =#{status} where charging_station_id = #{chargingStationId} and del_flag =0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="clientVisible">
|
||||||
|
update xhpc_charging_station set client_visible =#{clientVisible} where charging_station_id = #{chargingStationId} and del_flag =0
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="stationInternetBlackList" resultType="map">
|
||||||
|
select name from xhpc_internet_user where del_flag=0 and internet_user_id not in (select internet_user_id from xhpc_station_internet_blacklist where charging_station_id=#{chargingStationId})
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
x
Reference in New Issue
Block a user