| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.targetDuty.excepiton.TargetDutyException; |
| | | import com.gkhy.safePlatform.targetDuty.repository.TargetDutyfileInfoRepository; |
| | | import com.gkhy.safePlatform.targetDuty.entity.TargetDutyfileInfo; |
| | | import com.gkhy.safePlatform.targetDuty.service.TargetDutyfileInfoService; |
| | | import com.gkhy.safePlatform.targetDuty.service.baseService.TargetDutyfileInfoBaseService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | |
| | | import com.gkhy.safePlatform.targetDuty.utils.QueryHelpPlus; |
| | | import com.gkhy.safePlatform.commons.utils.BeanCopyUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @since 2022-07-21 10:07:54 |
| | | */ |
| | | @Service("targetDutyfileInfoService") |
| | | public class TargetDutyfileInfoServiceImpl extends ServiceImpl<TargetDutyfileInfoRepository, TargetDutyfileInfo> implements TargetDutyfileInfoService { |
| | | public class TargetDutyfileInfoServiceImpl implements TargetDutyfileInfoService { |
| | | |
| | | @Autowired |
| | | private TargetDutyfileInfoRepository targetDutyfileInfoRepository; |
| | | private TargetDutyfileInfoBaseService targetDutyfileInfoBaseService; |
| | | |
| | | |
| | | |
| | |
| | | Long pageSize = pageQuery.getPageSize(); |
| | | IPage<TargetDutyfileInfo> page = new Page<>(pageIndex, pageSize); |
| | | |
| | | page = baseMapper.selectPage(page, |
| | | page = targetDutyfileInfoBaseService.selectPage(page, |
| | | QueryHelpPlus.getPredicate(TargetDutyfileInfo.class, pageQuery.getSearchParams())); |
| | | List<TargetDutyfileInfoDto> respList = BeanCopyUtils.copyBeanList(page.getRecords(), TargetDutyfileInfoDto.class); |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<TargetDutyfileInfo> queryAll(TargetDutyfileInfoQueryCriteria criteria) { |
| | | return baseMapper.selectList(QueryHelpPlus.getPredicate(TargetDutyfileInfo.class, criteria)); |
| | | return targetDutyfileInfoBaseService.queryAll(criteria); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Long[] ids) { |
| | | if(ids == null){ |
| | | throw new TargetDutyException(ResultCodes.CLIENT_PARAM_ILLEGAL); |
| | | } |
| | | List<Long> idList = Arrays.asList(ids); |
| | | |
| | | List<TargetDutyfileInfo> delList = new ArrayList<>(); |
| | | idList.forEach(f->{ |
| | | TargetDutyfileInfo info = new TargetDutyfileInfo(); |
| | | info.setDelFlag(1); |
| | | info.setId(f); |
| | | delList.add(info); |
| | | }); |
| | | targetDutyfileInfoBaseService.updateBatchById(delList); |
| | | } |
| | | } |