Browse Source

opt: 修复回退补偿不生效

v1.0
Yen 1 year ago
parent
commit
d7c7fa4270
  1. 118
      src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java
  2. 2
      src/main/java/com/qs/serve/modules/seeyon/service/SeeYonOperationService.java
  3. 5
      src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java
  4. 8
      src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java
  5. 2
      src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java
  6. 4
      src/main/resources/mapper/goods/GoodsSpuMapper.xml

118
src/main/java/com/qs/serve/common/framework/manager/AsyncFactory.java

@ -161,21 +161,18 @@ public class AsyncFactory {
TbsBudgetChangeOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetChangeOperationServiceImpl.class); TbsBudgetChangeOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetChangeOperationServiceImpl.class);
String summeryResult = applyOperationService.checkAffairSummery(budgetId); String summeryResult = applyOperationService.checkAffairSummery(budgetId);
if(summeryResult.equals(SeeYonOperationService.SummeryState_Success)){ DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class);
DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回
// 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+"");
Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); //调用成功回调方法
//调用成功回调方法 TbsAffairCommitBo doParam = new TbsAffairCommitBo();
TbsAffairCommitBo doParam = new TbsAffairCommitBo(); doParam.setTargetId(budgetId);
doParam.setTargetId(budgetId); if (state==null||state==1){
if (state==null||state==1){ applyOperationService.doFinished(doParam);
applyOperationService.doFinished(doParam); }else if (state==2){
}else if (state==2){ applyOperationService.doBacked(doParam);
applyOperationService.doCommitBacked(budgetId); }else if (state==0){
}else if (state==0){ applyOperationService.doRefuse(doParam);
applyOperationService.doRefuse(doParam);
}
} }
log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult);
} catch (Exception e) { } catch (Exception e) {
@ -201,21 +198,18 @@ public class AsyncFactory {
TbsBudgetBatchOperationServiceImpl operationService = SpringUtils.getBean(TbsBudgetBatchOperationServiceImpl.class); TbsBudgetBatchOperationServiceImpl operationService = SpringUtils.getBean(TbsBudgetBatchOperationServiceImpl.class);
String summeryResult = operationService.checkAffairSummery(batchId); String summeryResult = operationService.checkAffairSummery(batchId);
if(summeryResult.equals(SeeYonOperationService.SummeryState_Success)){ DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class);
DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); // 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回
// 获取最后一条审批判断结果:TbsAffairCommitBo.state 0-否定,1-同意,2-退回 Integer state = commitService.getState(operationService.getTemplateCode(),batchId+"");
Integer state = commitService.getState(operationService.getTemplateCode(),batchId+""); //调用成功回调方法
//调用成功回调方法 TbsAffairCommitBo doParam = new TbsAffairCommitBo();
TbsAffairCommitBo doParam = new TbsAffairCommitBo(); doParam.setTargetId(batchId);
doParam.setTargetId(batchId); if (state==null||state==1){
if (state==null||state==1){ operationService.doFinished(doParam);
operationService.doFinished(doParam); }else if (state==2){
}else if (state==2){ operationService.doBacked(doParam);
operationService.doCommitBacked(batchId); }else if (state==0){
}else if (state==0){ operationService.doRefuse(doParam);
operationService.doRefuse(doParam);
}
} }
log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult);
@ -241,23 +235,21 @@ public class AsyncFactory {
Thread.sleep(3*1000); Thread.sleep(3*1000);
TbsBudgetApplyOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetApplyOperationServiceImpl.class); TbsBudgetApplyOperationServiceImpl applyOperationService = SpringUtils.getBean(TbsBudgetApplyOperationServiceImpl.class);
String summeryResult = applyOperationService.checkAffairSummery(budgetId); String summeryResult = applyOperationService.checkAffairSummery(budgetId);
if(summeryResult.equals(TbsCostApplyOperationServiceImpl.SummeryState_Success)){ DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class);
DataAffairCommitService commitService = SpringUtils.getBean(DataAffairCommitService.class); // TbsAffairCommitBo.state 0-否定,1-同意,2-退回
// TbsAffairCommitBo.state 0-否定,1-同意,2-退回 Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+"");
Integer state = commitService.getState(applyOperationService.getTemplateCode(),budgetId+""); //获取最后一条审批判断结果
//获取最后一条审批判断结果 if(state==null){
if(state==null){ return;
return; }
} TbsAffairCommitBo doParam = new TbsAffairCommitBo();
TbsAffairCommitBo doParam = new TbsAffairCommitBo(); doParam.setTargetId(budgetId);
doParam.setTargetId(budgetId); if (state == 1){
if (state == 1){ applyOperationService.doFinished(doParam);
applyOperationService.doFinished(doParam); }else if (state==2){
}else if (state==2){ applyOperationService.doBacked(doParam);
applyOperationService.doCommitBacked(budgetId); }else if (state==0){
}else if (state==0){ applyOperationService.doRefuse(doParam);
applyOperationService.doRefuse(doParam);
}
} }
log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult); log.debug("--------------------------SubmitBudgetApply CallbackTimer summeryResult:{} ------------------------------",summeryResult);
} catch (Exception e) { } catch (Exception e) {
@ -316,23 +308,21 @@ public class AsyncFactory {
if(!verification.getVerificationState().equals(VtbVerificationState.Commiting.getCode())){ if(!verification.getVerificationState().equals(VtbVerificationState.Commiting.getCode())){
return; return;
} }
VtbVerificationOperationServiceImpl verificationOperationService = SpringUtils.getBean(VtbVerificationOperationServiceImpl.class); //VtbVerificationOperationServiceImpl verificationOperationService = SpringUtils.getBean(VtbVerificationOperationServiceImpl.class);
String summeryResult = verificationOperationService.checkAffairSummery(verification.getId().toString()); //String summeryResult = verificationOperationService.checkAffairSummery(verification.getId().toString());
if( summeryResult.equals(VtbVerificationOperationServiceImpl.SummeryState_Success)){ VtbVerificationApplication verificationApplication = SpringUtils.getBean(VtbVerificationApplication.class);
VtbVerificationApplication verificationApplication = SpringUtils.getBean(VtbVerificationApplication.class); if(state.equals(1)){
if(state.equals(1)){ //调用成功回调方法
//调用成功回调方法 verificationApplication.finishCallBack(verification, totalAmount);
verificationApplication.finishCallBack(verification, totalAmount); }else if(state.equals(2)){
}else if(state.equals(2)){ verificationApplication.backCommitAndStop(verification,true);
verificationApplication.backCommitAndStop(verification,true); }else if(state.equals(0)){
}else if(state.equals(0)){ verificationApplication.backCommitAndStop(verification,false);
verificationApplication.backCommitAndStop(verification,false); }else {
}else { return;
return; }
} if(realaseFlag){
if(realaseFlag){ vtbVerificationService.release(verification.getActivityId(),userCode,false);
vtbVerificationService.release(verification.getActivityId(),userCode,false);
}
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

2
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){ default String checkAffairSummery(String targetId){
testConnection(); testConnection();
R<String> result = getRequestService().checkAffairSummery(getTemplateCode(),targetId); R<String> result = getRequestService().checkAffairSummery(getTemplateCode(),targetId);
if(result.getData()==null){ if(result.getData()==null||result.getData().equals("next")){
String templateCode = getTemplateCode(); String templateCode = getTemplateCode();
SyAffairStateResult stateResult =checkAffairState(targetId,templateCode); SyAffairStateResult stateResult =checkAffairState(targetId,templateCode);
return stateResult.getState().name(); return stateResult.getState().name();

5
src/main/java/com/qs/serve/modules/tbs/controller/TbsBudgetChangeController.java

@ -78,7 +78,7 @@ public class TbsBudgetChangeController {
public R<TbsBudgetChange> getList(@PathVariable("id")String id ){ public R<TbsBudgetChange> getList(@PathVariable("id")String id ){
TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailById(id, null); TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailById(id, null);
if (budgetChange.getBudgetCheckState().equals(TbsCommonCheckState.State_1_apply)){ 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); return R.ok(budgetChange);
} }
@ -91,6 +91,9 @@ public class TbsBudgetChangeController {
@GetMapping("/apply/{id}") @GetMapping("/apply/{id}")
public R<TbsBudgetChange> getApplyBudget(@PathVariable("id")String id ){ public R<TbsBudgetChange> getApplyBudget(@PathVariable("id")String id ){
TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailByBudgetId(id, null); TbsBudgetChange budgetChange = tbsBudgetChangeService.getDetailByBudgetId(id, null);
if (budgetChange.getBudgetCheckState().equals(TbsCommonCheckState.State_1_apply)){
AsyncManager.me().execute(AsyncFactory.submitBudgetApply(id));
}
return R.ok(budgetChange); return R.ok(budgetChange);
} }

8
src/main/java/com/qs/serve/modules/tbs/service/impl/TbsBudgetChangeServiceImpl.java

@ -213,8 +213,12 @@ public class TbsBudgetChangeServiceImpl extends ServiceImpl<TbsBudgetChangeMappe
seeYonService.createCallbackStatus(callbackBo); seeYonService.createCallbackStatus(callbackBo);
//请求校验是否成功 //请求校验是否成功
AsyncManager.me().execute(AsyncFactory.submitBudgetChange(budgetChange.getId()+"")); try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
AsyncFactory.submitBudgetChange(budgetChange.getId()+"");
return budgetChange; return budgetChange;
} }

2
src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java

@ -541,7 +541,7 @@ public class PortalOfCostApplication {
//保存核销申请 //保存核销申请
VtbVerification verification = new VtbVerification(); VtbVerification verification = new VtbVerification();
verification.setVerificationCode("HX"+ IdUtil.timeStampId()); verification.setVerificationCode( billNumber);
verification.setVerificationMainCode(verification.getVerificationCode()); verification.setVerificationMainCode(verification.getVerificationCode());
verification.setFinishedTime(nowTime); verification.setFinishedTime(nowTime);
verification.setVerificationState(VtbVerificationState.Finished.getCode()); verification.setVerificationState(VtbVerificationState.Finished.getCode());

4
src/main/resources/mapper/goods/GoodsSpuMapper.xml

@ -188,7 +188,7 @@
SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn SELECT sku.*,ROW_NUMBER() OVER(PARTITION BY sku.spu_id ORDER BY sku.belong_sort) AS rn
FROM goods_sku sku FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id left join goods_spu spu on sku.spu_id = spu.id
WHERE sku.order_flag = 1 AND sku.special_flag = 0 WHERE sku.order_flag = 1 AND sku.special_flag = 0 and sku.del_flag = 0
<if test="query.keyword != null and query.keyword != '' "> <if test="query.keyword != null and query.keyword != '' ">
and ( and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or `sku`.`sku_code` like concat('%', #{query.keyword},'%') or
@ -213,7 +213,7 @@
UNION ALL UNION ALL
SELECT sku.*,1 as rn FROM goods_sku sku SELECT sku.*,1 as rn FROM goods_sku sku
left join goods_spu spu on sku.spu_id = spu.id 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
<if test="query.keyword != null and query.keyword != '' "> <if test="query.keyword != null and query.keyword != '' ">
and ( and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or `sku`.`sku_code` like concat('%', #{query.keyword},'%') or

Loading…
Cancel
Save