| | |
| | | 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.SafeMaterialCountDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialDO; |
| | | import com.gkhy.safePlatform.equipment.entity.SafeMaterialInfo; |
| | | import com.gkhy.safePlatform.equipment.entity.*; |
| | | import com.gkhy.safePlatform.equipment.excepiton.EquipmentException; |
| | | import com.gkhy.safePlatform.equipment.model.dto.req.SafeMaterialQuery; |
| | | import com.gkhy.safePlatform.equipment.repository.SafeMaterialInfoRepository; |
| | | import com.gkhy.safePlatform.equipment.service.baseService.SafeMaterialInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public SafeMaterialInfo queryById(Long id) { |
| | | public SafeMaterialDO queryById(Long id) { |
| | | if(null == id){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | SafeMaterialInfo safeMaterialInfo = repository.selectOne(new LambdaQueryWrapper<SafeMaterialInfo>() |
| | | .eq(SafeMaterialInfo::getId, id) |
| | | .eq(SafeMaterialInfo::getDelFlag, 0) |
| | | ); |
| | | return safeMaterialInfo; |
| | | return repository.queryById(id); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return flag; |
| | | } |
| | | |
| | | @Override |
| | | public void updateCountById(SafeMaterialBO safeMaterialBO) { |
| | | if(null == safeMaterialBO){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | repository.updateCountById(safeMaterialBO); |
| | | } |
| | | |
| | | @Override |
| | | public List<SafeMaterialInfo> listByDepId(Long depId) { |
| | | if(null == depId){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | List<SafeMaterialInfo> safeMaterialInfoList = repository.selectList(new LambdaQueryWrapper<SafeMaterialInfo>() |
| | | .eq(SafeMaterialInfo::getDelFlag, 0) |
| | | .eq(SafeMaterialInfo::getDepId, depId)); |
| | | return safeMaterialInfoList; |
| | | } |
| | | |
| | | @Override |
| | | public void updateStockCount(List<SafeMaterialBO> safeMaterialBOList) { |
| | | if(CollectionUtils.isEmpty(safeMaterialBOList)){ |
| | | throw new EquipmentException(ResultCodes.CLIENT_PARAM_NULL); |
| | | } |
| | | repository.updateStockCount(safeMaterialBOList); |
| | | } |
| | | |
| | | |
| | | } |