| | |
| | | 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.device.dto.DeviceExaminePlanDetailsDto; |
| | | import com.ruoyi.device.dto.DeviceExaminePlanDto; |
| | | import com.ruoyi.device.dto.DeviceExamineRecordContrastDto; |
| | | import com.ruoyi.device.dto.DeviceExamineRecordDto; |
| | |
| | | */ |
| | | @ApiOperation(value = "设备核查计划详情列表") |
| | | @GetMapping("/pageDeviceExaminePlanDetail") |
| | | public Result<IPage<DeviceExaminePlanDetails>> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails deviceExaminePlanDetails) { |
| | | public Result<IPage<DeviceExaminePlanDetailsDto>> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails deviceExaminePlanDetails) { |
| | | return Result.success(deviceExaminePlanService.pageDeviceExaminePlanDetail(page, deviceExaminePlanDetails)); |
| | | } |
| | | |
| | |
| | | public class DeviceExaminePlanDetailsDto extends DeviceExaminePlanDetails { |
| | | @ApiModelProperty("序号") |
| | | private Integer index; |
| | | |
| | | @ApiModelProperty("记录状态, 0: 未开始, 1:待批准, 2:通过, 3:不通过") |
| | | private Integer recordStatus; |
| | | |
| | | @ApiModelProperty("对比状态, 0: 未开始, 1:待批准, 2:通过, 3:不通过") |
| | | private Integer recordContrastStatus; |
| | | |
| | | } |
| | |
| | | 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.device.dto.DeviceExaminePlanDetailsDto; |
| | | import com.ruoyi.device.pojo.DeviceExaminePlanDetails; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @param ew |
| | | * @return |
| | | */ |
| | | IPage<DeviceExaminePlanDetails> pageDeviceExaminePlanDetail(Page page, @Param("ew") QueryWrapper<DeviceExaminePlanDetails> ew); |
| | | IPage<DeviceExaminePlanDetailsDto> pageDeviceExaminePlanDetail(Page page, @Param("ew") QueryWrapper<DeviceExaminePlanDetails> ew); |
| | | } |
| | |
| | | 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.device.dto.DeviceExaminePlanDetailsDto; |
| | | import com.ruoyi.device.dto.DeviceExaminePlanDto; |
| | | import com.ruoyi.device.pojo.DeviceExaminePlan; |
| | | import com.ruoyi.device.pojo.DeviceExaminePlanDetails; |
| | |
| | | * @param DeviceExaminePlanDetails |
| | | * @return |
| | | */ |
| | | IPage<DeviceExaminePlanDetails> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails DeviceExaminePlanDetails); |
| | | IPage<DeviceExaminePlanDetailsDto> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails DeviceExaminePlanDetails); |
| | | |
| | | |
| | | /** |
| | |
| | | deviceCalibrationPlanDto.setRatifyTimeStr(deviceCalibrationPlan.getRatifyTime() == null ? null : deviceCalibrationPlan.getRatifyTime().format(formatter)); |
| | | |
| | | // 查询设备校准计划详情 |
| | | List<DeviceCalibrationPlanDetail> deviceCalibrationPlanDetailList = deviceCalibrationPlanDetailMapper.selectList(Wrappers.<DeviceCalibrationPlanDetail>lambdaQuery().eq(DeviceCalibrationPlanDetail::getPlanId, deviceCalibrationPlanId)); |
| | | List<DeviceCalibrationPlanDetail> deviceCalibrationPlanDetailList = deviceCalibrationPlanDetailMapper.selectList(Wrappers.<DeviceCalibrationPlanDetail>lambdaQuery() |
| | | .eq(DeviceCalibrationPlanDetail::getPlanId, deviceCalibrationPlanId) |
| | | .orderByAsc(DeviceCalibrationPlanDetail::getPlanDate)); |
| | | // 设置序号 和 时间 |
| | | ArrayList<DeviceCalibrationPlanDetailDto> deviceCalibrationPlanDetailDtoList = new ArrayList<>(); |
| | | deviceCalibrationPlanDetailList.forEach(deviceCalibrationPlanDetail -> { |
| | | DeviceCalibrationPlanDetailDto deviceCalibrationPlanDetailDto = new DeviceCalibrationPlanDetailDto(); |
| | | BeanUtils.copyProperties(deviceCalibrationPlanDetail, deviceCalibrationPlanDetailDto); |
| | | deviceCalibrationPlanDetailDto.setIndex(deviceCalibrationPlanDetailList.indexOf(deviceCalibrationPlanDetail) + 1); |
| | | deviceCalibrationPlanDetailDto.setLastDateStr((deviceCalibrationPlanDetail.getLastDate().format(formatter))); |
| | | deviceCalibrationPlanDetailDto.setPlanDateStr((deviceCalibrationPlanDetail.getPlanDate().format(formatter))); |
| | | deviceCalibrationPlanDetailDto.setLastDateStr(deviceCalibrationPlanDetail.getLastDate() == null ? null : deviceCalibrationPlanDetail.getLastDate().format(formatter)); |
| | | deviceCalibrationPlanDetailDto.setPlanDateStr(deviceCalibrationPlanDetail.getPlanDate() == null ? null : deviceCalibrationPlanDetail.getPlanDate().format(formatter)); |
| | | deviceCalibrationPlanDetailDtoList.add(deviceCalibrationPlanDetailDto); |
| | | }); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<DeviceExaminePlanDetails> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails deviceExaminePlanDetails) { |
| | | public IPage<DeviceExaminePlanDetailsDto> pageDeviceExaminePlanDetail(Page page, DeviceExaminePlanDetails deviceExaminePlanDetails) { |
| | | if (deviceExaminePlanDetails.getPlanId() == null) { |
| | | return new Page(); |
| | | } |
| | |
| | | DeviceExaminePlanDto deviceExaminePlanDto = baseMapper.selectExamineExaminePlanDto(deviceExaminePlanId); |
| | | |
| | | // 查询设备核查计划详情 |
| | | List<DeviceExaminePlanDetails> deviceExaminePlanDetailsList = deviceExaminePlanDetailsMapper.selectList(Wrappers.<DeviceExaminePlanDetails>lambdaQuery().eq(DeviceExaminePlanDetails::getPlanId, deviceExaminePlanId)); |
| | | List<DeviceExaminePlanDetails> deviceExaminePlanDetailsList = deviceExaminePlanDetailsMapper.selectList(Wrappers.<DeviceExaminePlanDetails>lambdaQuery().eq(DeviceExaminePlanDetails::getPlanId, deviceExaminePlanId) |
| | | .orderByAsc(DeviceExaminePlanDetails::getCheckTime)); |
| | | // 设置序号 |
| | | ArrayList<DeviceExaminePlanDetailsDto> deviceExaminePlanDetailsDtoList = new ArrayList<>(); |
| | | deviceExaminePlanDetailsList.forEach(deviceExamineRecordContrastDetail -> { |
| | |
| | | endTime = deviceRecord.getUseEndDate().format(formatter); |
| | | String[] startTimeSplit = startTime.split(" "); |
| | | String[] endTimeSplit = endTime.split(" "); |
| | | startTime = startTimeSplit[1]; |
| | | if (startTimeSplit[0].equals(endTimeSplit[0])) { |
| | | startTime = startTimeSplit[1]; |
| | | endTime = endTimeSplit[1]; |
| | | } else { |
| | | endTime = endTimeSplit[0] + '\n' + endTimeSplit[1]; |
| | | startTime = startTimeSplit[0] + '\n' + startTimeSplit[1]; |
| | | } |
| | | DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy.M.d"); |
| | | operationDate = deviceRecord.getUseStartDate().format(formatter2); |
| | |
| | | |
| | | |
| | | <!--设备核查计划详情列表--> |
| | | <select id="pageDeviceExaminePlanDetail" resultType="com.ruoyi.device.pojo.DeviceExaminePlanDetails"> |
| | | <select id="pageDeviceExaminePlanDetail" resultType="com.ruoyi.device.dto.DeviceExaminePlanDetailsDto"> |
| | | select * from ( |
| | | select * |
| | | from device_examine_plan_details |
| | | select d.*, |
| | | CASE |
| | | WHEN dc.review_status = 0 THEN 3 |
| | | WHEN dc.review_status = 1 THEN 2 |
| | | WHEN dc.record_id IS NOT NULL THEN 1 |
| | | ELSE 0 END record_status, |
| | | CASE |
| | | WHEN dd.review_status = 0 THEN 3 |
| | | WHEN dd.review_status = 1 THEN 2 |
| | | WHEN dd.record_contrast_id IS NOT NULL THEN 1 |
| | | ELSE 0 END record_contrast_status |
| | | from device_examine_plan_details d |
| | | left join device_examine_record dc on d.plan_details_id = dc.plan_details_id |
| | | left join device_examine_record_contrast dd on dd.plan_details_id = dc.plan_details_id |
| | | order by check_time asc |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | |
| | | and dr.device_id = #{deviceId} |
| | | </if> |
| | | <if test="exportDate != '' and exportDate != null"> |
| | | and DATE_FORMAT(dr.use_start_date, '%Y-%m') = #{exportDate}; |
| | | and DATE_FORMAT(dr.use_start_date, '%Y-%m') = #{exportDate} |
| | | </if> |
| | | ORDER BY dr.use_start_date asc |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "确认 人员能力") |
| | | @GetMapping("confirmPersonnelCapability") |
| | | public Result<?> confirmPersonnelCapability(@RequestParam("id") Integer id) { |
| | | @PostMapping("confirmPersonnelCapability") |
| | | public Result<?> confirmPersonnelCapability(@RequestBody PersonPersonnelCapacity personPersonnelCapacity) { |
| | | Integer userId = SecurityUtils.getUserId().intValue(); |
| | | personPersonnelCapacityService.update(Wrappers.<PersonPersonnelCapacity>lambdaUpdate() |
| | | .eq(PersonPersonnelCapacity::getId, id) |
| | | .eq(PersonPersonnelCapacity::getId, personPersonnelCapacity.getId()) |
| | | .set(PersonPersonnelCapacity::getConfirmOperatingPersonnelId, userId) |
| | | .set(PersonPersonnelCapacity::getConfirmDate, LocalDateTime.now())); |
| | | .set(PersonPersonnelCapacity::getConfirmDate, personPersonnelCapacity.getConfirmDate())); |
| | | return Result.success(); |
| | | } |
| | | |
| | |
| | | * @param trainingDate |
| | | * @return |
| | | */ |
| | | List<TrainingRecordPersonDetailedDto> selectPersonDetailedDtosByTrainingDate(Integer userId, Integer year); |
| | | List<TrainingRecordPersonDetailedDto> selectPersonDetailedDtosByTrainingDate(@Param("userId") Integer userId, @Param("year") Integer year); |
| | | } |
| | |
| | | dl.name depart_lims_name, |
| | | cpbi.professional_title, |
| | | cpbi.official_academic_redentials, |
| | | cpbi.unit_time, |
| | | cpbi.major1, |
| | | u.id user_id, |
| | | DATE_FORMAT(cpbi.unit_time, '%Y-%m-%d') AS unitTimeSting |
| | | DATE_FORMAT(cpbi.group_time, '%Y-%m-%d') AS unitTimeSting |
| | | from user u |
| | | left join cnas_person_basic_info cpbi on cpbi.user_id = u.id |
| | | left join department_lims dl on dl.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u.depart_lims_id, ',', -2), ',', 1) |
| | |
| | | and cptr.user_id = #{userId} |
| | | <where> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%')} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | and cptr.user_id = #{userId} |
| | | </if> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | cptd.class_hour, |
| | | cptr.examination_results, |
| | | cptd.remarks, |
| | | DATE_FORMAT(cptd.training_date, '%Y-%m-%d') AS trainingDateString |
| | | cptd.training_date AS trainingDateString |
| | | from cnas_person_training_record cptr |
| | | inner join cnas_person_training_detailed cptd on cptd.id = cptr.course_id |
| | | and cptr.user_id = #{userId} |
| | | <where> |
| | | <if test="year!= null and year!= ''"> |
| | | and YEAR(cptd.training_date) = ${year} |
| | | and cptd.training_date like concat('%', #{year}, '%') |
| | | </if> |
| | | </where> |
| | | order by STR_TO_DATE(CONCAT(cptd.training_date, '.01'), '%Y.%m.%d') |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "消息通知-点击详情触发修改状态为已读") |
| | | @PostMapping("triggerModificationStatusToRead/{id}") |
| | | public Result<?> triggerModificationStatusToRead(@PathVariable("id") Integer id) { |
| | | @PostMapping("triggerModificationStatusToRead") |
| | | public Result<?> triggerModificationStatusToRead(@RequestBody Map<String, Integer> params) { |
| | | Integer id = params.get("id"); |
| | | informationNotificationService.triggerModificationStatusToRead(id); |
| | | return Result.success(); |
| | | } |
| | |
| | | left join user u on i.sender_id = u.id |
| | | left join user u2 on u2.id = i.consignee_id |
| | | where i.consignee_id = #{userId} |
| | | and i.view_status = false |
| | | order by i.create_time desc |
| | | </select> |
| | | |