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

6.6-2

parent 1d91481a
...@@ -41,7 +41,7 @@ public interface IApprovalLogService { ...@@ -41,7 +41,7 @@ public interface IApprovalLogService {
* @return * @return
*/ */
public Map<String, Object> getApprovalLogs(String targetName, Integer auditStatus, Integer auditType, Integer auditTarget, 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); List<Long> getFundConfigIds(String channel);
......
...@@ -59,15 +59,9 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{ ...@@ -59,15 +59,9 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{
@Override @Override
public Map<String, Object> getApprovalLogs(String targetName, Integer auditStatus, Integer auditType, public Map<String, Object> getApprovalLogs(String targetName, Integer auditStatus, Integer auditType,
Integer auditTarget, String applyStartTime, String applyEndTime, String user, Integer pageNum, Integer auditTarget, String applyStartTime, String applyEndTime, String user, Integer pageNum,
Integer pageSize,Integer sortMode) { Integer pageSize) {
// 分页条件 // 分页条件
Pageable pageable; Pageable pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize);
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);
}
Specification<ApprovalLog> specification = new Specification<ApprovalLog>() { Specification<ApprovalLog> specification = new Specification<ApprovalLog>() {
@Override @Override
public Predicate toPredicate(Root<ApprovalLog> root, CriteriaQuery<?> query, CriteriaBuilder cb) { public Predicate toPredicate(Root<ApprovalLog> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
...@@ -76,11 +70,7 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{ ...@@ -76,11 +70,7 @@ public class ApprovalLogServiceImpl implements IApprovalLogService{
predicatesAnd.add(cb.equal(root.get("enable"), true)); predicatesAnd.add(cb.equal(root.get("enable"), true));
if(auditStatus != null){ if(auditStatus != null){
predicatesAnd.add(cb.equal(root.get("auditStatus"), auditStatus)); 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){ if(auditType != null){
predicatesAnd.add(cb.equal(root.get("auditType"), auditType)); predicatesAnd.add(cb.equal(root.get("auditType"), auditType));
} }
......
...@@ -22,6 +22,7 @@ import org.springframework.cache.annotation.Cacheable; ...@@ -22,6 +22,7 @@ import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -162,6 +163,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha ...@@ -162,6 +163,7 @@ public class FundModuleChannelFundConfigNewServiceImpl implements IFundModuleCha
List<Long> ids = approvalLogService.getFundConfigIds(bizChannel); List<Long> ids = approvalLogService.getFundConfigIds(bizChannel);
// 分页条件 // 分页条件
Pageable pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize); Pageable pageable = new PageRequest(pageNum < 0 ? 0 : pageNum, pageSize);
Specification<FundModuleChannelFundConfigNew> specification = new Specification<FundModuleChannelFundConfigNew>() { Specification<FundModuleChannelFundConfigNew> specification = new Specification<FundModuleChannelFundConfigNew>() {
@Override @Override
public Predicate toPredicate(Root<FundModuleChannelFundConfigNew> root, CriteriaQuery<?> query, CriteriaBuilder cb) { public Predicate toPredicate(Root<FundModuleChannelFundConfigNew> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
......
...@@ -156,7 +156,7 @@ public class FundModuleServiceImpl implements IFundModuleService{ ...@@ -156,7 +156,7 @@ public class FundModuleServiceImpl implements IFundModuleService{
@Override @Override
public GlobalResponse getAuditInfos(String targetName, Integer auditStatus, Integer auditType, Integer auditTarget, public GlobalResponse getAuditInfos(String targetName, Integer auditStatus, Integer auditType, Integer auditTarget,
String applyStartTime, String applyEndTime, String user, Integer pageNum, Integer pageSize) { 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) { if (result.size() == 0) {
return GlobalResponse.create(FundModuleResponse.HAS_NO_DATA); 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