|  | @@ -13,9 +13,13 @@ import com.ruoyi.common.core.domain.AjaxResult;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.core.domain.model.LoginUser;
 | 
	
		
			
				|  |  |  import com.ruoyi.common.utils.StringUtils;
 | 
	
		
			
				|  |  | +import com.ruoyi.finance.domain.TFee;
 | 
	
		
			
				|  |  | +import com.ruoyi.finance.mapper.TFeeMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.finance.service.impl.TFeeServiceImpl;
 | 
	
		
			
				|  |  |  import com.ruoyi.system.mapper.SysUserMapper;
 | 
	
		
			
				|  |  | +import com.ruoyi.warehouseBusiness.domain.TWarehouseAgreement;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
 | 
	
		
			
				|  |  | +import com.ruoyi.warehouseBusiness.mapper.TWarehouseAgreementMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.service.impl.TWarehouseAgreementServiceImpl;
 | 
	
		
			
				|  |  |  import com.ruoyi.warehouseBusiness.service.impl.TWarehouseBillsServiceImpl;
 | 
	
	
		
			
				|  | @@ -62,7 +66,11 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private TWarehouseAgreementServiceImpl tWarehouseAgreementService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private TFeeMapper tFeeMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private TWarehouseAgreementMapper tWarehouseAgreementMapper;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      /**
 | 
	
		
			
				|  |  |       * 查询审批流配置主
 | 
	
	
		
			
				|  | @@ -307,7 +315,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          // 仓库模块
 | 
	
		
			
				|  |  |                          AjaxResult ajaxResult = tWarehouseBillsService.warehouseFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -                        String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +                        String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |                          if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                              TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |                              return ajaxResult;
 | 
	
	
		
			
				|  | @@ -316,18 +324,25 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |                          // 财务模块
 | 
	
		
			
				|  |  |                          if ("T".equals(at.getIffinalItem())) {
 | 
	
		
			
				|  |  |                              fettle = 6L;
 | 
	
		
			
				|  |  | +                            // 更新费用明细
 | 
	
		
			
				|  |  | +                            AjaxResult ajaxResult = tFeeServiceImpl.billsfeesFollow(auditItems.getBillId());
 | 
	
		
			
				|  |  | +                            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  | +                            if ("500".equals(code)) {
 | 
	
		
			
				|  |  | +                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                                return ajaxResult;
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  |                          } else if ("F".equals(at.getIffinalItem())) {
 | 
	
		
			
				|  |  |                              fettle = 5L;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          // 变更财务状态
 | 
	
		
			
				|  |  |                          AjaxResult ajaxResult = tFeeServiceImpl.tfeeFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -                        String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +                        String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |                          if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                              TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |                              return ajaxResult;
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                      } else if (auditItems.getActId() >= 310 && auditItems.getActId() <= 320) {
 | 
	
		
			
				|  |  | -                        // 财务模块
 | 
	
		
			
				|  |  | +                        // 协议模块
 | 
	
		
			
				|  |  |                          if ("T".equals(at.getIffinalItem())) {
 | 
	
		
			
				|  |  |                              fettle = 6L;
 | 
	
		
			
				|  |  |                          } else if ("F".equals(at.getIffinalItem())) {
 | 
	
	
		
			
				|  | @@ -335,7 +350,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  |                          // 变更财务状态
 | 
	
		
			
				|  |  |                          AjaxResult ajaxResult = tWarehouseAgreementService.agreementFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -                        String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +                        String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |                          if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                              TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |                              return ajaxResult;
 | 
	
	
		
			
				|  | @@ -365,7 +380,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |              fettle = 3L;
 | 
	
		
			
				|  |  |              // 仓库模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tWarehouseBillsService.warehouseFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -374,7 +389,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |              fettle = 3L;
 | 
	
		
			
				|  |  |              // 财务模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tFeeServiceImpl.tfeeFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -383,7 +398,7 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |              fettle = 3L;
 | 
	
		
			
				|  |  |              // 协议模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tWarehouseAgreementService.agreementFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  |              }
 | 
	
	
		
			
				|  | @@ -450,31 +465,49 @@ public class AuditPathsServiceImpl implements IAuditPathsService {
 | 
	
		
			
				|  |  |          long fettle = 0L;
 | 
	
		
			
				|  |  |          if (auditItems.getActId() >= 110 && auditItems.getActId() <= 140) {
 | 
	
		
			
				|  |  |              fettle = 2L;
 | 
	
		
			
				|  |  | +            // 查询仓库状态
 | 
	
		
			
				|  |  | +            TWarehouseBills tWarehouseBills= tWarehouseBillsMapper.selectTWarehousebillsById(auditItems.getBillId());
 | 
	
		
			
				|  |  | +            if(tWarehouseBills.getfBillstatus().equals("5") || tWarehouseBills.getfBillstatus().equals("6")){
 | 
	
		
			
				|  |  | +                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 已经过审批");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              // 仓库模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tWarehouseBillsService.warehouseFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 更新审批状态失败");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            return ajaxResult;
 | 
	
		
			
				|  |  |          } else if (auditItems.getActId() >= 210 && auditItems.getActId() <= 230) {
 | 
	
		
			
				|  |  |              fettle = 2L;
 | 
	
		
			
				|  |  | +            // 查询财务状态
 | 
	
		
			
				|  |  | +            TFee tFee= tFeeMapper.selectTFeeById(auditItems.getBillId());
 | 
	
		
			
				|  |  | +            if(tFee.getfBillstatus().equals("5") || tFee.getfBillstatus().equals("6")){
 | 
	
		
			
				|  |  | +                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 已经过审批");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              // 财务模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tFeeServiceImpl.tfeeFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 更新审批状态失败");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            return ajaxResult;
 | 
	
		
			
				|  |  |          } else if (auditItems.getActId() >= 310 && auditItems.getActId() <= 320) {
 | 
	
		
			
				|  |  |              fettle = 2L;
 | 
	
		
			
				|  |  | +            // 查询协议状态
 | 
	
		
			
				|  |  | +            TWarehouseAgreement tWarehouseAgreement=tWarehouseAgreementMapper.selectTWarehouseAgreementById(auditItems.getBillId());
 | 
	
		
			
				|  |  | +            if(tWarehouseAgreement.getfBillstatus().equals("5") || tWarehouseAgreement.getfBillstatus().equals("6")){
 | 
	
		
			
				|  |  | +                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 已经过审批");
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |              // 协议模块
 | 
	
		
			
				|  |  |              AjaxResult ajaxResult = tWarehouseAgreementService.agreementFollow(auditItems.getBillId(), fettle);
 | 
	
		
			
				|  |  | -            String code = (String) ajaxResult.get("code");
 | 
	
		
			
				|  |  | +            String code = ajaxResult.get("code").toString();
 | 
	
		
			
				|  |  |              if ("500".equals(code)) {
 | 
	
		
			
				|  |  |                  TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
 | 
	
		
			
				|  |  | +                return AjaxResult.error("审批撤销失败: 更新审批状态失败");
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            return ajaxResult;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          AuditItems item = new AuditItems();
 | 
	
		
			
				|  |  |          item.setBillId(auditItems.getId());
 |