6 changed files with 137 additions and 4 deletions
@ -0,0 +1,27 @@ |
|||||
|
package com.qs.serve.modules.seeyon.entity.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class TodoVO { |
||||
|
|
||||
|
/** 类型 */ |
||||
|
private String targetType; |
||||
|
|
||||
|
private String targetCode; |
||||
|
|
||||
|
private String targetId; |
||||
|
|
||||
|
/** 标题 */ |
||||
|
private String title; |
||||
|
|
||||
|
/** 时间 */ |
||||
|
private LocalDateTime time; |
||||
|
|
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.qs.serve.modules.seeyon.service; |
||||
|
|
||||
|
import com.qs.serve.modules.seeyon.entity.vo.TodoVO; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 通用的审批服务 |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
public interface CommonCheckService { |
||||
|
|
||||
|
/** |
||||
|
* 退回列表 |
||||
|
* @return |
||||
|
*/ |
||||
|
List<TodoVO> listCallbackList(); |
||||
|
|
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
package com.qs.serve.modules.seeyon.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qs.serve.common.util.AuthContextUtils; |
||||
|
import com.qs.serve.modules.seeyon.entity.vo.TodoVO; |
||||
|
import com.qs.serve.modules.seeyon.service.CommonCheckService; |
||||
|
import com.qs.serve.modules.sys.service.SysUserService; |
||||
|
import com.qs.serve.modules.tbs.common.TbsCostApplyState; |
||||
|
import com.qs.serve.modules.tbs.entity.TbsCostApply; |
||||
|
import com.qs.serve.modules.tbs.mapper.TbsCostApplyMapper; |
||||
|
import com.qs.serve.modules.tzc.common.TzcPolicyStatus; |
||||
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
||||
|
import com.qs.serve.modules.tzc.service.TzcPolicyService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/8/8 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class CommonCheckServiceImpl implements CommonCheckService { |
||||
|
|
||||
|
private final SysUserService sysUserService; |
||||
|
private final TbsCostApplyMapper costApplyMapper; |
||||
|
private final TzcPolicyService tzcPolicyService; |
||||
|
|
||||
|
@Override |
||||
|
public List<TodoVO> listCallbackList() { |
||||
|
String userId = AuthContextUtils.getSysUserId(); |
||||
|
//费用
|
||||
|
LambdaQueryWrapper<TbsCostApply> costLqw = new LambdaQueryWrapper<>(); |
||||
|
costLqw.eq(TbsCostApply::getUserId,userId); |
||||
|
costLqw.eq(TbsCostApply::getChargeState, TbsCostApplyState.State_4_refused.getCode()); |
||||
|
List<TbsCostApply> costApplyList = costApplyMapper.selectList(costLqw); |
||||
|
List<TodoVO> todoCostList = costApplyList.stream().map(obj -> { |
||||
|
TodoVO todo = new TodoVO(); |
||||
|
todo.setTargetType("CostBill"); |
||||
|
todo.setTargetId(obj.getId()+""); |
||||
|
todo.setTargetCode(obj.getCode()); |
||||
|
todo.setTitle(obj.getChargeTheme()); |
||||
|
todo.setTime(obj.getCreateTime()); |
||||
|
return todo; |
||||
|
}).collect(Collectors.toList()); |
||||
|
//政策
|
||||
|
LambdaQueryWrapper<TzcPolicy> policyLqw = new LambdaQueryWrapper<>(); |
||||
|
policyLqw.eq(TzcPolicy::getUserId, userId); |
||||
|
policyLqw.eq(TzcPolicy::getPolicyStatus, TzcPolicyStatus.Status_4_RollBack); |
||||
|
List<TzcPolicy> policyList = tzcPolicyService.list(policyLqw); |
||||
|
List<TodoVO> todoPolicyList = policyList.stream().map(obj -> { |
||||
|
TodoVO todo = new TodoVO(); |
||||
|
todo.setTargetType("ReleasePolicy"); |
||||
|
todo.setTargetId(obj.getId()+""); |
||||
|
todo.setTargetCode(obj.getPolicyCode()); |
||||
|
todo.setTitle(obj.getTitle()); |
||||
|
todo.setTime(obj.getCreateTime()); |
||||
|
return todo; |
||||
|
}).collect(Collectors.toList()); |
||||
|
|
||||
|
List<TodoVO> result = new ArrayList<>(); |
||||
|
result.addAll(todoCostList); |
||||
|
result.addAll(todoPolicyList); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue