| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.account.rpc.apimodel.AccountDepartmentService; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.enums.EquipmentResultCodes; |
| | | import com.gkhy.safePlatform.equipment.enums.KeypointEquipmentPartTypeEnum; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.*; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.KeypointEquipmentInfoExcel; |
| | |
| | | |
| | | @Autowired |
| | | public HttpServletResponse response; |
| | | |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<KeypointEquipmentInfoQueryCriteria> pageQuery) { |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | |
| | | |
| | | @Override |
| | | public void addOrUpdate(KeypointEquipmentInfoDto infoDto) { |
| | | |
| | | // 验证枚举 |
| | | checkEnum(infoDto); |
| | | |
| | | KeypointEquipmentInfo equipmentInfo = BeanCopyUtils.copyBean(infoDto, KeypointEquipmentInfo.class); |
| | | //保存主数据 |
| | | if (infoDto.getId() == null) { //新增 |
| | |
| | | ExcelUtil.exportExcel(map,respList , response.getOutputStream(),DateUtils.PATTERN_STANDARD); |
| | | response.getOutputStream().close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 枚举验证 |
| | | * @param infoDto |
| | | */ |
| | | public void checkEnum(KeypointEquipmentInfoDto infoDto){ |
| | | if (KeypointEquipmentPartTypeEnum.getByCode(infoDto.getPartType()) == null) { |
| | | throw new EquipmentException(EquipmentResultCodes.KEYPOINT_EQUIPMENT_ENUM_PART_TYPE_NOT_EXIST); |
| | | } |
| | | } |
| | | } |