Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
78677db068
|
@ -5,6 +5,8 @@ import lombok.Data;
|
|||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障对象 bst_fault
|
||||
*
|
||||
|
@ -36,7 +38,7 @@ public class Fault extends BaseEntity
|
|||
|
||||
@Excel(name = "故障部位")
|
||||
@ApiModelProperty("故障部位")
|
||||
private String faultSite;
|
||||
private List<String> faultSite;
|
||||
|
||||
@Excel(name = "故障详情")
|
||||
@ApiModelProperty("故障详情")
|
||||
|
|
|
@ -3,13 +3,14 @@ package com.ruoyi.bst.fault.domain;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class FaultQuery extends Fault{
|
||||
|
||||
@ApiModelProperty("故障部位")
|
||||
private String faultSite;
|
||||
private List<String> faultSite;
|
||||
|
||||
@ApiModelProperty("报修进度")
|
||||
private String appealStatus;
|
||||
|
|
|
@ -55,8 +55,8 @@ public class FaultServiceImpl implements FaultService
|
|||
@Override
|
||||
public int insertFault(Fault fault)
|
||||
{
|
||||
fault.setCreateTime(DateUtils.getNowDate());
|
||||
return faultMapper.insertFault(fault);
|
||||
fault.setCreateTime(DateUtils.getNowDate());
|
||||
return faultMapper.insertFault(fault);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ruoyi.web.app;
|
||||
|
||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||
import com.ruoyi.bst.fault.service.FaultService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 用户查询自己提交的故障信息
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/app/fault")
|
||||
public class AppFaultController {
|
||||
|
||||
@Autowired
|
||||
private FaultService faultService;
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult get(@PathVariable Long id) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserId();
|
||||
// 当用户查询的故障信息是自己的或当前用户是超级管理员时
|
||||
if (userId.equals(id)|| userId == 1){
|
||||
FaultVO faultVO = faultService.selectFaultById(id);
|
||||
return AjaxResult.success(faultVO);
|
||||
}
|
||||
return AjaxResult.error("您的查询不合法!");
|
||||
}
|
||||
}
|
|
@ -67,7 +67,7 @@ public class FaultController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 新增故障
|
||||
* 新增故障信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:add')")
|
||||
@Log(title = "故障", businessType = BusinessType.INSERT)
|
||||
|
@ -78,7 +78,7 @@ public class FaultController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改故障
|
||||
* 修改故障信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:edit')")
|
||||
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
||||
|
@ -89,7 +89,7 @@ public class FaultController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除故障
|
||||
* 删除故障信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bst:fault:remove')")
|
||||
@Log(title = "故障", businessType = BusinessType.DELETE)
|
||||
|
|
Loading…
Reference in New Issue
Block a user