Ver código fonte

审核公司

gongdecai 3 anos atrás
pai
commit
4a1d9e8d6f

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/INewWorkflowService.java

@@ -58,6 +58,16 @@ public interface INewWorkflowService {
      */
     Workflow findLatestWorkflowByBusinessCode(String businessCode);
 
+
+    /**
+     * 通过业务编码查询最新工作流<br/>
+     * 根据用户和角色查询
+     *
+     * @param businessCode 业务编码
+     * @return 最新关联工作流
+     */
+    Workflow findLatestWorkflowByBusinessCodeByApp(String compId ,String businessCode);
+
     /**
      * 通过业务编码和公司ID获取最新工作流
      *

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/NewWorkflowServiceImpl.java

@@ -217,6 +217,11 @@ public class NewWorkflowServiceImpl implements INewWorkflowService {
         return workflowConfigService.findLatestWorkflowByBusinessCode(businessCode, getCurrentCompId(), getCurrentUserRoles());
     }
 
+    @Override
+    public Workflow findLatestWorkflowByBusinessCodeByApp(String compId ,String businessCode) {
+        return workflowConfigService.findLatestWorkflowByBusinessCode(businessCode, compId, getCurrentUserRoles());
+    }
+
     @Override
     public Workflow getLatestWorkflowByBusinessCodeAndCompId(String businessCode, String compId) {
         return workflowConfigService.getLatestWorkflowByBusinessCodeAndCompId(businessCode, compId);

+ 3 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseClosingReportServiceImpl.java

@@ -17,6 +17,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.PurchaseClosingReportMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
 import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseClosingReportService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.toolkit.workflow.service.IWorkflowService;
@@ -43,7 +44,7 @@ import java.util.stream.Collectors;
 public class PurchaseClosingReportServiceImpl extends ServiceImpl<PurchaseClosingReportMapper, PurchaseClosingReport> implements IPurchaseClosingReportService {
 
     @Autowired
-    private IWorkflowService workflowService;
+    private INewWorkflowService workflowService;
 
     @SofaReference
     private ICommonRoleResourceService roleResourceService;
@@ -210,7 +211,7 @@ public class PurchaseClosingReportServiceImpl extends ServiceImpl<PurchaseClosin
             // 不是退回的单子
             if (isStartWorkflow) {
                 Workflow workflow = workflowService
-                        .findLatestWorkflowByBusinessCode("PROCUREMENT-CLOSE-REPORT");
+                        .findLatestWorkflowByBusinessCodeByApp(purchaseClosingReport.getCompId(),"PROCUREMENT-CLOSE-REPORT");
                 // 没配置审核流程,直接结束并处理信息
                 if (workflow == null) {
                     throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);

+ 2 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseOrderServiceImpl.java

@@ -168,7 +168,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
         // 不是退回的单子
         if (isStartWorkflow) {
             Workflow workflow = workflowService
-                    .findLatestWorkflowByBusinessCode("PROCUREMENT-CLOSE-REPORT");
+                    .findLatestWorkflowByBusinessCodeByApp(purchaseClosingReport.getCompId(),"PROCUREMENT-CLOSE-REPORT");
             // 没配置审核流程,直接结束并处理信息
             if (workflow == null) {
                 throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
@@ -574,7 +574,7 @@ public class PurchaseOrderServiceImpl extends ServiceImpl<PurchaseOrderMapper, P
         // 不是退回的单子
         if (isStartWorkflow) {
             Workflow workflow = workflowService
-                    .findLatestWorkflowByBusinessCode("PROCUREMENT-ORDER-APPROVE");
+                    .findLatestWorkflowByBusinessCodeByApp(purchaseOrder.getCompId(),"PROCUREMENT-ORDER-APPROVE");
             // 没配置审核流程,直接结束并处理信息
             if (workflow == null) {
                 throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);

+ 3 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PurchaseReceiptReportServiceImpl.java

@@ -16,11 +16,8 @@ import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.PurchaseReceiptReportMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
-import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseOrderService;
-import com.yh.saas.plugin.yiliangyiyun.service.IPurchaseReceiptReportService;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
 import com.yh.saas.toolkit.workflow.service.IWorkflowService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -45,7 +42,7 @@ import java.util.stream.Collectors;
 public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceiptReportMapper, PurchaseReceiptReport> implements IPurchaseReceiptReportService {
 
     @Autowired
-    private IWorkflowService workflowService;
+    private INewWorkflowService workflowService;
 
     @SofaReference
     private ICommonRoleResourceService roleResourceService;
@@ -122,7 +119,7 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
             // 不是退回的单子
             if (isStartWorkflow) {
                 Workflow workflow = workflowService
-                        .findLatestWorkflowByBusinessCode("PROCUREMENT-RECEIPT-REPORT");
+                        .findLatestWorkflowByBusinessCodeByApp(purchaseReceiptReport.getCompId(),"PROCUREMENT-RECEIPT-REPORT");
                 // 没配置审核流程,直接结束并处理信息
                 if (workflow == null) {
                     throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);

+ 3 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SaleOrderServiceImpl.java

@@ -53,7 +53,7 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
     @Autowired
     private ISalesDeliveryReportService salesDeliveryReportService;
     @Autowired
-    private IWorkflowService workflowService;
+    private INewWorkflowService workflowService;
     @Autowired
     private GeTuiUtils geTuiUtils;
     @Autowired
@@ -221,7 +221,7 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
         // 不是退回的单子
         if (isStartWorkflow) {
             Workflow workflow = workflowService
-                    .findLatestWorkflowByBusinessCode("SALE-CLOSE-REPORT");
+                    .findLatestWorkflowByBusinessCodeByApp(salesClosingReport.getCompId(),"SALE-CLOSE-REPORT");
             // 没配置审核流程,直接结束并处理信息
             if (workflow == null) {
                 throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
@@ -469,7 +469,7 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 //         不是退回的单子
         if (isStartWorkflow) {
             Workflow workflow = workflowService
-                    .findLatestWorkflowByBusinessCode("SALE-ORDER-APPROVE");
+                    .findLatestWorkflowByBusinessCodeByApp(saleOrder.getCompId(),"SALE-ORDER-APPROVE");
             // 没配置审核流程,直接结束并处理信息
             if (workflow == null) {
                 throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);

+ 3 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SalesClosingReportServiceImpl.java

@@ -18,6 +18,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.SalesClosingReportMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
 import com.yh.saas.plugin.yiliangyiyun.service.ISalesClosingReportService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.toolkit.workflow.service.IWorkflowService;
@@ -44,7 +45,7 @@ import java.util.stream.Collectors;
 public class SalesClosingReportServiceImpl extends ServiceImpl<SalesClosingReportMapper, SalesClosingReport> implements ISalesClosingReportService {
 
     @Autowired
-    private IWorkflowService workflowService;
+    private INewWorkflowService workflowService;
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
 
@@ -120,7 +121,7 @@ public class SalesClosingReportServiceImpl extends ServiceImpl<SalesClosingRepor
             // 不是退回的单子
             if (isStartWorkflow) {
                 Workflow workflow = workflowService
-                        .findLatestWorkflowByBusinessCode("SALE-CLOSE-REPORT");
+                        .findLatestWorkflowByBusinessCodeByApp(salesClosingReport.getCompId(),"SALE-CLOSE-REPORT");
                 // 没配置审核流程,直接结束并处理信息
                 if (workflow == null) {
                     throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);

+ 3 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/SalesDeliveryReportServiceImpl.java

@@ -15,11 +15,8 @@ import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.exception.YException;
 import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.SalesDeliveryReportMapper;
-import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
-import com.yh.saas.plugin.yiliangyiyun.service.ISaleOrderService;
-import com.yh.saas.plugin.yiliangyiyun.service.ISalesDeliveryReportService;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
-import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
 import com.yh.saas.toolkit.workflow.service.IWorkflowService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,7 +40,7 @@ import java.util.stream.Collectors;
 @Service
 public class SalesDeliveryReportServiceImpl extends ServiceImpl<SalesDeliveryReportMapper, SalesDeliveryReport> implements ISalesDeliveryReportService {
     @Autowired
-    private IWorkflowService workflowService;
+    private INewWorkflowService workflowService;
     @SofaReference
     private ICommonRoleResourceService roleResourceService;
     @Autowired
@@ -197,7 +194,7 @@ public class SalesDeliveryReportServiceImpl extends ServiceImpl<SalesDeliveryRep
             // 不是退回的单子
             if (isStartWorkflow) {
                 Workflow workflow = workflowService
-                        .findLatestWorkflowByBusinessCode("SALE-RECEIPT-REPORT");
+                        .findLatestWorkflowByBusinessCodeByApp(salesDeliveryReport.getCompId(),"SALE-RECEIPT-REPORT");
                 // 没配置审核流程,直接结束并处理信息
                 if (workflow == null) {
                     throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);