场站添加接口
This commit is contained in:
parent
a9559fd4b3
commit
e10fde5e9a
@ -8,6 +8,7 @@ import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.PreAuthorize;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
import com.xhpc.charging.station.service.IXhpcChargingStationService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -138,6 +139,17 @@ public class XhpcChargingStationController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加场点
|
||||
* @param xhpcChargingStationDto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/addXhpcChargingStation")
|
||||
public AjaxResult addXhpcChargingStation(@Param("xhpcChargingStationDto") XhpcChargingStationDto xhpcChargingStationDto)
|
||||
{
|
||||
return xhpcChargingStationService.addXhpcChargingStation(xhpcChargingStationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序电站列表
|
||||
* @param name 电站名称
|
||||
|
||||
@ -84,6 +84,10 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
@Excel(name = "当前计费模型id")
|
||||
private Long rateModelId;
|
||||
|
||||
/** 图片id */
|
||||
@Excel(name = "图片id")
|
||||
private String imgId;
|
||||
|
||||
public void setChargingStationId(Long chargingStationId)
|
||||
{
|
||||
this.chargingStationId = chargingStationId;
|
||||
@ -246,4 +250,15 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
{
|
||||
return rateModelId;
|
||||
}
|
||||
|
||||
public String getImgId() {
|
||||
|
||||
return imgId;
|
||||
}
|
||||
|
||||
public void setImgId(String imgId) {
|
||||
|
||||
this.imgId = imgId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package com.xhpc.charging.station.domain;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
|
||||
/**
|
||||
* 费率对象 xhpc_rate
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
public class XhpcRate extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 费率id */
|
||||
private Long rateId;
|
||||
|
||||
/** 电站id */
|
||||
private Long chargingStationId;
|
||||
|
||||
/** 电费 */
|
||||
private Decimal powerFee;
|
||||
|
||||
/** 服务费 */
|
||||
private Decimal serviceFee;
|
||||
|
||||
/** 名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
private Integer status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
/** 费率模型id */
|
||||
private Long rateModelId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.xhpc.charging.station.dto;
|
||||
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.domain.XhpcRate;
|
||||
import com.xhpc.charging.station.domain.XhpcRateTime;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class XhpcChargingStationDto extends XhpcChargingStation {
|
||||
|
||||
//费率
|
||||
List<XhpcRate> xhpcRateList;
|
||||
|
||||
//费率时段
|
||||
List<XhpcRateTime> xhpcRateTimeList;
|
||||
|
||||
public List<XhpcRate> getXhpcRateList() {
|
||||
|
||||
return xhpcRateList;
|
||||
}
|
||||
|
||||
public void setXhpcRateList(List<XhpcRate> xhpcRateList) {
|
||||
|
||||
this.xhpcRateList = xhpcRateList;
|
||||
}
|
||||
|
||||
public List<XhpcRateTime> getXhpcRateTimeList() {
|
||||
|
||||
return xhpcRateTimeList;
|
||||
}
|
||||
|
||||
public void setXhpcRateTimeList(List<XhpcRateTime> xhpcRateTimeList) {
|
||||
|
||||
this.xhpcRateTimeList = xhpcRateTimeList;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.xhpc.charging.station.mapper;
|
||||
/**
|
||||
* 费率Mapper接口
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-19
|
||||
*/
|
||||
public interface XhpcRateMapper {
|
||||
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -89,6 +91,13 @@ public interface IXhpcChargingStationService {
|
||||
*/
|
||||
public List<Map<String,Object>> stationInternetBlackList(Long chargingStationId);
|
||||
|
||||
/**
|
||||
* 添加场点
|
||||
* @param xhpcChargingStationDto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
/**
|
||||
* 费率Service接口
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
public interface IXhpcRateService {
|
||||
|
||||
}
|
||||
@ -2,7 +2,10 @@ package com.xhpc.charging.station.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.charging.station.domain.XhpcChargingStation;
|
||||
import com.xhpc.charging.station.domain.XhpcRateTime;
|
||||
import com.xhpc.charging.station.dto.XhpcChargingStationDto;
|
||||
import com.xhpc.charging.station.mapper.XhpcChargingStationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -176,6 +179,42 @@ public class XhpcChargingStationServiceImpl implements IXhpcChargingStationServi
|
||||
return xhpcChargingStationMapper.stationInternetBlackList(chargingStationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult addXhpcChargingStation(XhpcChargingStationDto xhpcChargingStationDto) {
|
||||
|
||||
//判断费率和费率时间段 是否有值
|
||||
if(xhpcChargingStationDto.getXhpcRateList() ==null && xhpcChargingStationDto.getXhpcRateList().size()==0){
|
||||
return AjaxResult.error(1001,"费率不能为空");
|
||||
}
|
||||
if(xhpcChargingStationDto.getXhpcRateTimeList() ==null && xhpcChargingStationDto.getXhpcRateTimeList().size()==0){
|
||||
return AjaxResult.error(1001,"费率时段不能为空");
|
||||
}
|
||||
List<XhpcRateTime> xhpcRateTimeList = xhpcChargingStationDto.getXhpcRateTimeList();
|
||||
|
||||
boolean s =false;
|
||||
for (int i = 0; i < xhpcRateTimeList.size(); i++) {
|
||||
XhpcRateTime xhpcRateTime = xhpcRateTimeList.get(i);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//判断开始时间是否有00:00
|
||||
|
||||
|
||||
|
||||
|
||||
//判断结束时间是否小于开始时间
|
||||
//检查格式是否正确
|
||||
//冒泡排序(结束时间小于开始时间)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> wxList(String name, String serviceFacilities, Integer code, String longitude, String latitude) {
|
||||
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.xhpc.charging.station.service;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 费率Service业务层处理
|
||||
*
|
||||
* @author yuyang
|
||||
* @date 2021-07-21
|
||||
*/
|
||||
@Service
|
||||
public class XhpcRateServiceImpl implements IXhpcRateService{
|
||||
|
||||
}
|
||||
@ -28,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="rateModelId" column="rate_model_id" />
|
||||
<result property="imgId" column="img_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXhpcChargingStationVo">
|
||||
@ -41,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
cs.name as name,
|
||||
ope.name as operatorName,
|
||||
cs.address as address,
|
||||
(select url from xhpc_img where charging_station_id = cs.charging_station_id limit 1) as url,
|
||||
(select url from xhpc_img where img_id = cs.img_id and del_flag =0 limit 1) as url,
|
||||
cs.client_visible as clientVisible,
|
||||
cs.status as status
|
||||
from xhpc_charging_station as cs
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.charging.station.mapper.XhpcRateMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xhpc.charging.station.domain.XhpcRate">
|
||||
<result property="rateId" column="rate_id" />
|
||||
<result property="chargingStationId" column="charging_station_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="powerFee" column="power_fee" />
|
||||
<result property="serviceFee" column="service_fee" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user