diff --git a/src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java b/src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java index c5b9e8db..67ad3528 100644 --- a/src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java +++ b/src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java @@ -161,21 +161,18 @@ public class AsyncFactory { TbsBudgetChangeOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetChangeOperationServiceImpl.class); String summeryResult = applyOperationService.checkAffairSummery(budgetId); - if(summeryResult.equals(SeeYonOperationService.SummeryState_Success)){ - DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); - // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 - Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); - //调用成功回调方法 - TbsAffairCommitBo doParam = new TbsAffairCommitBo(); - doParam.setTargetId(budgetId); - if (state==null||state==1){ - applyOperationService.doFinished(doParam); - }else if (state==2){ - applyOperationService.doCommitBacked(budgetId); - }else if (state==0){ - applyOperationService.doRefuse(doParam); - } - + DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); + // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 + Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); + //调用成功回调方法 + TbsAffairCommitBo doParam = new TbsAffairCommitBo(); + doParam.setTargetId(budgetId); + if (state==null||state==1){ + applyOperationService.doFinished(doParam); + }else if (state==2){ + applyOperationService.doBacked(doParam); + }else if (state==0){ + applyOperationService.doRefuse(doParam); } log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); } catch (Exception e) { @@ -201,21 +198,18 @@ public class AsyncFactory { TbsBudgetBatchOperationServiceImpl operationService = SpringUtils.getBean(TbsBudgetBatchOperationServiceImpl.class); String summeryResult = operationService.checkAffairSummery(batchId); - if(summeryResult.equals(SeeYonOperationService.SummeryState_Success)){ - DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); - // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 - Integer state = commitService.getState(operationService.getTemplateCode(),batchId+""); - //调用成功回调方法 - TbsAffairCommitBo doParam = new TbsAffairCommitBo(); - doParam.setTargetId(batchId); - if (state==null||state==1){ - operationService.doFinished(doParam); - }else if (state==2){ - operationService.doCommitBacked(batchId); - }else if (state==0){ - operationService.doRefuse(doParam); - } - + DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); + // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 + Integer state = commitService.getState(operationService.getTemplateCode(),batchId+""); + //调用成功回调方法 + TbsAffairCommitBo doParam = new TbsAffairCommitBo(); + doParam.setTargetId(batchId); + if (state==null||state==1){ + operationService.doFinished(doParam); + }else if (state==2){ + operationService.doBacked(doParam); + }else if (state==0){ + operationService.doRefuse(doParam); } log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); @@ -241,23 +235,21 @@ public class AsyncFactory { Thread.sleep(3*1000); TbsBudgetApplyOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetApplyOperationServiceImpl.class); String summeryResult = applyOperationService.checkAffairSummery(budgetId); - if(summeryResult.equals(TbsCostApplyOperationServiceImpl.SummeryState_Success)){ - DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); - // TbsAffairCommitBo.state 0-否定,1-同意,2-退回 - Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); - //获取最后一条审批判断结果 - if(state==null){ - return; - } - TbsAffairCommitBo doParam = new TbsAffairCommitBo(); - doParam.setTargetId(budgetId); - if (state == 1){ - applyOperationService.doFinished(doParam); - }else if (state==2){ - applyOperationService.doCommitBacked(budgetId); - }else if (state==0){ - applyOperationService.doRefuse(doParam); - } + DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); + // TbsAffairCommitBo.state 0-否定,1-同意,2-退回 + Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); + //获取最后一条审批判断结果 + if(state==null){ + return; + } + TbsAffairCommitBo doParam = new TbsAffairCommitBo(); + doParam.setTargetId(budgetId); + if (state == 1){ + applyOperationService.doFinished(doParam); + }else if (state==2){ + applyOperationService.doBacked(doParam); + }else if (state==0){ + applyOperationService.doRefuse(doParam); } log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); } catch (Exception e) { @@ -316,23 +308,21 @@ public class AsyncFactory { if(!verification.getVerificationState().equals(VtbVerificationState.Commiting.getCode())){ return; } - VtbVerificationOperationServiceImpl verificationOperationService = SpringUtils.getBean(VtbVerificationOperationServiceImpl.class); - String summeryResult = verificationOperationService.checkAffairSummery(verification.getId().toString()); - if( summeryResult.equals(VtbVerificationOperationServiceImpl.SummeryState_Success)){ - VtbVerificationApplication verificationApplication = SpringUtils.getBean(VtbVerificationApplication.class); - if(state.equals(1)){ - //调用成功回调方法 - verificationApplication.finishCallBack(verification, totalAmount); - }else if(state.equals(2)){ - verificationApplication.backCommitAndStop(verification,true); - }else if(state.equals(0)){ - verificationApplication.backCommitAndStop(verification,false); - }else { - return; - } - if(realaseFlag){ - vtbVerificationService.release(verification.getActivityId(),userCode,false); - } + //VtbVerificationOperationServiceImpl verificationOperationService = SpringUtils.getBean(VtbVerificationOperationServiceImpl.class); + //String summeryResult = verificationOperationService.checkAffairSummery(verification.getId().toString()); + VtbVerificationApplication verificationApplication = SpringUtils.getBean(VtbVerificationApplication.class); + if(state.equals(1)){ + //调用成功回调方法 + verificationApplication.finishCallBack(verification, totalAmount); + }else if(state.equals(2)){ + verificationApplication.backCommitAndStop(verification,true); + }else if(state.equals(0)){ + verificationApplication.backCommitAndStop(verification,false); + }else { + return; + } + if(realaseFlag){ + vtbVerificationService.release(verification.getActivityId(),userCode,false); } } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java b/src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java index ab1be264..c114a07c 100644 --- a/src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java +++ b/src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java @@ -317,7 +317,7 @@ public interface SeeYonOperationService extends SeeYonBaseService{ default String checkAffairSummery(String targetId){ testConnection(); R result = getRequestService().checkAffairSummery(getTemplateCode(),targetId); - if(result.getData()==null){ + if(result.getData()==null||result.getData().equals("next")){ String templateCode = getTemplateCode(); SyAffairStateResult stateResult =checkAffairState(targetId,templateCode); return stateResult.getState().name(); diff --git a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java b/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java index 0ca831a2..590e897e 100644 --- a/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java +++ b/src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java @@ -78,7 +78,7 @@ public class TbsBudgetChangeController { public R getList(@PathVariable("id")String id ){ TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailById(id, null); if (budgetChange.getBudgetCheckState().equals(TbsCommonCheckState.State_1_apply)){ - AsyncManager.me().execute(AsyncFactory.submitBudgetChange(id)); + AsyncManager.me().execute(AsyncFactory.submitBudgetChange(budgetChange.getId()+"")); } return R.ok(budgetChange); } @@ -91,6 +91,9 @@ public class TbsBudgetChangeController { @GetMapping("/apply/{id}") public R getApplyBudget(@PathVariable("id")String id ){ TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailByBudgetId(id, null); + if (budgetChange.getBudgetCheckState().equals(TbsCommonCheckState.State_1_apply)){ + AsyncManager.me().execute(AsyncFactory.submitBudgetApply(id)); + } return R.ok(budgetChange); } diff --git a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java index 0732df43..6e3a448b 100644 --- a/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java @@ -213,8 +213,12 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl and ( `sku`.`sku_code` like concat('%', #{query.keyword},'%') or @@ -213,7 +213,7 @@ UNION ALL SELECT sku.*,1 as rn FROM goods_sku sku left join goods_spu spu on sku.spu_id = spu.id - WHERE sku.special_flag = 1 + WHERE sku.special_flag = 1 and sku.del_flag = 0 and ( `sku`.`sku_code` like concat('%', #{query.keyword},'%') or