Bläddra i källkod

添加 replace_part 字段。

tom 5 månader sedan
förälder
incheckning
67e52e707f

+ 12 - 17
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/FaultController.java

@@ -8,12 +8,8 @@ import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -38,9 +34,8 @@ public class FaultController extends BaseController {
     /**
      * 查询故障列表
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:list')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:list')")
     @GetMapping("/list")
-    @ApiOperation("查询故障列表")
     public TableDataInfo list(Fault fault) {
         startPage();
         List<Fault> list = faultService.selectFaultList(fault);
@@ -50,9 +45,9 @@ public class FaultController extends BaseController {
     /**
      * 导出故障列表
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:export')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:export')")
     @Log(title = "故障", businessType = BusinessType.EXPORT)
-    // @PostMapping("/export")
+    @PostMapping("/export")
     public void export(HttpServletResponse response, Fault fault) {
         List<Fault> list = faultService.selectFaultList(fault);
         ExcelUtil<Fault> util = new ExcelUtil<Fault>(Fault.class);
@@ -62,7 +57,7 @@ public class FaultController extends BaseController {
     /**
      * 获取故障详细信息
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:query')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:query')")
     @GetMapping(value = "/{faultId}")
     public AjaxResult getInfo(@PathVariable("faultId") String faultId) {
         return success(faultService.selectFaultByFaultId(faultId));
@@ -71,7 +66,7 @@ public class FaultController extends BaseController {
     /**
      * 新增故障
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:add')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:add')")
     @Log(title = "故障", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody Fault fault) {
@@ -81,9 +76,9 @@ public class FaultController extends BaseController {
     /**
      * 修改故障
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:edit')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:edit')")
     @Log(title = "故障", businessType = BusinessType.UPDATE)
-    // @PutMapping
+    @PutMapping
     public AjaxResult edit(@RequestBody Fault fault) {
         return toAjax(faultService.updateFault(fault));
     }
@@ -91,9 +86,9 @@ public class FaultController extends BaseController {
     /**
      * 删除故障
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:remove')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:remove')")
     @Log(title = "故障", businessType = BusinessType.DELETE)
-    // @DeleteMapping("/{faultIds}")
+    @DeleteMapping("/{faultIds}")
     public AjaxResult remove(@PathVariable String[] faultIds) {
         return toAjax(faultService.deleteFaultByFaultIds(faultIds));
     }
@@ -108,7 +103,7 @@ public class FaultController extends BaseController {
     @GetMapping("/listAllTreeViaSimType/{simType}")
     @ApiOperation("通过模拟器类型,查询故障列表")
     public TableDataInfo listAllTreeViaSimType(@PathVariable(value = "simType") String simType) {
-        Fault fault =new Fault();
+        Fault fault = new Fault();
         fault.setSimType(simType);
         List<FaultTree> list = faultService.selectFaultListAllTree(fault);
         return getDataTable(list);

+ 18 - 3
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Fault.java

@@ -20,10 +20,10 @@ public class Fault extends BaseEntity {
     private String faultId;
 
     /**
-     * $column.columnComment
+     * 父故障ID
      */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private String parentFaultId = "";
+    @Excel(name = "父故障ID")
+    private String parentFaultId;
 
     /**
      * 模拟器类型
@@ -49,6 +49,12 @@ public class Fault extends BaseEntity {
     private String conflictFaultId;
 
     /**
+     * 是否是更换零件 1:是 0:不是
+     */
+    @Excel(name = "是否是更换零件 1:是 0:不是")
+    private String replacePart;
+
+    /**
      * 名称
      */
     @Excel(name = "名称")
@@ -106,6 +112,14 @@ public class Fault extends BaseEntity {
         return conflictFaultId;
     }
 
+    public void setReplacePart(String replacePart) {
+        this.replacePart = replacePart;
+    }
+
+    public String getReplacePart() {
+        return replacePart;
+    }
+
     public void setName(String name) {
         this.name = name;
     }
@@ -138,6 +152,7 @@ public class Fault extends BaseEntity {
                 .append("simType", getSimType())
                 .append("faultType", getFaultType())
                 .append("conflictFaultId", getConflictFaultId())
+                .append("replacePart", getReplacePart())
                 .append("name", getName())
                 .append("simMsg", getSimMsg())
                 .append("orderNum", getOrderNum())

+ 6 - 0
ruoyi-sim/src/main/resources/mapper/sim/FaultMapper.xml

@@ -10,6 +10,7 @@
         <result property="simType" column="sim_type"/>
         <result property="faultType" column="fault_type"/>
         <result property="conflictFaultId" column="conflict_fault_id"/>
+        <result property="replacePart" column="replace_part"/>
         <result property="name" column="name"/>
         <result property="simMsg" column="sim_msg"/>
         <result property="orderNum" column="order_num"/>
@@ -26,6 +27,7 @@
                sim_type,
                fault_type,
                conflict_fault_id,
+               replace_part,
                name,
                sim_msg,
                order_num,
@@ -45,6 +47,7 @@
             <if test="faultType != null  and faultType != ''">and fault_type = #{faultType}</if>
             <if test="conflictFaultId != null  and conflictFaultId != ''">and conflict_fault_id = #{conflictFaultId}
             </if>
+            <if test="replacePart != null  and replacePart != ''">and replace_part = #{replacePart}</if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="simMsg != null  and simMsg != ''">and sim_msg = #{simMsg}</if>
             <if test="orderNum != null ">and order_num = #{orderNum}</if>
@@ -64,6 +67,7 @@
             <if test="simType != null and simType != ''">sim_type,</if>
             <if test="faultType != null">fault_type,</if>
             <if test="conflictFaultId != null">conflict_fault_id,</if>
+            <if test="replacePart != null">replace_part,</if>
             <if test="name != null">name,</if>
             <if test="simMsg != null">sim_msg,</if>
             <if test="orderNum != null">order_num,</if>
@@ -79,6 +83,7 @@
             <if test="simType != null and simType != ''">#{simType},</if>
             <if test="faultType != null">#{faultType},</if>
             <if test="conflictFaultId != null">#{conflictFaultId},</if>
+            <if test="replacePart != null">#{replacePart},</if>
             <if test="name != null">#{name},</if>
             <if test="simMsg != null">#{simMsg},</if>
             <if test="orderNum != null">#{orderNum},</if>
@@ -97,6 +102,7 @@
             <if test="simType != null and simType != ''">sim_type = #{simType},</if>
             <if test="faultType != null">fault_type = #{faultType},</if>
             <if test="conflictFaultId != null">conflict_fault_id = #{conflictFaultId},</if>
+            <if test="replacePart != null">replace_part = #{replacePart},</if>
             <if test="name != null">name = #{name},</if>
             <if test="simMsg != null">sim_msg = #{simMsg},</if>
             <if test="orderNum != null">order_num = #{orderNum},</if>