Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1b57e83dee
|
@ -0,0 +1,49 @@
|
|||
package com.ruoyi.bst.fault.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 故障对象 bst_fault
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Data
|
||||
public class Fault extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
@Excel(name = "用户")
|
||||
@ApiModelProperty("用户")
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "车辆编号")
|
||||
@ApiModelProperty("车辆编号")
|
||||
private Long vehicleCode;
|
||||
|
||||
@Excel(name = "图片")
|
||||
@ApiModelProperty("图片")
|
||||
private String picture;
|
||||
|
||||
@Excel(name = "订单编号")
|
||||
@ApiModelProperty("订单编号")
|
||||
private String orderId;
|
||||
|
||||
@Excel(name = "故障部位")
|
||||
@ApiModelProperty("故障部位")
|
||||
private String faultSite;
|
||||
|
||||
@Excel(name = "故障详情")
|
||||
@ApiModelProperty("故障详情")
|
||||
private String faultDetail;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态")
|
||||
private String appealStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.bst.fault.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public class FaultQuery extends Fault{
|
||||
|
||||
@ApiModelProperty("故障部位")
|
||||
private String faultSite;
|
||||
|
||||
@ApiModelProperty("报修进度")
|
||||
private String appealStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.ruoyi.bst.fault.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FaultVO extends Fault{
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ruoyi.bst.fault.domain.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FaultStatus {
|
||||
|
||||
STORAGE("0", "已驳回"),
|
||||
AVAILABLE("1", "已提交"),
|
||||
RESERVED("2", "维修中");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.ruoyi.bst.fault.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bst.fault.domain.Fault;
|
||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 故障Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface FaultMapper
|
||||
{
|
||||
/**
|
||||
* 查询故障
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 故障
|
||||
*/
|
||||
FaultVO selectFaultById(Long id);
|
||||
|
||||
/**
|
||||
* 查询故障列表
|
||||
*
|
||||
* @param query 故障
|
||||
* @return 故障集合
|
||||
*/
|
||||
List<FaultVO> selectFaultList(@Param("query")FaultQuery query);
|
||||
|
||||
/**
|
||||
* 新增故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
int insertFault(Fault fault);
|
||||
|
||||
/**
|
||||
* 批量新增故障
|
||||
*/
|
||||
int batchInsert(@Param("list") List<? extends Fault> list);
|
||||
|
||||
/**
|
||||
* 批量修改故障
|
||||
*/
|
||||
int batchUpdate(@Param("list") List<? extends Fault> list);
|
||||
|
||||
/**
|
||||
* 修改故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFault(@Param("data") Fault fault);
|
||||
|
||||
/**
|
||||
* 删除故障
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteFaultById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除故障
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFaultByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,224 @@
|
|||
<?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.ruoyi.bst.fault.mapper.FaultMapper">
|
||||
|
||||
<resultMap type="FaultVO" id="FaultResult" autoMapping="true"/>
|
||||
|
||||
<sql id="selectFaultVo">
|
||||
select
|
||||
bf.id,
|
||||
bf.user_name,
|
||||
bf.vehicle_code,
|
||||
bf.picture,
|
||||
bf.order_id,
|
||||
bf.fault_site,
|
||||
bf.fault_detail,
|
||||
bf.appeal_status,
|
||||
bf.create_time
|
||||
from bst_fault bf
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.userName != null and query.userName != ''"> and bf.user_name like concat('%', #{query.userName}, '%')</if>
|
||||
<if test="query.vehicleCode != null "> and bf.vehicle_code = #{query.vehicleCode}</if>
|
||||
<if test="query.picture != null and query.picture != ''"> and bf.picture = #{query.picture}</if>
|
||||
<if test="query.orderId != null and query.orderId != ''"> and bf.order_id = #{query.orderId}</if>
|
||||
<if test="query.faultSite != null and query.faultSite != ''"> and bf.fault_site = #{query.faultSite}</if>
|
||||
<if test="query.faultDetail != null and query.faultDetail != ''"> and bf.fault_detail = #{query.faultDetail}</if>
|
||||
<if test="query.appealStatus != null and query.appealStatus != ''"> and bf.appeal_status = #{query.appealStatus}</if>
|
||||
${query.params.dataScope}
|
||||
</sql>
|
||||
|
||||
<select id="selectFaultList" parameterType="FaultQuery" resultMap="FaultResult">
|
||||
<include refid="selectFaultVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFaultById" parameterType="Long" resultMap="FaultResult">
|
||||
<include refid="selectFaultVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertFault" parameterType="Fault" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_fault
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="vehicleCode != null">vehicle_code,</if>
|
||||
<if test="picture != null and picture != ''">picture,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="faultSite != null and faultSite != ''">fault_site,</if>
|
||||
<if test="faultDetail != null">fault_detail,</if>
|
||||
<if test="appealStatus != null and appealStatus != ''">appeal_status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="vehicleCode != null">#{vehicleCode},</if>
|
||||
<if test="picture != null and picture != ''">#{picture},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="faultSite != null and faultSite != ''">#{faultSite},</if>
|
||||
<if test="faultDetail != null">#{faultDetail},</if>
|
||||
<if test="appealStatus != null and appealStatus != ''">#{appealStatus},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert" parameterType="Fault" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bst_fault
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
user_name,
|
||||
vehicle_code,
|
||||
picture,
|
||||
order_id,
|
||||
fault_site,
|
||||
fault_detail,
|
||||
appeal_status,
|
||||
create_time,
|
||||
</trim>
|
||||
values
|
||||
<foreach collection="list" item="i" separator=",">
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="i.userName != null and i.userName != ''">#{i.userName},</if>
|
||||
<if test="i.userName == null or i.userName == ''">default,</if>
|
||||
<if test="i.vehicleCode != null ">#{i.vehicleCode},</if>
|
||||
<if test="i.vehicleCode == null ">default,</if>
|
||||
<if test="i.picture != null and i.picture != ''">#{i.picture},</if>
|
||||
<if test="i.picture == null or i.picture == ''">default,</if>
|
||||
<if test="i.orderId != null ">#{i.orderId},</if>
|
||||
<if test="i.orderId == null ">default,</if>
|
||||
<if test="i.faultSite != null and i.faultSite != ''">#{i.faultSite},</if>
|
||||
<if test="i.faultSite == null or i.faultSite == ''">default,</if>
|
||||
<if test="i.faultDetail != null ">#{i.faultDetail},</if>
|
||||
<if test="i.faultDetail == null ">default,</if>
|
||||
<if test="i.appealStatus != null and i.appealStatus != ''">#{i.appealStatus},</if>
|
||||
<if test="i.appealStatus == null or i.appealStatus == ''">default,</if>
|
||||
<if test="i.createTime != null ">#{i.createTime},</if>
|
||||
<if test="i.createTime == null ">default,</if>
|
||||
</trim>
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate">
|
||||
update bst_fault
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<foreach open="user_name = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.userName != null and item.userName != ''">
|
||||
WHEN #{item.id} THEN #{item.userName}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `user_name`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="vehicle_code = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.vehicleCode != null ">
|
||||
WHEN #{item.id} THEN #{item.vehicleCode}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `vehicle_code`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="picture = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.picture != null and item.picture != ''">
|
||||
WHEN #{item.id} THEN #{item.picture}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `picture`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="order_id = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.orderId != null ">
|
||||
WHEN #{item.id} THEN #{item.orderId}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `order_id`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="fault_site = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.faultSite != null and item.faultSite != ''">
|
||||
WHEN #{item.id} THEN #{item.faultSite}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `fault_site`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="fault_detail = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.faultDetail != null ">
|
||||
WHEN #{item.id} THEN #{item.faultDetail}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `fault_detail`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="appeal_status = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.appealStatus != null and item.appealStatus != ''">
|
||||
WHEN #{item.id} THEN #{item.appealStatus}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `appeal_status`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
<foreach open="create_time = CASE id" collection="list" item="item" close="END,">
|
||||
<choose>
|
||||
<when test="item.createTime != null ">
|
||||
WHEN #{item.id} THEN #{item.createTime}
|
||||
</when>
|
||||
<otherwise>
|
||||
WHEN #{item.id} THEN `create_time`
|
||||
</otherwise>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateFault" parameterType="Fault">
|
||||
update bst_fault
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where id = #{data.id}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.userName != null and data.userName != ''">user_name = #{data.userName},</if>
|
||||
<if test="data.vehicleCode != null">vehicle_code = #{data.vehicleCode},</if>
|
||||
<if test="data.picture != null and data.picture != ''">picture = #{data.picture},</if>
|
||||
<if test="data.orderId != null">order_id = #{data.orderId},</if>
|
||||
<if test="data.faultSite != null and data.faultSite != ''">fault_site = #{data.faultSite},</if>
|
||||
<if test="data.faultDetail != null">fault_detail = #{data.faultDetail},</if>
|
||||
<if test="data.appealStatus != null and data.appealStatus != ''">appeal_status = #{data.appealStatus},</if>
|
||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteFaultById" parameterType="Long">
|
||||
delete from bst_fault where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteFaultByIds" parameterType="String">
|
||||
delete from bst_fault where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.bst.fault.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bst.fault.domain.Fault;
|
||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||
|
||||
/**
|
||||
* 故障Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
public interface FaultService
|
||||
{
|
||||
/**
|
||||
* 查询故障
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 故障
|
||||
*/
|
||||
public FaultVO selectFaultById(Long id);
|
||||
|
||||
/**
|
||||
* 查询故障列表
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 故障集合
|
||||
*/
|
||||
public List<FaultVO> selectFaultList(FaultQuery fault);
|
||||
|
||||
/**
|
||||
* 新增故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFault(Fault fault);
|
||||
|
||||
/**
|
||||
* 修改故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFault(Fault fault);
|
||||
|
||||
/**
|
||||
* 批量删除故障
|
||||
*
|
||||
* @param ids 需要删除的故障主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFaultByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除故障信息
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFaultById(Long id);
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package com.ruoyi.bst.fault.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bst.fault.mapper.FaultMapper;
|
||||
import com.ruoyi.bst.fault.domain.Fault;
|
||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||
import com.ruoyi.bst.fault.service.FaultService;
|
||||
|
||||
/**
|
||||
* 故障Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@Service
|
||||
public class FaultServiceImpl implements FaultService
|
||||
{
|
||||
@Autowired
|
||||
private FaultMapper faultMapper;
|
||||
|
||||
/**
|
||||
* 查询故障
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 故障
|
||||
*/
|
||||
@Override
|
||||
public FaultVO selectFaultById(Long id)
|
||||
{
|
||||
return faultMapper.selectFaultById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询故障列表
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 故障
|
||||
*/
|
||||
@Override
|
||||
public List<FaultVO> selectFaultList(FaultQuery fault)
|
||||
{
|
||||
return faultMapper.selectFaultList(fault);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFault(Fault fault)
|
||||
{
|
||||
fault.setCreateTime(DateUtils.getNowDate());
|
||||
return faultMapper.insertFault(fault);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障
|
||||
*
|
||||
* @param fault 故障
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFault(Fault fault)
|
||||
{
|
||||
return faultMapper.updateFault(fault);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除故障
|
||||
*
|
||||
* @param ids 需要删除的故障主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFaultByIds(Long[] ids)
|
||||
{
|
||||
return faultMapper.deleteFaultByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障信息
|
||||
*
|
||||
* @param id 故障主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFaultById(Long id)
|
||||
{
|
||||
return faultMapper.deleteFaultById(id);
|
||||
}
|
||||
}
|
101
ruoyi-web/src/main/java/com/ruoyi/web/bst/FaultController.java
Normal file
101
ruoyi-web/src/main/java/com/ruoyi/web/bst/FaultController.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package com.ruoyi.web.bst;
|
||||
|
||||
import com.ruoyi.bst.fault.domain.Fault;
|
||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||
import com.ruoyi.bst.fault.service.FaultService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-03-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bst/fault")
|
||||
public class FaultController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private FaultService faultService;
|
||||
|
||||
/**
|
||||
* 查询故障列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FaultQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<FaultVO> list = faultService.selectFaultList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出故障列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:export')")
|
||||
@Log(title = "故障", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, FaultQuery query)
|
||||
{
|
||||
List<FaultVO> list = faultService.selectFaultList(query);
|
||||
ExcelUtil<FaultVO> util = new ExcelUtil<FaultVO>(FaultVO.class);
|
||||
util.exportExcel(response, list, "故障数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取故障详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(faultService.selectFaultById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:add')")
|
||||
@Log(title = "故障", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody Fault fault)
|
||||
{
|
||||
return toAjax(faultService.insertFault(fault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:edit')")
|
||||
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody Fault fault)
|
||||
{
|
||||
return toAjax(faultService.updateFault(fault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:remove')")
|
||||
@Log(title = "故障", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(faultService.deleteFaultByIds(ids));
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user