Browse Source

推送消息改成队列方式推送结算的任务订单

master
陈裕财 5 years ago
parent
commit
d8196e0e90
  1. 2
      xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java
  2. 2
      xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java
  3. 11
      xm-core/src/main/java/com/xm/core/service/client/MkClient.java

2
xm-core/src/main/java/com/xm/core/ctrl/XmQuestionController.java

@ -121,7 +121,7 @@ public class XmQuestionController {
Tips tips=new Tips("成功新增一条数据");
try{
User user=LoginUtils.getCurrentUserInfo();
if(StringUtils.hasText(xmQuestionVo.getQtype())){
if(!StringUtils.hasText(xmQuestionVo.getQtype())){
xmQuestionVo.setQtype("bug");
}
xmQuestionService.addQuestion(xmQuestionVo);

2
xm-core/src/main/java/com/xm/core/service/XmTaskExecuserService.java

@ -469,7 +469,7 @@ public class XmTaskExecuserService extends BaseService {
// 需要调用财务系统进行记账结算到用户的结算账户中用户可以通过该账户提现取现金
cashOperateServie.shopBalancePayToClient(bizExecuser.getBranchId(),"platform",bizExecuser.getId(),bizExecuser.getSettleAmount(),bizExecuser.getTaskName()+"结算费用给执行人",bizExecuser.getUserid(),bizExecuser.getBranchId());
// 需要调用营销系统计算佣金
mkClient.pushActiExecOrder(bizExecuser.getTaskId(), bizExecuser.getUserid(), bizExecuser.getBranchId(),bizExecuser.getTaskId(),new BigDecimal(1),bizExecuser.getSettleAmount(),bizExecuser.getSettleAmount());
mkClient.pushActiExecOrder(bizExecuser.getTaskId(), bizExecuser.getUserid(), bizExecuser.getBranchId(),bizExecuser.getTaskId(),new BigDecimal(1),bizExecuser.getSettleAmount(),bizExecuser.getSettleAmount(),bizExecuser.getSettleWorkload());
flowVars.put("settleStatus","6");
flowVars.put("status","6");
this.updateFlowStateByProcInst("2", flowVars);

11
xm-core/src/main/java/com/xm/core/service/client/MkClient.java

@ -1,9 +1,11 @@
package com.xm.core.service.client;
import com.alibaba.fastjson.JSON;
import com.mdp.core.entity.Tips;
import com.mdp.core.utils.BaseUtils;
import com.mdp.micro.client.CallBizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -17,7 +19,7 @@ import java.util.Map;
public class MkClient {
@Autowired
CallBizService callBizService;
StringRedisTemplate strRedisTemplate;
/**
* execOrder.setOrderId(sequence.getReqFlowNo());
@ -29,9 +31,8 @@ public class MkClient {
* execOrder.setCustBranchId("platform-branch-001");
* @return
*/
public Tips pushActiExecOrder(String orderId,String custId,String custBranchId, String entityId,BigDecimal actNum,BigDecimal actSinglePrice,BigDecimal totalPrice){
public Tips pushActiExecOrder(String orderId,String custId,String custBranchId, String entityId,BigDecimal actNum,BigDecimal actSinglePrice,BigDecimal totalPrice,BigDecimal workload){
Tips tips = new Tips("推送订单成功");
String restUrl="/mk/mk/acti/execOrder/add";
Map<String,Object> params=new HashMap<>();
params.put("orderId",orderId);
params.put("custId",custId);
@ -39,8 +40,8 @@ public class MkClient {
params.put("actNum",actNum);
params.put("actSinglePrice",actSinglePrice);
params.put("totalPrice",totalPrice);
Map<String,Object> resultMap=callBizService.postForMap(restUrl,params);
tips= BaseUtils.mapToTips(resultMap);
params.put("workload",workload);
strRedisTemplate.convertAndSend("xm_task_settle", JSON.toJSONString(params));
return tips;
}
}
Loading…
Cancel
Save