| | |
| | | package com.gkhy.safePlatform.equipment.service.baseService.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.safePlatform.commons.enums.ResultCodes; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailBO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailCountDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDetailInfoDO; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.enums.IssueReceiptEnum; |
| | | import com.gkhy.safePlatform.equipment.enums.ValidStatusEnum; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMatetrialDetailQuery; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.db.SafeMaterialDetailDBQuery; |
| | | import com.gkhy.safePlatform.equipment.repository.SafeMaterialDetailInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialDetailInfoService; |
| | | import jodd.util.StringUtil; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteBatch(Long[] ids) { |
| | | if(ids.length == 0){ |
| | | public void deleteBatch(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | repository.deleteBatch(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateDeliveryStatusByIds(SafeMaterialDetailBO detailBO) { |
| | | if(CollectionUtils.isEmpty(detailBO.getIds()) || null == detailBO.getClaimantId() || StringUtil.isBlank(detailBO.getClaimantName())){ |
| | | public void updateDeliveryStatusByIds(SafeMaterialBatchDeliveryBO detailBO) { |
| | | if(CollectionUtils.isEmpty(detailBO.getIds()) || null == detailBO.getReceiveUid() || StringUtil.isBlank(detailBO.getReceiveUname())){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | detailBO.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode()); |
| | | detailBO.setDeliveryTime(LocalDateTime.now()); |
| | | repository.updateDeliveryStatusByIds(detailBO); |
| | | } |
| | | |
| | | @Override |
| | | public void deliveryBatchRandom(SafeMaterialDetailBO detailBO) { |
| | | if(null == detailBO.getCount() || null == detailBO.getClaimantId() || StringUtil.isBlank(detailBO.getClaimantName())){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | detailBO.setIrStatus(IssueReceiptEnum.OUT_OF_LIBRARY.getCode()); |
| | | detailBO.setDeliveryTime(LocalDateTime.now()); |
| | | repository.deliveryBatchRandom(detailBO); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfoDO> listByPage(Page<SafeMaterialDetailInfo> page, SafeMatetrialDetailQuery query) { |
| | | public List<SafeMaterialDetailInfoDO> listByPage(Page<SafeMaterialDetailInfo> page, SafeMaterialDetailDBQuery query) { |
| | | |
| | | return repository.listByCondition(page,query); |
| | | } |
| | |
| | | repository.updateValidStatus(id,ValidStatusEnum.NO.getCode()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getRfidNotNullList(Integer count,Long smId) { |
| | | if(null == count || null == smId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getRfidNotNullList(count,smId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getRfidNullList(Integer count,Long smId) { |
| | | if(null == count || null == smId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getRfidNullList(count,smId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getIdListByRfid(Integer count, Long smId, String rfid) { |
| | | return repository.getIdListByRfid(count,smId,rfid); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialClassifyStockDO> getSmallClassifyStockByIds(List<Long> smallClassifyIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds) ){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getSmallClassifyStockByIds(smallClassifyIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailDO> getListBySmallClassifyIds(List<Long> smallClassifyIds,List<Long> depIds) { |
| | | if(CollectionUtils.isEmpty(smallClassifyIds) || CollectionUtils.isEmpty(depIds)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getListBySmallClassifyIds(smallClassifyIds,depIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfoDO> getListByRfids(List<String> rfids) { |
| | | if(CollectionUtils.isEmpty(rfids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | return repository.getListByRfids(rfids); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfo> getUnValidList() { |
| | | return repository.getUnValidList(ValidStatusEnum.YES.getCode()); |
| | | } |
| | | |
| | | @Override |
| | | public void updateValidStatusByIds(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | repository.updateValidStatusByIds(ids,ValidStatusEnum.NO.getCode()); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfo> getListBySmIdAndRfid(SafeMaterialDetailDBQuery query) { |
| | | List<SafeMaterialDetailInfo> list = repository.getListBySmIdAndRfid(query); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialDetailInfo> getListBySmId(SafeMaterialDetailDBQuery query) { |
| | | List<SafeMaterialDetailInfo> list = repository.getListBySmId(query); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public void updateBatch(List<SafeMaterialDetailInfo> list) { |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | repository.updateBatch(list); |
| | | } |
| | | |
| | | |
| | | } |