车牌页面已完成
This commit is contained in:
parent
f2d2b41223
commit
92886f6ff8
@ -3,11 +3,18 @@ package com.xhpc.charging.station.controller;
|
|||||||
import com.xhpc.charging.station.service.IXhpcBarrierGateService;
|
import com.xhpc.charging.station.service.IXhpcBarrierGateService;
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.xhpc.common.domain.XhpcBarrierGate;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import com.xhpc.common.domain.XhpcEquipmentAccident;
|
||||||
|
import com.xhpc.common.log.annotation.Log;
|
||||||
|
import com.xhpc.common.log.enums.BusinessType;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/barrierGate")
|
@RequestMapping("/barrierGate")
|
||||||
@ -21,5 +28,40 @@ public class XhpcBarrierGateController extends BaseController {
|
|||||||
return xhpcBarrierGateService.getBarrierGateList();
|
return xhpcBarrierGateService.getBarrierGateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(HttpServletRequest request, String barrierGateCompany) {
|
||||||
|
List<Map<String, Object>> list = xhpcBarrierGateService.getLsit(barrierGateCompany);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/addBarrierGate")
|
||||||
|
public R addXhpcEquipmentAccident(@RequestBody XhpcBarrierGate xhpcBarrierGate) {
|
||||||
|
return xhpcBarrierGateService.insertBarrierGate(xhpcBarrierGate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/updateBarrierGate")
|
||||||
|
public R updateBarrierGate(@RequestBody XhpcBarrierGate xhpcBarrierGate) {
|
||||||
|
return xhpcBarrierGateService.updateBarrierGate(xhpcBarrierGate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "删除道闸", businessType = BusinessType.DELETE)
|
||||||
|
@GetMapping("/deleteBarrierGateById")
|
||||||
|
public R deleteBarrierGateById(Long barrierGateId) {
|
||||||
|
return xhpcBarrierGateService.deleteBarrierGateById(barrierGateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getXhpcBarrierGateById")
|
||||||
|
public R getXhpcBarrierGateById(Long barrierGateId) {
|
||||||
|
Map<String, Object> map = xhpcBarrierGateService.getXhpcBarrierGateById(barrierGateId);
|
||||||
|
return R.ok(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务时间
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 0 12 * * ? ")
|
||||||
|
@GetMapping("/getEndTimeExpire")
|
||||||
|
public void getEndTimeExpire(){
|
||||||
|
xhpcBarrierGateService.getEndTimeExpire();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class XhpcEquipmentAccidentController extends BaseController {
|
|||||||
return R.ok(map);
|
return R.ok(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "删除电站", businessType = BusinessType.DELETE)
|
@Log(title = "删除事故", businessType = BusinessType.DELETE)
|
||||||
@GetMapping("/deleteXhpcEquipmentAccidentById")
|
@GetMapping("/deleteXhpcEquipmentAccidentById")
|
||||||
public R deleteXhpcEquipmentAccidentById(Long equipmentAccidentId) {
|
public R deleteXhpcEquipmentAccidentById(Long equipmentAccidentId) {
|
||||||
return xhpcEquipmentAccidentService.deleteXhpcEquipmentAccidentById(equipmentAccidentId);
|
return xhpcEquipmentAccidentService.deleteXhpcEquipmentAccidentById(equipmentAccidentId);
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package com.xhpc.charging.station.mapper;
|
package com.xhpc.charging.station.mapper;
|
||||||
|
|
||||||
|
import com.xhpc.common.domain.XhpcBarrierGate;
|
||||||
|
import com.xhpc.common.domain.XhpcEquipmentAccident;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -7,5 +11,19 @@ public interface XhpcBarrierGateMapper {
|
|||||||
|
|
||||||
List<Map<String, Object>> getBarrierGateList();
|
List<Map<String, Object>> getBarrierGateList();
|
||||||
|
|
||||||
|
List<Map<String,Object>> getLsit(@Param("barrierGateCompany")String barrierGateCompany);
|
||||||
|
|
||||||
|
|
||||||
|
void insertBarrierGate(XhpcBarrierGate xhpcBarrierGate);
|
||||||
|
|
||||||
|
void updateBarrierGate(XhpcBarrierGate xhpcBarrierGate);
|
||||||
|
|
||||||
|
void deleteBarrierGateById(@Param("barrierGateId")Long barrierGateId);
|
||||||
|
|
||||||
|
Map<String,Object> getXhpcBarrierGateById(@Param("barrierGateId")Long barrierGateId);
|
||||||
|
|
||||||
|
List<Long> getBarrierGateEndTime(@Param("date")String date);
|
||||||
|
|
||||||
|
void updateBarrierGateStatus(@Param("barrierGateId")Long barrierGateId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,27 @@
|
|||||||
package com.xhpc.charging.station.service;
|
package com.xhpc.charging.station.service;
|
||||||
|
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
|
import com.xhpc.common.domain.XhpcBarrierGate;
|
||||||
|
import com.xhpc.common.domain.XhpcEquipmentAccident;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface IXhpcBarrierGateService {
|
public interface IXhpcBarrierGateService {
|
||||||
|
|
||||||
|
|
||||||
R getBarrierGateList();
|
R getBarrierGateList();
|
||||||
|
|
||||||
|
List<Map<String, Object>> getLsit(String barrierGateCompany);
|
||||||
|
|
||||||
|
|
||||||
|
R insertBarrierGate(XhpcBarrierGate xhpcBarrierGate);
|
||||||
|
|
||||||
|
R updateBarrierGate(XhpcBarrierGate xhpcBarrierGate);
|
||||||
|
|
||||||
|
R deleteBarrierGateById(Long barrierGateId);
|
||||||
|
|
||||||
|
Map<String, Object> getXhpcBarrierGateById(Long barrierGateId );
|
||||||
|
|
||||||
|
void getEndTimeExpire();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
package com.xhpc.charging.station.service;
|
package com.xhpc.charging.station.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.xhpc.charging.station.mapper.XhpcBarrierGateMapper;
|
import com.xhpc.charging.station.mapper.XhpcBarrierGateMapper;
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.web.service.BaseService;
|
import com.xhpc.common.core.web.service.BaseService;
|
||||||
|
import com.xhpc.common.domain.XhpcBarrierGate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class XhpcBarrierGateServiceImpl extends BaseService implements IXhpcBarrierGateService{
|
public class XhpcBarrierGateServiceImpl extends BaseService implements IXhpcBarrierGateService{
|
||||||
@ -16,4 +21,45 @@ public class XhpcBarrierGateServiceImpl extends BaseService implements IXhpcBarr
|
|||||||
public R getBarrierGateList() {
|
public R getBarrierGateList() {
|
||||||
return R.ok(xhpcBarrierGateMapper.getBarrierGateList());
|
return R.ok(xhpcBarrierGateMapper.getBarrierGateList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> getLsit(String barrierGateCompany) {
|
||||||
|
return xhpcBarrierGateMapper.getLsit(barrierGateCompany);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R insertBarrierGate(XhpcBarrierGate xhpcBarrierGate) {
|
||||||
|
if(xhpcBarrierGate.getBarrierGateId() !=null){
|
||||||
|
xhpcBarrierGateMapper.updateBarrierGate(xhpcBarrierGate);
|
||||||
|
}else {
|
||||||
|
xhpcBarrierGateMapper.insertBarrierGate(xhpcBarrierGate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R updateBarrierGate(XhpcBarrierGate xhpcBarrierGate) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R deleteBarrierGateById(Long barrierGateId) {
|
||||||
|
xhpcBarrierGateMapper.deleteBarrierGateById(barrierGateId);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getXhpcBarrierGateById(Long barrierGateId) {
|
||||||
|
return xhpcBarrierGateMapper.getXhpcBarrierGateById(barrierGateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getEndTimeExpire() {
|
||||||
|
List<Long> barrierGateEndTime = xhpcBarrierGateMapper.getBarrierGateEndTime(DateUtil.now());
|
||||||
|
for (int i = 0; i <barrierGateEndTime.size() ; i++) {
|
||||||
|
xhpcBarrierGateMapper.updateBarrierGateStatus(barrierGateEndTime.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,154 @@
|
|||||||
from xhpc_barrier_gate where status =0 and del_flag =0
|
from xhpc_barrier_gate where status =0 and del_flag =0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getLsit" resultType="map">
|
||||||
|
select
|
||||||
|
barrier_gate_id as barrierGateId,
|
||||||
|
barrier_gate_company as barrierGateCompany,
|
||||||
|
start_time as startTime,
|
||||||
|
end_time as endTime
|
||||||
|
from xhpc_barrier_gate where del_flag =0
|
||||||
|
<if test="barrierGateCompany !=null and barrierGateCompany !=''">
|
||||||
|
and barrier_gate_company like CONCAT('%',#{barrierGateCompany},'%')
|
||||||
|
</if>
|
||||||
|
order by create_time desc
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBarrierGate">
|
||||||
|
insert into xhpc_barrier_gate
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="null != barrierGateCompany and ''!=barrierGateCompany">
|
||||||
|
barrier_gate_company,
|
||||||
|
</if>
|
||||||
|
<if test="null != startTime">
|
||||||
|
start_time,
|
||||||
|
</if>
|
||||||
|
<if test="null != endTime ">
|
||||||
|
end_time,
|
||||||
|
</if>
|
||||||
|
<if test="null != status ">
|
||||||
|
status,
|
||||||
|
</if>
|
||||||
|
<if test="null != delFlag ">
|
||||||
|
del_flag,
|
||||||
|
</if>
|
||||||
|
<if test="null != createTime ">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="null != createBy and '' != createBy">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="null != updateTime ">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="null != updateBy and '' != updateBy">
|
||||||
|
update_by,
|
||||||
|
</if>
|
||||||
|
<if test="null != remark and '' != remark">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId ">
|
||||||
|
tenant_id,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="null != barrierGateCompany and ''!=barrierGateCompany">
|
||||||
|
#{barrierGateCompany},
|
||||||
|
</if>
|
||||||
|
<if test="null != startTime">
|
||||||
|
#{startTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != endTime ">
|
||||||
|
#{endTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != status ">
|
||||||
|
#{status},
|
||||||
|
</if>
|
||||||
|
<if test="null != delFlag ">
|
||||||
|
#{delFlag},
|
||||||
|
</if>
|
||||||
|
<if test="null != createTime ">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != createBy and '' != createBy">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="null != updateTime ">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != updateBy and '' != updateBy">
|
||||||
|
#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="null != remark and '' != remark">
|
||||||
|
#{remark},
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId ">
|
||||||
|
#{tenantId},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBarrierGate">
|
||||||
|
update xhpc_barrier_gate
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="null != barrierGateCompany and ''!=barrierGateCompany">
|
||||||
|
barrier_gate_company=#{barrierGateCompany},
|
||||||
|
</if>
|
||||||
|
<if test="null != startTime">
|
||||||
|
start_time=#{startTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != endTime ">
|
||||||
|
end_time=#{endTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != status">
|
||||||
|
status=#{status},
|
||||||
|
</if>
|
||||||
|
<if test="null != delFlag ">
|
||||||
|
del_flag = #{delFlag},
|
||||||
|
</if>
|
||||||
|
<if test="null != createTime ">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != createBy and '' != createBy">
|
||||||
|
create_by = #{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="null != updateTime ">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="null != updateBy and '' != updateBy">
|
||||||
|
update_by =#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="null != remark and '' != remark">
|
||||||
|
remark =#{remark},
|
||||||
|
</if>
|
||||||
|
<if test="null != tenantId ">
|
||||||
|
tenant_id =#{tenantId},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
where barrier_gate_id = #{barrierGateId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteBarrierGateById">
|
||||||
|
update xhpc_barrier_gate set del_flag =1 where barrier_gate_id = #{barrierGateId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getXhpcBarrierGateById" resultType="map">
|
||||||
|
select
|
||||||
|
barrier_gate_id as barrierGateId,
|
||||||
|
barrier_gate_company as barrierGateCompany,
|
||||||
|
start_time as startTime,
|
||||||
|
end_time as endTime
|
||||||
|
from xhpc_barrier_gate
|
||||||
|
where barrier_gate_id = #{barrierGateId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getBarrierGateEndTime" resultType="Long">
|
||||||
|
select barrier_gate_id as barrierGateId from xhpc_barrier_gate where end_time < #{date}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateBarrierGateStatus">
|
||||||
|
update xhpc_barrier_gate set status =1 where barrier_gate_id = #{barrierGateId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -366,9 +366,7 @@
|
|||||||
<if test="null != videoMonitor ">
|
<if test="null != videoMonitor ">
|
||||||
video_monitor=#{videoMonitor},
|
video_monitor=#{videoMonitor},
|
||||||
</if>
|
</if>
|
||||||
<if test="null != barrierGateId ">
|
|
||||||
barrier_gate_id=#{barrierGateId},
|
barrier_gate_id=#{barrierGateId},
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
where charging_station_id = #{chargingStationId}
|
where charging_station_id = #{chargingStationId}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
package com.xhpc.common.domain;
|
package com.xhpc.common.domain;
|
||||||
|
|
||||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
public class XhpcBarrierGate extends BaseEntity {
|
public class XhpcBarrierGate extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -11,7 +13,7 @@ public class XhpcBarrierGate extends BaseEntity {
|
|||||||
/** 道闸id */
|
/** 道闸id */
|
||||||
private Long barrierGateId;
|
private Long barrierGateId;
|
||||||
/** 道闸公司名称 */
|
/** 道闸公司名称 */
|
||||||
private Long barrierGateCompany;
|
private String barrierGateCompany;
|
||||||
|
|
||||||
/** 有效开始时间 */
|
/** 有效开始时间 */
|
||||||
private Date startTime;
|
private Date startTime;
|
||||||
@ -21,4 +23,6 @@ public class XhpcBarrierGate extends BaseEntity {
|
|||||||
|
|
||||||
/** 帐号状态(0 正常 1已过期) */
|
/** 帐号状态(0 正常 1已过期) */
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
private Integer delFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user