| | |
| | | import com.sandu.ximon.dao.domain.LightTaskPoleRelation; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.DeviceRespStatusEnums; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.LightTaskMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return "编辑成功"; |
| | | } else if (newPoleSuccess.isEmpty() && oldPoleSuccess.isEmpty() && closePoleSuccess.isEmpty()) { |
| | | throw new BusinessException("编辑失败"); |
| | | } else if (!closePoleFail.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | } else if (!closePoleFail.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | return "原任务中存在下发异常,原任务保留,创建新任务进行保存"; |
| | | } else if (!newPoleFail.isEmpty()) { |
| | | return "新任务中存在下发异常,忽略异常操作的灯杆"; |
| | | }else { |
| | | } else { |
| | | return "操作异常"; |
| | | } |
| | | } |
| | |
| | | return Optional.ofNullable(responseCommonFrame).map(WrapResponseCommonFrame::getResponseInnerFrame).orElse(null); |
| | | } |
| | | |
| | | public List<LightTaskDto> listLightTask(BaseConditionVO conditionVO, String keyword) { |
| | | public List<LightTaskDto> listLightTask(BaseConditionVO conditionVO, String keyword, Integer order, Integer seq) { |
| | | LambdaQueryWrapper<LightTask> wrapper = Wrappers.lambdaQuery(LightTask.class); |
| | | if (StrUtil.isNotBlank(keyword)) { |
| | | wrapper.like(LightTask::getTaskName, keyword); |
| | |
| | | }); |
| | | } |
| | | |
| | | if (conditionVO != null) { |
| | | PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize()); |
| | | //排序字段 |
| | | String orderByResult = "task_id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.LIGHT_TASK_UPDATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize(), orderBy); |
| | | List<LightTask> list = list(wrapper); |
| | | |
| | | Page<LightTaskDto> page = new Page<>(); |