| | |
| | | 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.commons.utils.StringUtils; |
| | | 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; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |