| | |
| | | |
| | | @ApiOperation(value = "人åæç»å页æ¥è¯¢") |
| | | @GetMapping("basicInformationOfPersonnelSelectPage") |
| | | public Result<IPage<Map<String, Object>>> basicInformationOfPersonnelSelectPage(Page<List<PersonBasicInfoDetailsDto>> page, String name, Integer departmentId) { |
| | | public Result<IPage<Map<String, Object>>> basicInformationOfPersonnelSelectPage(Page page, String name, Integer departmentId) { |
| | | return Result.success(personBasicInfoService.basicInformationOfPersonnelSelectPage(page, name, departmentId)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.dto.DepartmentDto; |
| | | import com.ruoyi.personnel.dto.PersonBasicInfoDto; |
| | | import com.ruoyi.personnel.pojo.PersonBasicInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectPersonBasecInfoAndUser(Page page, String name, Integer departmentId); |
| | | IPage<Map<String, Object>> selectPersonBasecInfoAndUser(Page page, @Param("name") String name, @Param("departmentId") Integer departmentId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.requier.pojo.DeviceFault; |
| | | import com.ruoyi.requier.service.DeviceFaultService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/deviceFaults") |
| | | public class DeviceFaultController { |
| | | |
| | | private final DeviceFaultService deviceFaultService; |
| | | |
| | | @Autowired |
| | | public DeviceFaultController(DeviceFaultService deviceFaultService) { |
| | | this.deviceFaultService = deviceFaultService; |
| | | } |
| | | |
| | | @GetMapping |
| | | public List<DeviceFault> getAllDeviceFaults() { |
| | | return deviceFaultService.list(); |
| | | } |
| | | |
| | | @PostMapping |
| | | public DeviceFault createDeviceFault(@RequestBody DeviceFault deviceFault) { |
| | | deviceFaultService.save(deviceFault); |
| | | return deviceFault; |
| | | } |
| | | |
| | | @PutMapping("/{id}") |
| | | public DeviceFault updateDeviceFault(@PathVariable Integer id, @RequestBody DeviceFault deviceFault) { |
| | | deviceFault.setId(id); |
| | | deviceFaultService.updateById(deviceFault); |
| | | return deviceFault; |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | public void deleteDeviceFault(@PathVariable Integer id) { |
| | | deviceFaultService.removeById(id); |
| | | } |
| | | |
| | | @GetMapping("/device/{deviceId}") |
| | | public Result<Map<String,Object>> getDeviceFaultsByDeviceId(@PathVariable Integer deviceId) { |
| | | return Result.success(deviceFaultService.findByDeviceId(deviceId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.requier.dto.InstructionDto; |
| | | import com.ruoyi.requier.pojo.Instruction; |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import com.ruoyi.requier.service.InstructionService; |
| | | import com.ruoyi.requier.service.OperationInstructionService; |
| | | import com.ruoyi.requier.vo.OperationInstructionVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:29:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/instruction") |
| | | public class InstructionController { |
| | | |
| | | @Autowired |
| | | private InstructionService instructionService; |
| | | |
| | | @Autowired |
| | | private OperationInstructionService operationInstructionService; |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦ å页") |
| | | @GetMapping("/pageByPageQueryOfHomeworkInstructions") |
| | | public Result<IPage<Instruction>> pageByPageQueryOfHomeworkInstructions(Page page){ |
| | | return Result.success(instructionService.pageByPageQueryOfHomeworkInstructions(page)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦æ°å¢") |
| | | @PostMapping("/newHomeworkGuidebookAdded") |
| | | public Result newHomeworkGuidebookAdded(@RequestBody InstructionDto instructionDto){ |
| | | instructionService.newHomeworkGuidebookAdded(instructionDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦ç¼è¾") |
| | | @GetMapping("/homeworkGuidebookEditor") |
| | | public Result<Map<String, Object>> homeworkGuidebookEditor(Integer instructionId){ |
| | | Instruction instruction = instructionService.getById(instructionId); |
| | | List<OperationInstructionVo> list = operationInstructionService.homeworkGuidebookEditor(instructionId); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("list", list); |
| | | map.put("instruction", instruction); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦åæ§æä»¶å é¤") |
| | | @GetMapping("/deleteHomeworkGuidebook") |
| | | public Result deleteHomeworkGuidebook(String ids){ |
| | | if (ObjectUtils.isNotEmpty(ids)) { |
| | | String[] idArray = ids.split(","); |
| | | operationInstructionService.removeBatchByIds(Arrays.asList(idArray)); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦å é¤") |
| | | @DeleteMapping("/homeworkGuidebook") |
| | | public Result homeworkGuidebook(String id, String instructionId){ |
| | | // å é¤åè¡¨æ°æ® |
| | | operationInstructionService.removeById(id); |
| | | // 妿åè¡¨æ°æ®ä¸ºç©º |
| | | long count = operationInstructionService.count(Wrappers.<OperationInstruction>lambdaQuery() |
| | | .eq(OperationInstruction::getInstructionId, instructionId)); |
| | | // é£ä¹å°±å é¤ç¶è¡¨æ°æ® |
| | | if (count < 1) { |
| | | instructionService.removeById(id); |
| | | } |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä½ä¸æå¯¼ä¹¦å®¡æ¹") |
| | | @PostMapping("/approvalOfHomeworkInstructionManual") |
| | | public Result approvalOfHomeworkInstructionManual(String id, Boolean status){ |
| | | operationInstructionService.update(Wrappers.<OperationInstruction>lambdaUpdate() |
| | | .eq(OperationInstruction::getId, id) |
| | | .set(OperationInstruction::getStatus, status) |
| | | .set(OperationInstruction::getApproverId, SecurityUtils.getUserId()) |
| | | .set(OperationInstruction::getEntryIntoForceTime, LocalDateTime.now())); |
| | | return Result.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.utils.JackSonUtil; |
| | | import com.ruoyi.requier.dto.DeviceDto; |
| | | import com.ruoyi.requier.pojo.Reservation; |
| | | import com.ruoyi.requier.service.DeviceService; |
| | | import com.ruoyi.requier.service.ReservationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * èµæºé¢å®æ°å»ºé¢å®è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author baomidou |
| | | * @since 2024-09-14 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/reservation") |
| | | public class ReservationController { |
| | | @Autowired |
| | | private ReservationService reservationService; |
| | | |
| | | @Resource |
| | | private DeviceService deviceService; |
| | | |
| | | @GetMapping("/selectDeviceParameter") |
| | | public Result selectDeviceParameter(Page page,DeviceDto itemParameter, |
| | | @RequestParam(value = "laboratoryNameIsNull", required = false) Boolean laboratoryNameIsNull, |
| | | @RequestParam(value = "starttime", required = false)String starttime, |
| | | @RequestParam(value = "endtime", required = false) String endtime) { |
| | | ArrayList<JSONObject> jsonObjects = reservationService.selectDeviceParameter(page, itemParameter, laboratoryNameIsNull, starttime, endtime); |
| | | return Result.success(jsonObjects); |
| | | } |
| | | |
| | | @GetMapping("/selectReservationParameterPage") |
| | | public Result selectReservationParameterPage(@RequestParam String deviceId,@RequestParam String reservationTime,@RequestParam String specificTime){ |
| | | return Result.success(reservationService.selectReservationParameterPage(deviceId,reservationTime,specificTime)); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | public Result getList(@PathVariable Integer id) { |
| | | LambdaQueryWrapper<Reservation> lambdaQueryWrapper=new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(Reservation::getDeviceId,id); |
| | | return Result.success(reservationService.list(lambdaQueryWrapper)); |
| | | } |
| | | |
| | | @PostMapping("save") |
| | | public Result save(@RequestBody Reservation reservation){ |
| | | reservation.setCreateDate(LocalDateTime.now()); |
| | | reservationService.save(reservation); |
| | | return Result.success(); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/delete") |
| | | public Result deleteReservation(String ids) { |
| | | String[] idArray = ids.split(","); |
| | | reservationService.removeBatchByIds(Arrays.asList(idArray)); |
| | | return Result.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.dto; |
| | | |
| | | import com.ruoyi.requier.pojo.DeviceFaultOne; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DeviceFaultOneDto extends DeviceFaultOne { |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | private String specificationModel; |
| | | |
| | | @ApiModelProperty(value = "管çç¼å·") |
| | | private String managementNumber; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.dto; |
| | | |
| | | import com.ruoyi.requier.pojo.Instruction; |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InstructionDto extends Instruction { |
| | | |
| | | private List<OperationInstruction> feTempHumRecordList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.dto; |
| | | |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OperationInstructionDto extends OperationInstruction { |
| | | @ApiModelProperty("ç³è¯·ç¼å·") |
| | | private String applicationNumber; |
| | | |
| | | @ApiModelProperty("ç³è¯·é¨é¨") |
| | | private String applicationDepartment; |
| | | |
| | | @ApiModelProperty("责任人") |
| | | private String personLiable; |
| | | |
| | | @ApiModelProperty("åæ§ç³è¯·è¯´æ") |
| | | private String controlledApplicationDescription; |
| | | |
| | | @ApiModelProperty("管çç¼å·") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private String deviceModel; |
| | | |
| | | @ApiModelProperty("设å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("ä¸ä¼ 人") |
| | | private String uploaderName; |
| | | |
| | | @ApiModelProperty("审æ¹äºº") |
| | | private String approverName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.dto; |
| | | |
| | | import com.ruoyi.requier.pojo.Reservation; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ReservationDto extends Reservation { |
| | | |
| | | private String name; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.requier.pojo.DeviceFault; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface DeviceFaultMapper extends BaseMapper<DeviceFault> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.requier.dto.DeviceFaultOneDto; |
| | | import com.ruoyi.requier.pojo.DeviceFaultOne; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤æ
é表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-09-26 02:03:29 |
| | | */ |
| | | public interface DeviceFaultOneMapper extends BaseMapper<DeviceFaultOne> { |
| | | |
| | | IPage<DeviceFaultOneDto> deviceFaultOnePage(Integer deviceId, Page page, String processNumber); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.requier.pojo.Instruction; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:29:18 |
| | | */ |
| | | public interface InstructionMapper extends BaseMapper<Instruction> { |
| | | |
| | | IPage<Instruction> pageByPageQueryOfHomeworkInstructions(Page page); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import com.ruoyi.requier.vo.OperationInstructionVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤ - ä½ä¸æå¯¼ä¹¦ æ·»å åæ§æä»¶ å Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:43:32 |
| | | */ |
| | | public interface OperationInstructionMapper extends BaseMapper<OperationInstruction> { |
| | | |
| | | List<OperationInstructionVo> homeworkGuidebookEditor(Integer instructionId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.requier.dto.ReservationDto; |
| | | import com.ruoyi.requier.pojo.Reservation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * èµæºé¢å®æ°å»ºé¢å®è¡¨ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author baomidou |
| | | * @since 2024-09-14 |
| | | */ |
| | | public interface ReservationMapper extends BaseMapper<Reservation> { |
| | | |
| | | |
| | | List<ReservationDto> selectReservationParameterPage(@Param("deviceId") Integer deviceId, @Param("reservationTime") String reservationTime, @Param("specificTime") String specificTime); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("device_faults") |
| | | public class DeviceFault { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | //设å¤di |
| | | private Integer deviceId; |
| | | //æ
鿬¡æ° |
| | | private Integer faultCount; |
| | | //æè¿æ
鿥æ |
| | | private LocalDate recentFaultDate; |
| | | //æè¿æ ¡åæ¥æ |
| | | private LocalDate recentCalibrationDate; |
| | | // æè¿æ ¡åç»è®º |
| | | private String calibrationConclusion; |
| | | // æè¿æ£æ¥æ¥æ |
| | | private LocalDate recentCheckDate; |
| | | // ä¸ä¸æ¬¡æ£æ¥æ¥æ |
| | | private LocalDate nextCheckDate; |
| | | //æ£æ¥ç»è®º |
| | | private String checkConclusion; |
| | | //ç»´æ¤ç±»å |
| | | private String maintenanceType; |
| | | //ç»´æ¤äººå |
| | | private String maintenancePerson; |
| | | //夿³¨ |
| | | private String comments; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤æ
é表 |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-09-26 02:03:29 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("device_fault_one") |
| | | @ApiModel(value = "DeviceFaultOne对象", description = "è®¾å¤æ
é表") |
| | | public class DeviceFaultOne implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("设å¤id") |
| | | private Integer deviceId; |
| | | |
| | | @ApiModelProperty("1æµç¨ç¼å·") |
| | | private String processNumber; |
| | | |
| | | @ApiModelProperty("1å确度éå¼") |
| | | private String measureOfAccuracy; |
| | | |
| | | @ApiModelProperty("1æ
éæ
åµ") |
| | | private String faultSituation; |
| | | |
| | | @ApiModelProperty("1æä»¶åå") |
| | | private String fileName; |
| | | |
| | | @ApiModelProperty("1ç³»ç»æä»¶å") |
| | | private String systemFileName; |
| | | |
| | | @ApiModelProperty("1ä¸ç¯èè´è´£äºº") |
| | | private String submitNextPesponsible; |
| | | |
| | | @ApiModelProperty("1æä½äºº") |
| | | private String submitOperatingPersonnel; |
| | | |
| | | @ApiModelProperty("1æ¥æ") |
| | | private LocalDateTime submitDate; |
| | | |
| | | @ApiModelProperty("2ç»´ä¿®æ¹å¼åè´¹ç¨") |
| | | private String methodCost; |
| | | |
| | | @ApiModelProperty("2å®¡æ ¸æè§") |
| | | private String adminAuditOption; |
| | | |
| | | @ApiModelProperty("2设å¤ç®¡çå-ä¸ç¯èè´è´£äºº") |
| | | private String adminNextPesponsible; |
| | | |
| | | @ApiModelProperty("2管çå-æä½äºº") |
| | | private String adminOperatingPersonnel; |
| | | |
| | | @ApiModelProperty("2管çå-æ¥æ") |
| | | private LocalDateTime adminDate; |
| | | |
| | | @ApiModelProperty("3 ææ¯è´è´£äºº å®¡æ ¸æè§") |
| | | private String technicalAuditOption; |
| | | |
| | | @ApiModelProperty("3ææ¯è´è´£äºº ä¸ç¯èè´è´£äºº") |
| | | private String technicalNextPesponsible; |
| | | |
| | | @ApiModelProperty("3 ææ¯è´è´£äºº æä½äºº") |
| | | private String technicalOperatingPersonnel; |
| | | |
| | | @ApiModelProperty("3 ææ¯è´è´£äºº æ¥æ") |
| | | private LocalDateTime technicalDate; |
| | | |
| | | @ApiModelProperty("4ç»´ä¿®æ
åµ") |
| | | private String maintainSituation; |
| | | |
| | | @ApiModelProperty("4 ç»´ä¿® ä¸ç¯èè´è´£äºº") |
| | | private String maintainNextPesponsible; |
| | | |
| | | @ApiModelProperty("4 ç»´ä¿® æä½äºº") |
| | | private String maintainOperatingPersonnel; |
| | | |
| | | @ApiModelProperty("4 ç»´ä¿® æ¥æ") |
| | | private LocalDateTime maintainDate; |
| | | |
| | | @ApiModelProperty("5éªæ¶ç¡®è®¤æ ¡åæ
åµ") |
| | | private String checkCalSituation; |
| | | |
| | | @ApiModelProperty("5 ç»´ä¿®å æä½äºº") |
| | | private String afterMaintenanceOperatingPersonnel; |
| | | |
| | | @ApiModelProperty("5 ç»´ä¿®å æ¥æ") |
| | | private LocalDateTime afterMaintenanceDate; |
| | | |
| | | @ApiModelProperty("å½åç¶æ") |
| | | private String currentState; |
| | | |
| | | @ApiModelProperty("æäº¤äºº") |
| | | private String submitPerson; |
| | | |
| | | @ApiModelProperty("å½å责任人") |
| | | private String currentResponsible; |
| | | |
| | | @ApiModelProperty("åå»ºæ¥æ") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ
鿥æ") |
| | | private LocalDate faultDate; |
| | | |
| | | @ApiModelProperty("è¦æ±ä¿®å¤æ¥æ") |
| | | private LocalDate requestRepairDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:29:18 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("device_instruction") |
| | | @ApiModel(value = "Instruction对象", description = "ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨") |
| | | public class Instruction implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("ç³è¯·ç¼å·") |
| | | private String applicationNumber; |
| | | |
| | | @ApiModelProperty("ç³è¯·é¨é¨") |
| | | private String applicationDepartment; |
| | | |
| | | @ApiModelProperty("责任人") |
| | | private String personLiable; |
| | | |
| | | @ApiModelProperty("åæ§ç³è¯·è¯´æ") |
| | | private String controlledApplicationDescription; |
| | | |
| | | @ApiModelProperty("ç³»ç»çæåç§°") |
| | | private String fileName; |
| | | |
| | | @ApiModelProperty("ç³»ç»çæåç§°") |
| | | private String fileSystemName; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤ - ä½ä¸æå¯¼ä¹¦ æ·»å åæ§æä»¶ å |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:43:32 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("device_operation_instruction") |
| | | @ApiModel(value = "OperationInstruction对象", description = "è®¾å¤ - ä½ä¸æå¯¼ä¹¦ æ·»å åæ§æä»¶ å") |
| | | public class OperationInstruction implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("设å¤ä¸»é®id") |
| | | private String deviceId; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å") |
| | | private String documentType; |
| | | |
| | | @ApiModelProperty("ææ¡£ç¼å·") |
| | | private String documentNumber; |
| | | |
| | | @ApiModelProperty("æä»¶çæ¬") |
| | | private String documentVersion; |
| | | |
| | | @ApiModelProperty("ä½è
") |
| | | private String author; |
| | | |
| | | @ApiModelProperty("æäº¤æ¥æ") |
| | | private LocalDate submitDate; |
| | | |
| | | @ApiModelProperty("ææ¡£è¯´æ") |
| | | private String documentNote; |
| | | |
| | | @ApiModelProperty("ç³»ç»çæåç§°") |
| | | private String fileName; |
| | | |
| | | @ApiModelProperty("ç³»ç»çæåç§°") |
| | | private String fileSystemName; |
| | | |
| | | @ApiModelProperty("ä½ä¸æå¯¼ä¹¦id") |
| | | private Integer instructionId; |
| | | |
| | | @ApiModelProperty("ä¸ä¼ 人id") |
| | | private Integer uploader; |
| | | |
| | | @ApiModelProperty("审æ¹äººid") |
| | | private Integer approverId; |
| | | |
| | | @ApiModelProperty("审æ¹ç¶æ") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty("çææ¶é´") |
| | | private LocalDateTime entryIntoForceTime; |
| | | |
| | | @ApiModelProperty("ä¸ä¼ æ¶é´") |
| | | private LocalDateTime uploadTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°äººid") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * èµæºé¢å®æ°å»ºé¢å®è¡¨ |
| | | * </p> |
| | | * |
| | | * @author baomidou |
| | | * @since 2024-09-14 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("device_reservation") |
| | | public class Reservation implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Integer deviceId; |
| | | |
| | | /** |
| | | * é¢å®è®¾å¤ |
| | | */ |
| | | private String deviceName; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | private String customerName; |
| | | |
| | | /** |
| | | * é¢å®æ¶é´ |
| | | */ |
| | | |
| | | private String reservationTime; |
| | | |
| | | /** |
| | | * å
·ä½æ¶é´ |
| | | */ |
| | | private String specificTime; |
| | | |
| | | |
| | | |
| | | /** |
| | | * è系人 |
| | | */ |
| | | private String linkPerson; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | private String phone; |
| | | |
| | | /** |
| | | * æµç¨ç¼å· |
| | | */ |
| | | private String deviceNumber; |
| | | |
| | | /** |
| | | * é¢å®è¯´æ |
| | | */ |
| | | private String reservationSpecification; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime createDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.requier.pojo.DeviceFault; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface DeviceFaultService extends IService<DeviceFault> { |
| | | Map<String,Object> findByDeviceId(Integer deviceId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.requier.dto.InstructionDto; |
| | | import com.ruoyi.requier.pojo.Instruction; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:29:18 |
| | | */ |
| | | public interface InstructionService extends IService<Instruction> { |
| | | |
| | | IPage<Instruction> pageByPageQueryOfHomeworkInstructions(Page page); |
| | | |
| | | void newHomeworkGuidebookAdded(InstructionDto instructionDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import com.ruoyi.requier.vo.OperationInstructionVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤ - ä½ä¸æå¯¼ä¹¦ æ·»å åæ§æä»¶ å æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:43:32 |
| | | */ |
| | | public interface OperationInstructionService extends IService<OperationInstruction> { |
| | | |
| | | List<OperationInstructionVo> homeworkGuidebookEditor(Integer instructionId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.requier.dto.DeviceDto; |
| | | import com.ruoyi.requier.dto.ReservationDto; |
| | | import com.ruoyi.requier.pojo.Reservation; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * èµæºé¢å®æ°å»ºé¢å®è¡¨ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author baomidou |
| | | * @since 2024-09-14 |
| | | */ |
| | | public interface ReservationService extends IService<Reservation> { |
| | | |
| | | ArrayList<JSONObject> selectDeviceParameter(Page page, DeviceDto itemParameter, Boolean laboratoryNameIsNull, String starttime, String endtime); |
| | | |
| | | List<ReservationDto> selectReservationParameterPage(String deviceId, String reservationTime, String specificTime); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.StructureItemParameterMapper; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.utils.DictUtils; |
| | | import com.ruoyi.requier.mapper.DeviceFaultMapper; |
| | | import com.ruoyi.requier.mapper.DeviceFaultOneMapper; |
| | | import com.ruoyi.requier.mapper.DeviceMaintenanceMapper; |
| | | import com.ruoyi.requier.mapper.DeviceMapper; |
| | | import com.ruoyi.requier.pojo.*; |
| | | import com.ruoyi.requier.service.DeviceFaultService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class DeviceFaultServiceImpl extends ServiceImpl<DeviceFaultMapper, DeviceFault> implements DeviceFaultService { |
| | | |
| | | @Autowired |
| | | private DeviceMapper deviceMapper; |
| | | |
| | | @Autowired |
| | | private QrShowServiceImpl qrShowService; |
| | | |
| | | @Autowired |
| | | private DeviceMaintenanceMapper deviceMaintenanceMapper; |
| | | |
| | | @Autowired |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | | @Autowired |
| | | private DeviceFaultOneMapper deviceFaultOneMapper; |
| | | |
| | | @Override |
| | | public Map<String,Object> findByDeviceId(Integer deviceId) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | if(Objects.isNull(deviceId)){ |
| | | return map; |
| | | } |
| | | //æ¥è¯¢è®¾å¤ä¸»è¡¨ä¿¡æ¯ |
| | | Device device = deviceMapper.selectById(deviceId); |
| | | if(!Objects.isNull(device)){ |
| | | //æ¥è¯¢è®¾å¤æ ¡åä¿¡æ¯ |
| | | DeviceMetricRecord calibrate = qrShowService.getDeviceMetricRecord(device.getId(), "calibrate"); |
| | | //æ¥è¯¢è®¾å¤æ ¸æ¥ä¿¡æ¯ |
| | | DeviceMetricRecord examine = qrShowService.getDeviceMetricRecord(device.getId(), "examine"); |
| | | //æ¥è¯¢è®¾å¤ç»´æ¤è®°å½ |
| | | DeviceMaintenance deviceMaintenance = Optional.ofNullable(deviceMaintenanceMapper.selectOne(Wrappers.<DeviceMaintenance>lambdaQuery() |
| | | .eq(DeviceMaintenance::getDeviceId, device.getId()) |
| | | .orderByDesc(DeviceMaintenance::getId) |
| | | .last("limit 1"))).orElse(new DeviceMaintenance()); |
| | | //æ¥è¯¢è®¾å¤æ
éä¿¡æ¯ |
| | | List<DeviceFaultOne> deviceFaultOneList = Optional.ofNullable(deviceFaultOneMapper.selectList(Wrappers.<DeviceFaultOne>lambdaQuery() |
| | | .eq(DeviceFaultOne::getDeviceId, device.getId()) |
| | | .orderByDesc(DeviceFaultOne::getId))).orElse(new ArrayList<>()); |
| | | //æ¥è¯¢è®¾å¤ç¶æåå
¸ |
| | | List<SysDictData> sysDictDataList = DictUtils.getDictCache("设å¤ç¶æ"); |
| | | SysDictData findEnum = sysDictDataList.stream().filter(e-> Integer.parseInt(e.getDictValue()) ==device.getDeviceStatus()).findFirst().orElse(new SysDictData()); |
| | | map.put("progress",qrShowService.calcDeviceNextCheckRatio(calibrate.getCalibrationDate(),calibrate.getNextCalibrationDate()));//è·ç¦»ä¸æ¬¡æ ¡åæ¥æç天æ°ç¾åæ¯ |
| | | map.put("deviceName",device.getDeviceName());//设å¤åç§° |
| | | map.put("deviceCode",device.getManagementNumber());//设å¤ç¼å· |
| | | map.put("usedYears",qrShowService.calcUsedYears(device.getActivationDate()));//å¯ç¨æ¶é¿(å¹´) |
| | | map.put("deviceStatus",findEnum.getDictLabel());//设å¤è¿è¡ç¶æ |
| | | map.put("faultCount",deviceFaultOneList.size());//æ
鿬¡æ° |
| | | String faultDate = !deviceFaultOneList.isEmpty() ?qrShowService.formatDate(deviceFaultOneList.get(0).getFaultDate(),"yyyy-MM-dd"):""; |
| | | map.put("faultDate",faultDate);//æè¿æ
鿥æ |
| | | map.put("lastCalibrationDate",qrShowService.formatDate(calibrate.getCalibrationDate(),"yyyy-MM-dd"));//æè¿æ ¡åæ¥æ |
| | | map.put("nextCalibrationDate",qrShowService.formatDate(calibrate.getNextCalibrationDate(),"yyyy-MM-dd"));//䏿¬¡æ ¡åæ¥æ |
| | | String calibrateStatus = "0yes".equals(calibrate.getStatus())?"åæ ¼":"1no".equals(calibrate.getStatus())?"ä¸åæ ¼":"å
¶ä»"; |
| | | map.put("calibrateStatus",Objects.isNull(calibrate.getCalibrationDate())?"":calibrateStatus);//æ ¡åæ»ç»è®º |
| | | map.put("lastExamineDate",examine.getCalibrationDate());//æè¿æ ¸æ¥æ¥æ |
| | | map.put("nextExamineDate",examine.getNextCalibrationDate());//䏿¬¡æ ¸æ¥æ¥æ |
| | | String examineStatus = "0yes".equals(examine.getStatus())?"åæ ¼":"1no".equals(examine.getStatus())?"ä¸åæ ¼":"å
¶ä»"; |
| | | map.put("examineStatus",Objects.isNull(examine.getCalibrationDate())?"":examineStatus);//æ ¸æ¥æ»ç»è®º |
| | | map.put("maintenanceDate",deviceMaintenance.getDate());//æè¿ç»´æ¤æ¥æ |
| | | map.put("nextMaintenanceDate",deviceMaintenance.getNextDate());//䏿¬¡ç»´æ¤æ¥æ |
| | | String maintenanceType = ""; |
| | | if(!Objects.isNull(deviceMaintenance.getMaintenanceType())){ |
| | | maintenanceType = 0==deviceMaintenance.getMaintenanceType()?"使ç¨åç»´æ¤":"使ç¨åç»´æ¤"; |
| | | } |
| | | map.put("maintenanceType",maintenanceType);//ç»´æ¤æ»ç»è®º |
| | | //æµéé¡¹ç® |
| | | String insProduct = ""; |
| | | if(StringUtils.isNotBlank(device.getInsProductIds())){ |
| | | String[] ids = device.getInsProductIds().split(","); |
| | | List<StructureItemParameter> parameters = structureItemParameterMapper.selectBatchIds(Arrays.asList(ids)); |
| | | List<String> itemList = parameters.stream().map(StructureItemParameter::getInspectionItem).distinct().collect(Collectors.toList()); |
| | | insProduct = String.join(",",itemList); |
| | | } |
| | | map.put("insProduct",insProduct);//æµéé¡¹ç® |
| | | } |
| | | return map; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.numgen.NumberGenerator; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.requier.dto.InstructionDto; |
| | | import com.ruoyi.requier.mapper.InstructionMapper; |
| | | import com.ruoyi.requier.pojo.Instruction; |
| | | import com.ruoyi.requier.service.InstructionService; |
| | | import com.ruoyi.requier.service.OperationInstructionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä½ä¸æå¯¼ä¹¦æ·»å åæ§æä»¶è¡¨ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:29:18 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class InstructionServiceImpl extends ServiceImpl<InstructionMapper, Instruction> implements InstructionService { |
| | | |
| | | @Autowired |
| | | private OperationInstructionService operationInstructionService; |
| | | |
| | | @Autowired |
| | | private NumberGenerator<Instruction> numberGenerator; |
| | | |
| | | @Override |
| | | public IPage<Instruction> pageByPageQueryOfHomeworkInstructions(Page page) { |
| | | return baseMapper.pageByPageQueryOfHomeworkInstructions(page); |
| | | } |
| | | |
| | | @Override |
| | | public void newHomeworkGuidebookAdded(InstructionDto instructionDto) { |
| | | if (ObjectUtils.isEmpty(instructionDto.getApplicationNumber())) { |
| | | String year = new SimpleDateFormat("yy", Locale.CHINESE).format(new Date()); |
| | | String month = new SimpleDateFormat("MM", Locale.CHINESE).format(new Date()); |
| | | String day = new SimpleDateFormat("dd", Locale.CHINESE).format(new Date()); |
| | | String processNumber = numberGenerator.generateNumberWithPrefix(3, "WJSK" + year + month + day, Instruction::getApplicationNumber); |
| | | instructionDto.setApplicationNumber(processNumber); |
| | | } |
| | | saveOrUpdate(instructionDto); |
| | | if (ObjectUtils.isNotEmpty(instructionDto.getFeTempHumRecordList())) { |
| | | instructionDto.getFeTempHumRecordList().forEach(i -> { |
| | | i.setInstructionId(instructionDto.getId()); |
| | | i.setUploader(SecurityUtils.getUserId().intValue()); |
| | | i.setUpdateTime(LocalDateTime.now()); |
| | | }); |
| | | operationInstructionService.saveOrUpdateBatch(instructionDto.getFeTempHumRecordList()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.requier.mapper.OperationInstructionMapper; |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import com.ruoyi.requier.service.OperationInstructionService; |
| | | import com.ruoyi.requier.vo.OperationInstructionVo; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è®¾å¤ - ä½ä¸æå¯¼ä¹¦ æ·»å åæ§æä»¶ å æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2024-12-04 10:43:32 |
| | | */ |
| | | @Service |
| | | public class OperationInstructionServiceImpl extends ServiceImpl<OperationInstructionMapper, OperationInstruction> implements OperationInstructionService { |
| | | |
| | | @Override |
| | | public List<OperationInstructionVo> homeworkGuidebookEditor(Integer instructionId) { |
| | | return baseMapper.homeworkGuidebookEditor(instructionId); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.QueryWrappers; |
| | | import com.ruoyi.requier.dto.DeviceDto; |
| | | import com.ruoyi.requier.dto.ReservationDto; |
| | | import com.ruoyi.requier.mapper.DeviceMapper; |
| | | import com.ruoyi.requier.mapper.ReservationMapper; |
| | | import com.ruoyi.requier.pojo.Reservation; |
| | | import com.ruoyi.requier.service.DataConfigService; |
| | | import com.ruoyi.requier.service.ReservationService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * èµæºé¢å®æ°å»ºé¢å®è¡¨ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author baomidou |
| | | * @since 2024-09-14 |
| | | */ |
| | | @Service |
| | | public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reservation> implements ReservationService { |
| | | |
| | | @Autowired |
| | | private DeviceMapper deviceMapper; |
| | | |
| | | @Autowired |
| | | private ReservationMapper reservationMapper; |
| | | |
| | | @Autowired |
| | | private DataConfigService dataConfigService; |
| | | |
| | | @Override |
| | | public ArrayList<JSONObject> selectDeviceParameter(Page page, DeviceDto itemParameter, Boolean laboratoryNameIsNull, String starttime, String endtime) { |
| | | ArrayList<String> dateTextList = new ArrayList<>(); |
| | | if (StringUtils.isNoneEmpty(starttime)&&StringUtils.isNoneEmpty(endtime)){ |
| | | LocalDate startDate = LocalDate.parse(starttime, DateTimeFormatter.ISO_LOCAL_DATE); |
| | | LocalDate endDate = LocalDate.parse(endtime, DateTimeFormatter.ISO_LOCAL_DATE); |
| | | while (!startDate.isAfter(endDate)) { |
| | | dateTextList.add(startDate.toString()); |
| | | startDate = startDate.plusDays(1); |
| | | } |
| | | } |
| | | LambdaQueryWrapper<Reservation> lambdaQueryWrapper=new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.between(Reservation::getReservationTime,starttime,endtime); |
| | | List<Reservation> reservations = reservationMapper.selectList(lambdaQueryWrapper); |
| | | HashMap dates = new HashMap<String, Integer>(); |
| | | |
| | | Map<Integer, List<Reservation>> deviceIdcollect = reservations.stream().collect(Collectors.groupingBy(Reservation::getDeviceId)); |
| | | for (Integer deviceId : deviceIdcollect.keySet()) { |
| | | List<Reservation> deviceIdList = deviceIdcollect.get(deviceId); |
| | | Map<String, List<Reservation>> collect = deviceIdList.stream().collect(Collectors.groupingBy(Reservation::getReservationTime)); |
| | | for (String date : collect.keySet()) { |
| | | List<Reservation> reservations1 = collect.get(date); |
| | | Map<String, List<Reservation>> collect1 = reservations1.stream().collect(Collectors.groupingBy(Reservation::getSpecificTime)); |
| | | for (String s : collect1.keySet()) { |
| | | if (!(dates.containsKey(deviceId + date + s))) { |
| | | dates.put(deviceId + date + s, collect1.get(s).size()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | IPage<DeviceDto> iPage = deviceMapper.selectDeviceParameterPage(page, QueryWrappers.queryWrappers(itemParameter), laboratoryNameIsNull); |
| | | List<DeviceDto> records = iPage.getRecords(); |
| | | ArrayList<JSONObject> datas = new ArrayList<>(); |
| | | |
| | | String [] dateArrays={"09:00-12:00","13:00-18:00", "18:00-22:00"}; |
| | | for (DeviceDto record : records) { |
| | | for (int i = 0; i < dateArrays.length; i++) { |
| | | String dateArray = dateArrays[i]; |
| | | JSONObject temp = JSON.parseObject(JSON.toJSONString(record)); |
| | | temp.put("time", dateArray); |
| | | JSONArray dataArray = new JSONArray(); |
| | | for (String date : dateTextList) { |
| | | JSONObject dateObject = new JSONObject(); |
| | | dateObject.put("date", date); |
| | | dateObject.put("value", dates.containsKey(record.getId()+date + dateArray) ? dates.get(record.getId()+date + dateArray) : 0); |
| | | dataArray.add(dateObject); |
| | | } |
| | | temp.put("dateList", dataArray); |
| | | datas.add(temp); |
| | | } |
| | | } |
| | | return datas; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ReservationDto> selectReservationParameterPage(String deviceId, String reservationTime, String specificTime) { |
| | | return reservationMapper.selectReservationParameterPage(Integer.parseInt(deviceId), reservationTime, specificTime); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.requier.vo; |
| | | |
| | | import com.ruoyi.requier.pojo.OperationInstruction; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class OperationInstructionVo extends OperationInstruction { |
| | | @ApiModelProperty("管çç¼å·") |
| | | private String deviceNumber; |
| | | |
| | | @ApiModelProperty("åå·") |
| | | private String deviceModel; |
| | | |
| | | @ApiModelProperty("设å¤åç§°") |
| | | private String deviceName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.requier.mapper.DeviceFaultOneMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.requier.pojo.DeviceFaultOne"> |
| | | <id column="id" property="id" /> |
| | | <result column="device_id" property="deviceId" /> |
| | | <result column="process_number" property="processNumber" /> |
| | | <result column="measure_of_accuracy" property="measureOfAccuracy" /> |
| | | <result column="fault_situation" property="faultSituation" /> |
| | | <result column="file_name" property="fileName" /> |
| | | <result column="system_file_name" property="systemFileName" /> |
| | | <result column="submit_next_pesponsible" property="submitNextPesponsible" /> |
| | | <result column="submit_operating_personnel" property="submitOperatingPersonnel" /> |
| | | <result column="submit_date" property="submitDate" /> |
| | | <result column="method_cost" property="methodCost" /> |
| | | <result column="admin_audit_option" property="adminAuditOption" /> |
| | | <result column="admin_next_pesponsible" property="adminNextPesponsible" /> |
| | | <result column="admin_operating_personnel" property="adminOperatingPersonnel" /> |
| | | <result column="technical_audit_option" property="technicalAuditOption" /> |
| | | <result column="technical_next_pesponsible" property="technicalNextPesponsible" /> |
| | | <result column="technical_operating_personnel" property="technicalOperatingPersonnel" /> |
| | | <result column="technical_date" property="technicalDate" /> |
| | | <result column="maintain_situation" property="maintainSituation" /> |
| | | <result column="maintain_next_pesponsible" property="maintainNextPesponsible" /> |
| | | <result column="maintain_operating_personnel" property="maintainOperatingPersonnel" /> |
| | | <result column="maintain_date" property="maintainDate" /> |
| | | <result column="check_cal_situation" property="checkCalSituation" /> |
| | | <result column="after_maintenance_operating_personnel" property="afterMaintenanceOperatingPersonnel" /> |
| | | <result column="after_maintenance_date" property="afterMaintenanceDate" /> |
| | | <result column="current_status" property="currentState" /> |
| | | <result column="submit_person" property="submitPerson" /> |
| | | <result column="current_responsible" property="currentResponsible" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="deviceFaultOnePage" resultType="com.ruoyi.requier.dto.DeviceFaultOneDto"> |
| | | select dfo.*, |
| | | d.device_name, |
| | | d.management_number, |
| | | d.specification_model |
| | | from device_fault_one dfo |
| | | left join device d on d.id = dfo.device_id |
| | | where dfo.device_id = #{deviceId} |
| | | <if test="processNumber != '' and processNumber != null"> |
| | | and dfo.process_number like concat('%', #{processNumber}, '%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.requier.mapper.InstructionMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.requier.pojo.Instruction"> |
| | | <id column="id" property="id" /> |
| | | <result column="application_number" property="applicationNumber" /> |
| | | <result column="person_liable" property="personLiable" /> |
| | | <result column="controlled_application_description" property="controlledApplicationDescription" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | |
| | | <select id="pageByPageQueryOfHomeworkInstructions" resultType="com.ruoyi.requier.dto.OperationInstructionDto"> |
| | | SELECT |
| | | doi.*,di.*,d.device_name, d.management_number device_number, d.specification_model device_model, u.name uploader_name, u1.name approver_name |
| | | FROM |
| | | device_operation_instruction doi |
| | | LEFT JOIN device_instruction di ON di.id = doi.instruction_id |
| | | left join device d on d.id = doi.device_id |
| | | left join user u on u.id = doi.uploader |
| | | left join user u1 on u1.id = doi.approver_id |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.requier.mapper.OperationInstructionMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.requier.pojo.OperationInstruction"> |
| | | <id column="id" property="id" /> |
| | | <result column="device_id" property="deviceId" /> |
| | | <result column="document_number" property="documentNumber" /> |
| | | <result column="author" property="author" /> |
| | | <result column="system_file_name" property="systemFileName" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="create_user" property="createUser" /> |
| | | </resultMap> |
| | | |
| | | <select id="homeworkGuidebookEditor" resultType="com.ruoyi.requier.vo.OperationInstructionVo"> |
| | | SELECT |
| | | doi.*,d.device_name, d.management_number device_number, d.specification_model device_model |
| | | FROM |
| | | device_operation_instruction doi |
| | | left join device d on d.id = doi.device_id |
| | | where doi.instruction_id = #{instructionId} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.requier.mapper.ReservationMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.requier.pojo.Reservation"> |
| | | <id column="id" property="id" /> |
| | | <result column="device_id" property="deviceId" /> |
| | | <result column="device_name" property="deviceName" /> |
| | | <result column="customer_name" property="customerName" /> |
| | | <result column="reservation_time" property="reservationTime" /> |
| | | <result column="specific_time" property="specificTime" /> |
| | | <result column="link_person" property="linkPerson" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="device_number" property="deviceNumber" /> |
| | | <result column="reservation_specification" property="reservationSpecification" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_date" property="createDate" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectReservationParameterPage" resultType="com.ruoyi.requier.dto.ReservationDto"> |
| | | SELECT |
| | | a.id, |
| | | a.create_date, |
| | | a.create_user, |
| | | a.customer_name, |
| | | a.device_id, |
| | | a.device_name, |
| | | a.device_number, |
| | | a.link_person, |
| | | a.phone , |
| | | a.reservation_specification, |
| | | b.name |
| | | FROM |
| | | device_reservation a |
| | | INNER JOIN USER b ON a.create_user = b.id |
| | | where a.device_id = #{deviceId} and a.reservation_time = #{reservationTime} and a.specific_time=#{specificTime} |
| | | </select> |
| | | </mapper> |