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);
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();

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){
testConnection();
R<String> 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();

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 ){
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<TbsBudgetChange> 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);
}

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);
//请求校验是否成功
AsyncManager.me().execute(AsyncFactory.submitBudgetChange(budgetChange.getId()+""));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
AsyncFactory.submitBudgetChange(budgetChange.getId()+"");
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();
verification.setVerificationCode("HX"+ IdUtil.timeStampId());
verification.setVerificationCode( billNumber);
verification.setVerificationMainCode(verification.getVerificationCode());
verification.setFinishedTime(nowTime);
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
FROM goods_sku sku
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 != '' ">
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
<if test="query.keyword != null and query.keyword != '' ">
and (
`sku`.`sku_code` like concat('%', #{query.keyword},'%') or

Loading…
Cancel
Save