Commit 8bc9f697 authored by 郑建's avatar 郑建

6.6-2

parent 1d91481a
......@@ -41,7 +41,7 @@ public interface IApprovalLogService {
* @return
*/
public Map<String, Object> getApprovalLogs(String targetName, Integer auditStatus, Integer auditType, Integer auditTarget,
String applyStartTime, String applyEndTime, String user, Integer pageNum, Integer pageSize,Integer sortMode);
String applyStartTime, String applyEndTime, String user, Integer pageNum, Integer pageSize);
List<Long> getFundConfigIds(String channel);
......
......@@ -59,15 +59,9 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{
@Override
public Map<String, Object> getApprovalLogs(String targetName, Integer auditStatus, Integer auditType,
Integer auditTarget, String applyStartTime, String applyEndTime, String user, Integer pageNum,
Integer pageSize,Integer sortMode) {
Integer pageSize) {
// 分页条件
Pageable pageable;
if (sortMode == 1){
Sort sort = new Sort(Sort.Direction.ASC,"audit_status").and(new Sort(Sort.Direction.DESC,"audit_time"));
pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize, sort);
}else {
pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize);
}
Pageable pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize);
Specification<ApprovalLog> specification = new Specification<ApprovalLog>() {
@Override
public Predicate toPredicate(Root<ApprovalLog> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
......@@ -76,10 +70,6 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{
predicatesAnd.add(cb.equal(root.get("enable"), true));
if(auditStatus != null){
predicatesAnd.add(cb.equal(root.get("auditStatus"), auditStatus));
}else {
if (sortMode == 1){
predicatesAnd.add(cb.in(root.get("auditStatus")).value(0).value(1));
}
}
if(auditType != null){
predicatesAnd.add(cb.equal(root.get("auditType"), auditType));
......
......@@ -22,6 +22,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -162,6 +163,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
List<Long> ids = approvalLogService.getFundConfigIds(bizChannel);
// 分页条件
Pageable pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize);
Specification<FundModuleChannelFundConfigNew> specification = new Specification<FundModuleChannelFundConfigNew>() {
@Override
public Predicate toPredicate(Root<FundModuleChannelFundConfigNew> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
......
......@@ -156,7 +156,7 @@ public class FundModuleServiceImpl implements IFundModuleService{
@Override
public GlobalResponse getAuditInfos(String targetName, Integer auditStatus, Integer auditType, Integer auditTarget,
String applyStartTime, String applyEndTime, String user, Integer pageNum, Integer pageSize) {
Map<String, Object> result = approvalLogService.getApprovalLogs(targetName, auditStatus, auditType, auditTarget, applyStartTime, applyEndTime, user, pageNum, pageSize,null);
Map<String, Object> result = approvalLogService.getApprovalLogs(targetName, auditStatus, auditType, auditTarget, applyStartTime, applyEndTime, user, pageNum, pageSize);
if (result.size() == 0) {
return GlobalResponse.create(FundModuleResponse.HAS_NO_DATA);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment