| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.param.LightPoleHeelingProcessingParam; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | | * @date 2022/3/25 11:41 |
| | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class LightPoleHeelingProcessingServices extends BaseServiceImpl<LightPoleHeelingProcessingMapper, LightPoleHeelingProcessing> { |
| | | private final LightPoleHeelingProcessingMapper lightPoleHeelingProcessingMapper; |
| | | |
| | | /** |
| | | * 灯杆倾斜警告处理 |
| | | */ |
| | | public boolean ProcessingLightPoleHeeling(LightPoleHeelingProcessingParam param) { |
| | | public String ProcessingLightPoleHeeling(LightPoleHeelingProcessingParam param) { |
| | | LightPoleHeelingService lightPoleHeelingService = SpringContextHolder.getBean(LightPoleHeelingService.class); |
| | | |
| | | LightPoleHeeling one = SpringContextHolder.getBean(LightPoleHeelingMapper.class). |
| | |
| | | lightPoleHeelingProcessing.setTheXAxisOld(one.getTheXAxis()); |
| | | lightPoleHeelingProcessing.setTheYAxisOld(one.getTheYAxis()); |
| | | lightPoleHeelingProcessing.setTheZAxisOld(one.getTheZAxis()); |
| | | lightPoleHeelingProcessing.setMac(one.getMac()); |
| | | lightPoleHeelingProcessing.setWarningLevelOld(one.getWarningLevel()); |
| | | |
| | | //警告等级 |
| | |
| | | //正常 |
| | | lightPoleHeelingProcessing.setWarningLevel(0); |
| | | } |
| | | boolean save = save(lightPoleHeelingProcessing); |
| | | if (save) { |
| | | //设置为已处理 |
| | | one.setProcessingState(1); |
| | | lightPoleHeelingService.updateById(one); |
| | | boolean save = false; |
| | | |
| | | try { |
| | | save = save(lightPoleHeelingProcessing); |
| | | if (save) { |
| | | //设置为已处理 |
| | | one.setProcessingState(1); |
| | | lightPoleHeelingService.updateById(one); |
| | | return "灯杆倾斜处理成功!"; |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("异常"); |
| | | } |
| | | return save; |
| | | throw new BusinessException("灯杆倾斜处理失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 灯杆倾斜处理警告详情 |
| | | * |
| | | * @param processingNumber |
| | | * @return |
| | | */ |
| | | public LightPoleHeelingProcessing processingDetail(Long processingNumber) { |
| | | if (processingNumber == null) { |
| | | throw new BusinessException("灯杆倾斜警告处理ID不能为空!"); |
| | | } |
| | | LightPoleHeelingProcessing bean = lightPoleHeelingProcessingMapper.processingDetail(SecurityUtils.getClientId(), processingNumber); |
| | | if (bean == null) { |
| | | throw new BusinessException("处理后的灯杆倾斜数据不存在!"); |
| | | } |
| | | return bean; |
| | | } |
| | | |
| | | /** |
| | | * 灯杆倾斜处理警告详情 |
| | | * |
| | | * @param keyword keyword |
| | | * @return |
| | | */ |
| | | public List<LightPoleHeelingProcessing> processingDetailList(BaseConditionVO baseConditionVO, String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | List<LightPoleHeelingProcessing> list = lightPoleHeelingProcessingMapper.processingDetailList(SecurityUtils.getClientId(), keyword); |
| | | |
| | | return list; |
| | | } |
| | | } |