|
|
@@ -17,6 +17,7 @@
|
|
|
package org.springblade.check.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import org.springblade.check.dto.AuditProecessDTO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -26,14 +27,25 @@ import lombok.AllArgsConstructor;
|
|
|
|
|
|
import org.springblade.check.entity.AuditProecess;
|
|
|
import org.springblade.check.service.IAuditProecessService;
|
|
|
+import org.springblade.check.vo.AuditOrderVO;
|
|
|
+import org.springblade.check.vo.AuditProecessVO;
|
|
|
+import org.springblade.client.feign.ICorpsDescClient;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
+import org.springblade.purchase.sales.entity.Order;
|
|
|
+import org.springblade.purchase.sales.feign.IOrderDescClient;
|
|
|
+import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 审批流记录 控制器
|
|
|
*
|
|
|
@@ -43,23 +55,58 @@ import org.springblade.core.boot.ctrl.BladeController;
|
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("/auditproecess")
|
|
|
-@Api(value = "审批流记录", tags = "审批流记录接口")
|
|
|
+@Api(value = "用户审批", tags = "审批流记录接口")
|
|
|
public class AuditProecessController extends BladeController {
|
|
|
|
|
|
private final IAuditProecessService auditProecessService;
|
|
|
|
|
|
+ private final IOrderDescClient orderDescClient;
|
|
|
+
|
|
|
+ private final ICorpsDescClient corpsDescClient;
|
|
|
+
|
|
|
/**
|
|
|
* 分页 审批流记录
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "列表-审批流记录", notes = "传入auditProecess")
|
|
|
- public R<IPage<AuditProecess>> list(AuditProecess auditProecess, Query query) {
|
|
|
+ @ApiOperation(value = "列表-用户审批记录", notes = "传入auditProecess")
|
|
|
+ public R list(AuditProecess auditProecess, Query query) {
|
|
|
LambdaQueryWrapper<AuditProecess> lambdaQueryWrapper=new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.like(AuditProecess::getAuditUserId, String.valueOf(AuthUtil.getUserId()));
|
|
|
lambdaQueryWrapper.eq(AuditProecess::getAuditStatus, "S");
|
|
|
- IPage<AuditProecess> pages = auditProecessService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
- return R.data(pages);
|
|
|
+ IPage pages = auditProecessService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
+ List<AuditProecess> auditProecessList = pages.getRecords();
|
|
|
+ if(CollectionUtils.isNotEmpty(auditProecessList))
|
|
|
+ {
|
|
|
+ List<AuditOrderVO> auditOrderVOS=new ArrayList<>();
|
|
|
+ auditProecessList.forEach(e->{
|
|
|
+ AuditOrderVO auditOrderVO=new AuditOrderVO();
|
|
|
+ BeanUtil.copyProperties(e,auditOrderVO);
|
|
|
+ if(e.getBillId()!=null)
|
|
|
+ {
|
|
|
+ Order order = orderDescClient.getById(e.getBillId());
|
|
|
+ if(order!=null)
|
|
|
+ {
|
|
|
+ auditOrderVO.setOrderDate(order.getCreateTime());
|
|
|
+ auditOrderVO.setOrderNo(order.getOrderNo());
|
|
|
+ if(order.getCorpId()!=null)
|
|
|
+ {
|
|
|
+ auditOrderVO.setCorpsName(corpsDescClient.getCorpMessage(order.getCorpId()).getData().getCname());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ auditOrderVOS.add(auditOrderVO);
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ pages.setRecords(auditOrderVOS);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return R.data(Collections.EMPTY_LIST);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@PostMapping("createFinanceProcess")
|