| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param siteId |
| | | * @param basePage |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/getFaultMessageList") |
| | | @ApiOperation(value = "获取故障信息列表数据", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult<PageInfo<TFaultMessage>> getFaultMessageList(Integer siteId, BasePage basePage){ |
| | | PageInfo<TFaultMessage> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | List<TFaultMessage> faultMessageList = faultMessageService.getFaultMessageList(pageInfo, siteId); |
| | | pageInfo.setRecords(faultMessageList); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addFaultMessage") |
| | | @ApiOperation(value = "添加故障信息", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult addFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.save(faultMessage); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delFaultMessage/{id}") |
| | | @ApiOperation(value = "删除故障信息", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult delFaultMessage(@PathVariable Integer id){ |
| | | faultMessageService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.chargingPile.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.service.TRepairService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RequestMapping("/t-repair") |
| | | public class TRepairController { |
| | | |
| | | @Resource |
| | | private TRepairService repairService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/getRepairList") |
| | | @ApiOperation(value = "获取报修记录列表数据", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult<PageInfo<TRepair>> getRepairList(String name, String siteId, BasePage basePage){ |
| | | PageInfo<TRepair> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | List<TRepair> repairList = repairService.getRepairList(pageInfo, name, siteId); |
| | | return AjaxResult.success(repairList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addRepair") |
| | | @ApiOperation(value = "添加报修记录", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult addRepair(@RequestBody TRepair repair){ |
| | | repairService.save(repair); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delRepair/{id}") |
| | | @ApiOperation(value = "删除报修记录", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult delRepair(@PathVariable Integer id){ |
| | | repairService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TFaultMessageMapper extends BaseMapper<TFaultMessage> { |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param pageInfo |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | List<TFaultMessage> getFaultMessageList(PageInfo<TFaultMessage> pageInfo, @Param("siteId") Integer siteId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TRepairMapper extends BaseMapper<TRepair> { |
| | | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * @param pageInfo |
| | | * @param name |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, String name, String siteId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TFaultMessage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | void add(TFaultMessage dto); |
| | | |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param pageInfo |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | List<TFaultMessage> getFaultMessageList(PageInfo<TFaultMessage> pageInfo, Integer siteId); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TRepairService extends IService<TRepair> { |
| | | |
| | | /** |
| | | * 获取报修记录列表 |
| | | * @param name |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, String name, String siteId); |
| | | } |
| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.utils.MsgUtil; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | chargingPileNotificationService.saveData(4,dto.getSiteId(),dto.getChargingPileId(),site.getPhone(),"检测到"+siteName+"..."+chargingPile.getNumber()+"号桩设备离线,请及时查看处理!"); |
| | | this.save(dto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param pageInfo |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TFaultMessage> getFaultMessageList(PageInfo<TFaultMessage> pageInfo, Integer siteId) { |
| | | return this.baseMapper.getFaultMessageList(pageInfo, siteId); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.chargingPile.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.Site; |
| | | import com.ruoyi.chargingPile.api.model.TRepair; |
| | | import com.ruoyi.chargingPile.mapper.TRepairMapper; |
| | | import com.ruoyi.chargingPile.service.TRepairService; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TRepairServiceImpl extends ServiceImpl<TRepairMapper, TRepair> implements TRepairService { |
| | | |
| | | |
| | | /** |
| | | * 获取报修记录列表 |
| | | * @param name |
| | | * @param siteId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TRepair> getRepairList(PageInfo<TRepair> pageInfo, String name, String siteId) { |
| | | return this.baseMapper.getRepairList(pageInfo, name, siteId); |
| | | } |
| | | } |
| | |
| | | id, app_user_id, site_id, charging_pile_id, status, down_time, create_time, del_flag |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <select id="getFaultMessageList" resultType="com.ruoyi.chargingPile.api.model.TFaultMessage"> |
| | | select |
| | | a.*, |
| | | b.name as chargingPileName, |
| | | c.name as siteName |
| | | from t_fault_message a |
| | | left join t_charging_pile b on (a.charging_pile_id = b.id) |
| | | left join t_site c on (a.site_id = c.id) |
| | | where a.del_flag = 0 |
| | | <if test="null != siteId"> |
| | | and a.site_id = #{siteId} |
| | | </if> |
| | | order by a.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | id, repairman, site_id, charging_pile_id, content, repair_time, create_time, del_flag |
| | | </sql> |
| | | |
| | | |
| | | |
| | | <select id="getRepairList" resultType="com.ruoyi.chargingPile.api.model.TRepair"> |
| | | select |
| | | a.*, |
| | | b.name as chargingPileName, |
| | | c.name as siteName |
| | | from t_repair a |
| | | left join t_charging_pile b on (a.charging_pile_id = b.id) |
| | | left join t_site c on (a.site_id = c.id) |
| | | where a.del_flag = 0 |
| | | <if test="null != name and '' != name"> |
| | | and a.repairman like CONCAT('%', #{name}, '%') |
| | | </if> |
| | | <if test="null != siteId"> |
| | | and a.site_id = #{siteId} |
| | | </if> |
| | | order by a.create_time desc |
| | | </select> |
| | | </mapper> |