|
|
|
@ -1,11 +1,17 @@
|
|
|
|
|
package ${basePackage}.module.system.mgr;
|
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import ${basePackage}.frame.auth.Token;
|
|
|
|
|
import ${basePackage}.frame.base.ErrorType;
|
|
|
|
|
import ${basePackage}.frame.base.SortType;
|
|
|
|
|
import ${basePackage}.frame.utils.IDgenerator;
|
|
|
|
|
import ${basePackage}.frame.utils.Message;
|
|
|
|
|
import ${basePackage}.frame.base.ErrorType;
|
|
|
|
|
import ${basePackage}.frame.auth.Token;
|
|
|
|
|
import ${basePackage}.frame.utils.MapperUtil;
|
|
|
|
|
import ${basePackage}.frame.utils.Message;
|
|
|
|
|
import ${basePackage}.frame.utils.ValidationUtil;
|
|
|
|
|
import ${basePackage}.module.system.ent.Res;
|
|
|
|
|
import ${basePackage}.module.system.ent.ResTree;
|
|
|
|
@ -14,20 +20,16 @@ import ${basePackage}.module.system.req.ResCreateRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResDeleteRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResFindRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResGetRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResLoadRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResTreeRequest;
|
|
|
|
|
import ${basePackage}.module.system.req.ResUpdateRequest;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResCreateResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResDeleteResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResFindResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResGetResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResLoadResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResTreeResponse;
|
|
|
|
|
import ${basePackage}.module.system.rsp.ResUpdateResponse;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
@ -169,6 +171,29 @@ public class ResManagerImpl implements ResManager {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResLoadResponse load(ResLoadRequest request, Token token) {
|
|
|
|
|
ResLoadResponse response = new ResLoadResponse();
|
|
|
|
|
|
|
|
|
|
ValidationUtil.validate(request, response);
|
|
|
|
|
if (response.hasError()) {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (request.getPageSize() != 0) {
|
|
|
|
|
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
|
|
|
|
}
|
|
|
|
|
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
|
|
|
|
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
|
|
|
|
}
|
|
|
|
|
PageInfo<Res> pageInfo = new PageInfo<>(resMapper.load(request, token));
|
|
|
|
|
|
|
|
|
|
response.setResult(pageInfo.getList());
|
|
|
|
|
response.setTotalCount(pageInfo.getTotal());
|
|
|
|
|
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获得对象
|
|
|
|
|
*
|
|
|
|
|