| | |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.commons.query.PageQuery; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | import com.gkhy.safePlatform.commons.utils.PageUtils; |
| | | import com.gkhy.safePlatform.commons.vo.ResultVO; |
| | | import com.gkhy.safePlatform.commons.vo.SearchResultVO; |
| | | import com.gkhy.safePlatform.equipment.entity.EquipmentTypeMng; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.EquipmentTypeMngQueryCriteria; |
| | | import com.gkhy.safePlatform.equipment.model.dto.resp.EquipmentTypeMngDto; |
| | | import com.gkhy.safePlatform.equipment.repository.EquipmentTypeMngRepository; |
| | | import com.gkhy.safePlatform.equipment.service.EquipmentTypeMngService; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.EquipmentTypeMngBaseService; |
| | | import com.gkhy.safePlatform.equipment.utils.QueryHelpPlus; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | * @since 2022-07-19 08:35:02 |
| | | */ |
| | | @Service("equipmentTypeMngService") |
| | | public class EquipmentTypeMngServiceImpl extends ServiceImpl<EquipmentTypeMngRepository, EquipmentTypeMng> implements EquipmentTypeMngService { |
| | | public class EquipmentTypeMngServiceImpl implements EquipmentTypeMngService { |
| | | |
| | | @Autowired |
| | | private EquipmentTypeMngRepository equipmentTypeMngRepository; |
| | | private EquipmentTypeMngBaseService equipmentTypeMngBaseService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultVO queryAll(PageQuery<EquipmentTypeMngQueryCriteria> pageQuery) { |
| | | PageUtils.checkCheck(pageQuery); |
| | | |
| | | Long pageIndex = pageQuery.getPageIndex(); |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | Page<EquipmentTypeMng> page = new Page<>(pageIndex, pageSize); |
| | | page.addOrder(OrderItem.asc("sort_num")); |
| | | |
| | | page = baseMapper.selectPage(page, |
| | | page = equipmentTypeMngBaseService.selectPage(page, |
| | | QueryHelpPlus.getPredicate(EquipmentTypeMng.class, pageQuery.getSearchParams())); |
| | | List<EquipmentTypeMngDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), EquipmentTypeMngDto.class); |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<EquipmentTypeMng> queryAll(EquipmentTypeMngQueryCriteria criteria) { |
| | | return baseMapper.selectList(QueryHelpPlus.getPredicate(EquipmentTypeMng.class, criteria).orderBy(true,true,"sort_num")); |
| | | return equipmentTypeMngBaseService.queryAll(criteria); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return rsList; |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Long[] ids) { |
| | | if(ids == null){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_ILLEGAL); |
| | | } |
| | | List<Long> idList = Arrays.asList(ids); |
| | | |
| | | List<EquipmentTypeMng> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | EquipmentTypeMng info = new EquipmentTypeMng(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | equipmentTypeMngBaseService.updateBatchById(delList); |
| | | } |
| | | } |