|
@@ -1,5 +1,6 @@
|
|
|
package com.sunxung.factoring.web.invoicemanage;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.sunxung.factoring.component.annotation.OperationLog;
|
|
|
import com.sunxung.factoring.component.enums.OperationTypeEnum;
|
|
|
import com.sunxung.factoring.component.util.ConstantUtil;
|
|
@@ -11,6 +12,7 @@ import com.sunxung.factoring.entity.ValidatorEntity;
|
|
|
import com.sunxung.factoring.entity.invoicemanage.InvoiceApproval;
|
|
|
import com.sunxung.factoring.entity.invoicemanage.SalesInvoiceInfo;
|
|
|
import com.sunxung.factoring.service.invoicemanage.InvoiceApprovalService;
|
|
|
+import com.sunxung.factoring.service.sys.UserService;
|
|
|
import com.sunxung.factoring.service.sys.flowable.FlowableService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -18,6 +20,7 @@ import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @Description : 销售发票审核controller层
|
|
@@ -36,6 +39,8 @@ public class InvoiceApprovalController {
|
|
|
|
|
|
@Autowired
|
|
|
private FlowableService flowableService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -70,10 +75,12 @@ public class InvoiceApprovalController {
|
|
|
SalesInvoiceInfo salesInvoiceInfo = invoiceApproval.getSalesInvoiceInfo();
|
|
|
String taskId = invoiceApproval.getTaskId();
|
|
|
String businessKey = invoiceApproval.getBusinessKey();
|
|
|
- if(salesInvoiceInfo == null){
|
|
|
- flowableService.claimTask(taskId, ThreadLocalUtil.getUserId(), ConstantUtil.PROJECT_MANAGER);
|
|
|
+ Long userId = ThreadLocalUtil.getUserId();
|
|
|
+ List<Long> userIds = userService.findUserIdByRole(ConstantUtil.PROJECT_MANAGER);
|
|
|
+ if(CollectionUtil.isNotEmpty(userIds) && userIds.contains(userId)){
|
|
|
+ flowableService.claimTask(taskId, userId, ConstantUtil.PROJECT_MANAGER);
|
|
|
}else {
|
|
|
- flowableService.claimTask(taskId, ThreadLocalUtil.getUserId(), ConstantUtil.CASHIER);
|
|
|
+ flowableService.claimTask(taskId, userId, ConstantUtil.CASHIER);
|
|
|
}
|
|
|
invoiceApprovalService.audit(invoiceApproval, businessKey, taskId, request);
|
|
|
return new ResponseJson("审核完成");
|