diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java index c6e9f5c..461d1d8 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/AlarmDataController.java @@ -62,7 +62,7 @@ public class AlarmDataController { @Operation(summary = "更新机床参数报警记录") @PreAuthorize("@ss.hasPermission('imt:alarm-data:update')") public CommonResult closeAllAlarmData(String equipAlarmId) { - return success(alarmDataService.closeAllAlarmDataByEquipAlarmId(equipAlarmId)); + return success(alarmDataService.closeAllAlarmDataByEquipAlarmId(equipAlarmId,true)); } @DeleteMapping("/delete") diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/InspectionInfoRecordController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/InspectionInfoRecordController.java new file mode 100644 index 0000000..8ba8075 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/InspectionInfoRecordController.java @@ -0,0 +1,56 @@ +package com.inspur.module.system.controller.inspection; + +import com.inspur.framework.common.pojo.CommonResult; +import com.inspur.framework.common.pojo.PageResult; +import com.inspur.framework.common.util.object.BeanUtils; +import com.inspur.module.system.controller.inspection.vo.InspectionInfoPageReqVO; +import com.inspur.module.system.controller.inspection.vo.InspectionInfoRespVO; +import com.inspur.module.system.dal.dataobject.inspection.InspectionInfoDO; +import com.inspur.module.system.service.inspection.InspectionInfoService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.inspur.framework.common.pojo.CommonResult.success; + +/** + * + * @Author xusd + * @Date 2024/11/1 13:49 + **/ +@Tag(name = "管理后台 - 点检工单记录") +@RestController +@RequestMapping("/admin-api/imt/inspection-info-record") +@Validated +public class InspectionInfoRecordController { + + @Resource + private InspectionInfoService inspectionInfoService; + + @GetMapping("/page") + @Operation(summary = "获得点检工单分页") + @PreAuthorize("@ss.hasPermission('imt:inspection-info-record:query')") + public CommonResult> getInspectionInfoRecordPage(@Valid InspectionInfoPageReqVO pageReqVO) { + PageResult pageResult = inspectionInfoService.getInspectionInfoRecordPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, InspectionInfoRespVO.class)); + } + + @GetMapping("/get") + @Operation(summary = "获得点检工单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('imt:inspection-info-record:query')") + public CommonResult getInspectionInfo(@RequestParam("id") String id) { + InspectionInfoDO inspectionInfo = inspectionInfoService.getInspectionInfo(id); + return success(BeanUtils.toBean(inspectionInfo, InspectionInfoRespVO.class)); + } + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionInfoMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionInfoMapper.java index 15374fc..0243326 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionInfoMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/inspection/InspectionInfoMapper.java @@ -26,4 +26,15 @@ public interface InspectionInfoMapper extends BaseMapperX { .orderByDesc(InspectionInfoDO::getInspectionId)); } + default PageResult selectRecordPage(InspectionInfoPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(InspectionInfoDO::getInspectionNo, reqVO.getInspectionNo()) + .eqIfPresent(InspectionInfoDO::getEquipId, reqVO.getEquipId()) + .eqIfPresent(InspectionInfoDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(InspectionInfoDO::getInspectionPlanId, reqVO.getInspectionPlanId()) + .eqIfPresent(InspectionInfoDO::getStatus, reqVO.getStatus()) + .eqIfPresent(InspectionInfoDO::getStatus,3) + .orderByDesc(InspectionInfoDO::getInspectionId)); + } + } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java index 49b8b91..a7b698c 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataService.java @@ -62,8 +62,9 @@ public interface AlarmDataService { /** * 关闭制定设备报警id下的所有参数报警记录 + * @param flag 是否为页面手动点击关闭 */ - int closeAllAlarmDataByEquipAlarmId(String equipAlarmId); + int closeAllAlarmDataByEquipAlarmId(String equipAlarmId,boolean flag); /** * 根据规则id获取参数报警记录 diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java index af7bfee..7b2086b 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java @@ -115,15 +115,17 @@ public class AlarmDataServiceImpl implements AlarmDataService { */ @Override @Transactional - public int closeAllAlarmDataByEquipAlarmId(String equipAlarmId){ + public int closeAllAlarmDataByEquipAlarmId(String equipAlarmId,boolean flag){ List alarmDataList = alarmDataMapper.selectAlarmDatas(new AlarmDataPageReqVO().setEquipAlarmId(equipAlarmId)); EquipAlarmDataSaveReqVO equipAlarmDataSaveReqVO = new EquipAlarmDataSaveReqVO(); equipAlarmDataSaveReqVO.setEquipAlarmId(equipAlarmId); equipAlarmDataSaveReqVO.setStatus(1);//关闭 equipAlarmDataService.updateEquipAlarmData(equipAlarmDataSaveReqVO); //关闭点检工单 - InspectionInfoServiceImpl inspectionInfoService = SpringUtils.getBean(InspectionInfoServiceImpl.class); - inspectionInfoService.closeInspectionInfoByAlarmId(equipAlarmId); + if (flag){ + InspectionInfoServiceImpl inspectionInfoService = SpringUtils.getBean(InspectionInfoServiceImpl.class); + inspectionInfoService.closeInspectionInfoByAlarmId(equipAlarmId); + } if (CollUtil.isEmpty(alarmDataList)){ return 0; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java index e5a309e..6330076 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java @@ -89,4 +89,13 @@ public interface InspectionInfoService { * @param alarmId 报警id */ void closeInspectionInfoByAlarmId(String alarmId); + + + /** + * 获得点检工单记录分页 + * + * @param pageReqVO 分页查询 + * @return 点检工单分页 + */ + PageResult getInspectionInfoRecordPage(InspectionInfoPageReqVO pageReqVO); } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java index bb5fbb6..d51ac94 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java @@ -138,7 +138,20 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { @Override @TenantIgnore public InspectionInfoDO getInspectionInfo(String id) { - return inspectionInfoMapper.selectById(id); + InspectionInfoDO inspectionInfoDO = inspectionInfoMapper.selectById(id); + if (Objects.nonNull(inspectionInfoDO)){ + if (StrUtil.isNotBlank(inspectionInfoDO.getCustomerId())){ + List customerList = customerInfoService.selection(true); + Map customerListMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName)); + inspectionInfoDO.setCustomerName(customerListMap.get(inspectionInfoDO.getCustomerId())); + } + if (StrUtil.isNotBlank(inspectionInfoDO.getEquipId())){ + List equipList = equipInfoService.selection(); + Map equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipName)); + inspectionInfoDO.setEquipName(equipMap.get(inspectionInfoDO.getEquipId())); + } + } + return inspectionInfoDO; } @Override @@ -174,10 +187,10 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { @Transactional(rollbackFor = Exception.class) public Boolean inspectionFeedback(InspectionInfoFeedbackVO vo) { InspectionInfoDO inspectionInfoDO = BeanUtils.toBean(vo, InspectionInfoDO.class); - int i = inspectionInfoMapper.updateById(inspectionInfoDO); if (vo.getCloseAlarm()) { - alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId()); + alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId(),false); } + int i = inspectionInfoMapper.updateById(inspectionInfoDO); //点检树新增 if (CollUtil.isNotEmpty(vo.getFeedbackList())){ List feedbackList = vo.getFeedbackList(); @@ -191,7 +204,7 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { public Boolean exclusiveInspectionFeedback(ExclusiveInspectionInfoFeedbackVO vo) { InspectionInfoDO inspectionInfoDO = BeanUtils.toBean(vo, InspectionInfoDO.class); if (vo.getCloseAlarm()) { - alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId()); + alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId(),false); } return inspectionInfoMapper.updateById(inspectionInfoDO) > 0; } @@ -239,4 +252,33 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { updateWrapper.set(InspectionInfoDO::getRemark, "手动关闭报警"); inspectionInfoMapper.update(updateWrapper); } + + @Override + public PageResult getInspectionInfoRecordPage(InspectionInfoPageReqVO pageReqVO) { + PageResult page = inspectionInfoMapper.selectRecordPage(pageReqVO); + List list = page.getList(); + if (CollUtil.isNotEmpty(list)){ + List customerList = customerInfoService.selection(true); + Map customerListMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName)); + List equipList = equipInfoService.selection(); + Map equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipName)); + List inspectionPlanList = inspectionPlanService.getInspectionPlanList(new InspectionPlanListReqVO()); + Map inspectionPlanMap = inspectionPlanList.stream().collect(Collectors.toMap(InspectionPlanDO::getInspectionPlanId, InspectionPlanDO::getInspectionName)); + list.forEach(item->{ + item.setCustomerName(customerListMap.get(item.getCustomerId())); + item.setEquipName(equipMap.get(item.getEquipId())); + if (StrUtil.isNotBlank(item.getInspectionPlanId())){ + String[] split = item.getInspectionPlanId().split(","); + List inspectionPlanNameList = new ArrayList<>(); + for (String s : split) { + inspectionPlanNameList.add(inspectionPlanMap.get(Long.parseLong(s))); + } + if (CollUtil.isNotEmpty(inspectionPlanNameList)){ + item.setInspectionPlanName(CollUtil.join(inspectionPlanNameList,",")); + } + } + }); + } + return page; + } } \ No newline at end of file diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java index a5bf12e..9580a37 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java @@ -128,7 +128,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { } maintenanceOrderMapper.insert(remoteMaintenanceOrder); if ("0".equals(createReqVO.getSubmitFlag()) && StrUtil.isNotBlank(createReqVO.getAlarmId())) { - alarmDataService.closeAllAlarmDataByEquipAlarmId(createReqVO.getAlarmId()); + alarmDataService.closeAllAlarmDataByEquipAlarmId(createReqVO.getAlarmId(),false); } //设置点检工单状态 if (StrUtil.isNotBlank(createReqVO.getInspectionId())){ diff --git a/imt-ui/src/api/system/inspection/inspectionInfoRecord.js b/imt-ui/src/api/system/inspection/inspectionInfoRecord.js new file mode 100644 index 0000000..cf855f6 --- /dev/null +++ b/imt-ui/src/api/system/inspection/inspectionInfoRecord.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 获得点检工单 +export function getInspectionRecordInfo(id) { + return request({ + url: '/imt/inspection-info-record/get?id=' + id, + method: 'get' + }) +} + +// 获得点检工单分页 +export function getInspectionInfoRecordPage(params) { + return request({ + url: '/imt/inspection-info-record/page', + method: 'get', + params + }) +} diff --git a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue index a9af5e2..62c011e 100644 --- a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue +++ b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue @@ -32,10 +32,10 @@ /> - - - + + + + - +
+
+ + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
基本信息
+ + + {{formData.inspectionNo}} + + + + + {{formData.customerName}} + + + + + {{formData.equipName}} + + + + + {{formData.remark}} + + + +
+ +
点检反馈信息
+ + + + + {{ formData.inspectionPlanSupplement }} + + + {{ formData.exclusiveInspection }} + + + {{ formData.exclusiveInspectionFeedback }} + +
+
+ +
+
+ + +