diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionController.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionController.java index 92a5e75..cfee233 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionController.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionController.java @@ -40,6 +40,11 @@ public class RecordInspectionController extends BaseController { return prefix + "/record_inspection"; } + @GetMapping("/imgGroup") + public String record_img() + { + return prefix + "/record_img_group"; + } /** * 查询巡检记录列表 diff --git a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionImgController.java b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionImgController.java index c196bab..d8f5102 100644 --- a/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionImgController.java +++ b/ruoyi-manage/src/main/java/com/ruoyi/manage/controller/RecordInspectionImgController.java @@ -1,15 +1,13 @@ package com.ruoyi.manage.controller; import java.util.List; + +import org.apache.ibatis.annotations.Param; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.manage.domain.RecordInspectionImg; @@ -21,29 +19,39 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 巡检历史图片Controller - * + * * @author wangh * @date 2024-11-11 */ @Controller @RequestMapping("/manage/record_inspection_img") -public class RecordInspectionImgController extends BaseController -{ +public class RecordInspectionImgController extends BaseController { private String prefix = "manage/record_inspection_img"; @Autowired private IRecordInspectionImgService recordInspectionImgService; - @RequiresPermissions("manage:record_inspection_img:view") @GetMapping() - public String record_inspection_lo() - { + public String record_inspection_location() { + return prefix + "/record_inspection_location"; } - @GetMapping("/img/{location}") - public String record_inspection_img(@PathVariable("location") String location,ModelMap modelMap) - { - modelMap.put("location",location); + + @RequiresPermissions("manage:record_inspection_img:view") + @GetMapping("/mainView/{id}") + public String record_inspection_lo(@PathVariable("id") Long id, ModelMap modelMap) { + modelMap.put("inspectionId", id); + return prefix + "/record_inspection_location"; + } + + @GetMapping("/img") + public String record_inspection_img(@RequestParam("code") String location, + @RequestParam(value = "id" ,defaultValue = "0") String inspectionId, + ModelMap modelMap) { + System.out.println(location); + System.out.println(inspectionId); + modelMap.put("location", location); + modelMap.put("inspectionId", inspectionId); return prefix + "/record_inspection_img"; } @@ -53,17 +61,17 @@ public class RecordInspectionImgController extends BaseController @RequiresPermissions("manage:record_inspection_img:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(RecordInspectionImg recordInspectionImg) - { + public TableDataInfo list(RecordInspectionImg recordInspectionImg) { startPage(); + System.out.println("list:"+recordInspectionImg.getInspectionId()); List list = recordInspectionImgService.selectRecordInspectionImgList(recordInspectionImg); return getDataTable(list); } + @RequiresPermissions("manage:record_inspection_img:list") @PostMapping("/locationList") @ResponseBody - public TableDataInfo locationList(RecordInspectionImg recordInspectionImg) - { + public TableDataInfo locationList(RecordInspectionImg recordInspectionImg) { startPage(); List list = recordInspectionImgService.selectRecordInspectionlocationList(recordInspectionImg); return getDataTable(list); @@ -76,8 +84,7 @@ public class RecordInspectionImgController extends BaseController @Log(title = "巡检历史图片", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(RecordInspectionImg recordInspectionImg) - { + public AjaxResult export(RecordInspectionImg recordInspectionImg) { List list = recordInspectionImgService.selectRecordInspectionImgList(recordInspectionImg); ExcelUtil util = new ExcelUtil(RecordInspectionImg.class); return util.exportExcel(list, "巡检历史图片数据"); @@ -87,8 +94,7 @@ public class RecordInspectionImgController extends BaseController * 新增巡检历史图片 */ @GetMapping("/add") - public String add() - { + public String add() { return prefix + "/add"; } @@ -99,8 +105,7 @@ public class RecordInspectionImgController extends BaseController @Log(title = "巡检历史图片", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(RecordInspectionImg recordInspectionImg) - { + public AjaxResult addSave(RecordInspectionImg recordInspectionImg) { return toAjax(recordInspectionImgService.insertRecordInspectionImg(recordInspectionImg)); } @@ -109,8 +114,7 @@ public class RecordInspectionImgController extends BaseController */ @RequiresPermissions("manage:record_inspection_img:edit") @GetMapping("/edit/{inspectionId}") - public String edit(@PathVariable("inspectionId") Long inspectionId, ModelMap mmap) - { + public String edit(@PathVariable("inspectionId") Long inspectionId, ModelMap mmap) { RecordInspectionImg recordInspectionImg = recordInspectionImgService.selectRecordInspectionImgByInspectionId(inspectionId); mmap.put("recordInspectionImg", recordInspectionImg); return prefix + "/edit"; @@ -123,8 +127,7 @@ public class RecordInspectionImgController extends BaseController @Log(title = "巡检历史图片", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(RecordInspectionImg recordInspectionImg) - { + public AjaxResult editSave(RecordInspectionImg recordInspectionImg) { return toAjax(recordInspectionImgService.updateRecordInspectionImg(recordInspectionImg)); } @@ -133,10 +136,9 @@ public class RecordInspectionImgController extends BaseController */ @RequiresPermissions("manage:record_inspection_img:remove") @Log(title = "巡检历史图片", businessType = BusinessType.DELETE) - @PostMapping( "/remove") + @PostMapping("/remove") @ResponseBody - public AjaxResult remove(String ids) - { + public AjaxResult remove(String ids) { return toAjax(recordInspectionImgService.deleteRecordInspectionImgByInspectionIds(ids)); } } diff --git a/ruoyi-manage/src/main/resources/mapper/manage/RecordInspectionImgMapper.xml b/ruoyi-manage/src/main/resources/mapper/manage/RecordInspectionImgMapper.xml index c53ab2e..edb8754 100644 --- a/ruoyi-manage/src/main/resources/mapper/manage/RecordInspectionImgMapper.xml +++ b/ruoyi-manage/src/main/resources/mapper/manage/RecordInspectionImgMapper.xml @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_img_group.html b/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_img_group.html new file mode 100644 index 0000000..af92942 --- /dev/null +++ b/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_img_group.html @@ -0,0 +1,204 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+ +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_inspection.html b/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_inspection.html index 8ebf818..f6eb42f 100644 --- a/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_inspection.html +++ b/ruoyi-manage/src/main/resources/templates/manage/record_inspection/record_inspection.html @@ -16,10 +16,11 @@ - -
  • - - -
  • + + + + +
  •  搜索  重置 @@ -80,10 +81,10 @@ field: 'inspectionTime', title: '巡检时间' }, - { - field: 'inspectionUser', - title: '巡检人' - }, + // { + // field: 'inspectionUser', + // title: '巡检人' + // }, { field: 'totalNumber', title: '巡检数量' diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_img.html b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_img.html index e20ab41..be42382 100644 --- a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_img.html +++ b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_img.html @@ -21,6 +21,7 @@ +
  • @@ -88,20 +89,21 @@ columns: [{ checkbox: true }, - // { - // field: 'inspectionId', - // title: '巡检id' - // }, + { + field: 'inspectionId', + title: '巡检id', + visible: false + }, { field: 'objid', title: '主键', visible: false }, - // { - // field: 'locationCode', - // title: '机位码', - // visible: false - // }, + { + field: 'locationCode', + title: '机位码', + visible: false + }, { field: 'imgPath', title: '巡检图片', diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_location.html b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_location.html index 1f1d1a6..d4d9f50 100644 --- a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_location.html +++ b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_img/record_inspection_location.html @@ -1,95 +1,100 @@ - + -
    -
    -
    -
    -
    - +
    + +
    + + + + + + + + + + + + + + + +
    + +
    - - - - + var view = '' + $.each(data, function (i, row) { + view += template.replace('%locationCode%', row.locationCode) + .replace("%inspectionId%", id) + .replace("%locationCode%", row.locationCode); + + }) + + return `
    ${view}
    ` + } + \ No newline at end of file diff --git a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_task/record_inspection_task.html b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_task/record_inspection_task.html index d146b9a..e10635a 100644 --- a/ruoyi-manage/src/main/resources/templates/manage/record_inspection_task/record_inspection_task.html +++ b/ruoyi-manage/src/main/resources/templates/manage/record_inspection_task/record_inspection_task.html @@ -92,6 +92,11 @@ title: '主键', visible: false }, + { + field: 'inspectionId', + title: 'id', + visible: false + }, { @@ -132,9 +137,66 @@ initinspectionTable = function (index, row, $detail) { - var childTable = $detail.html('
    ').find('table'); + var [childTable,childTable1] = $detail.html('
    \n' + + '
    \n' + + ' \n' + + '
    \n' + + '
    \n' + + '
    '+ + '
    \n' + + '
    \n' + + '
    '+ + '
    \n' + + '
    \n' + + '
    \n' + + '
    ').find('table'); + console.log(childTable) + console.log(childTable1) $(childTable).bootstrapTable({ + url: ctx + "manage/record_inspection_info/list", + method: 'post', + sidePagination: "server", + contentType: "application/x-www-form-urlencoded", + queryParams: { + inspectionId: row.inspectionId, + locationCode:row.planePosition + }, + columns: [ + { + title: '序号', + formatter: function (value, row, index) { + return index+1 + } + }, + { + field: 'epcCode', + title: 'RFID' + }, + { + field: 'locationCode', + title: '机位码' + }, + { + field: 'inspectionState', + title: '巡检结果' + }, + { + field: 'inspectionRemark', + title: '异常原因' + }, + { + field: 'createTime', + title: '提交时间' + } + + ]}); + $(childTable1).bootstrapTable({ url: ctx + "manage/record_inspection_img/list", method: 'post', sidePagination: "server", @@ -152,7 +214,7 @@ { field: 'imgPath', - title: '路径', + title: '巡检照片', formatter: function (value, row, index) { return $.table.imageView(value, 818, 460, null); @@ -168,6 +230,8 @@ title: '上传时间' }] }); + + };