| | |
| | | import com.ruoyi.device.vo.DeviceRepairVo; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; |
| | | import com.ruoyi.project.system.service.ISysNoticeService; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SparePartsRequisitionRecord; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsRequisitionRecordService; |
| | |
| | | private final SparePartsMapper sparePartsMapper; |
| | | private final SparePartsRequisitionRecordService sparePartsRequisitionRecordService; |
| | | private final FileUtil fileUtil; |
| | | private final ISysNoticeService sysNoticeService; |
| | | |
| | | @Override |
| | | public IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto) { |
| | |
| | | sparePartsMapper.updateById(spareParts); |
| | | sparePartIds.add(sparePartUse.getId()); |
| | | |
| | | // 库存预警通知 |
| | | if (spareParts.getWarnNum() != null && spareParts.getNotifyPersonId() != null |
| | | && spareParts.getQuantity().compareTo(spareParts.getWarnNum()) < 0) { |
| | | sysNoticeService.simpleNoticeByUser( |
| | | "备件库存预警", |
| | | "备件【" + spareParts.getName() + "】当前库存(" + spareParts.getQuantity() |
| | | + ")已低于预警数量(" + spareParts.getWarnNum() + "),请及时采购补充。", |
| | | List.of(spareParts.getNotifyPersonId()), |
| | | "/equipmentManagement/spareParts" |
| | | ); |
| | | } |
| | | |
| | | // 创建备件领用记录 |
| | | SparePartsRequisitionRecord record = new SparePartsRequisitionRecord(); |
| | | record.setSourceType(1); // 1 保养 |