src/main/java/com/ken/wms/common/service/Impl/DedicatedMaterialServiceImpl.java
(开头部分) 8KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.ken.wms.common.service.Impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ken.wms.common.service.Interface.DedicatedMaterialService;
import com.ken.wms.common.service.Interface.EmailService;
import com.ken.wms.dao.DedicatedMaterialMapper;
import com.ken.wms.dao.EmailMapper;
import com.ken.wms.domain.DedicatedMaterial;
import com.ken.wms.domain.Email;
import com.ken.wms.exception.StorageManageServiceException;
import org.apache.ibatis.exceptions.PersistenceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 专用物资
*/
@Service
public class DedicatedMaterialServiceImpl implements DedicatedMaterialService {
@Autowired
private DedicatedMaterialMapper mapper;
@Override
public Map<String, Object> selectAllByDedicatedMaterial(int offset, int limit) throws StorageManageServiceException {
// 初始化结果集
Map<String, Object> resultSet = new HashMap<>();
List<DedicatedMaterial> storageList;
long total = 0;
boolean isPagination = true;
// validate
if (offset < 0 || limit < 0)
isPagination = false;
// query
try {
if (isPagination) {
PageHelper.offsetPage(offset, limit);
storageList = mapper.selectAllByDedicatedMaterial();
if (storageList != null) {
PageInfo<DedicatedMaterial> pageInfo = new PageInfo<>(storageList);
total = pageInfo.getTotal();
} else
storageList = new ArrayList<>();
} else {
storageList = mapper.selectAllByDedicatedMaterial();
if (storageList != null)
total = storageList.size();
else
storageList = new ArrayList<>();
}
} catch (PersistenceException e) {
throw new StorageManageServiceException(e);
}
后面还有 141 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
