Commit 86c7954e authored by tangf's avatar tangf

修改商户余额资金流水

parent a37eed89
......@@ -6,12 +6,14 @@ import com.pangding.web.authority.service.FinanceService;
import com.pangding.web.constant.MqConstant;
import com.pangding.web.constant.OrderConstant;
import com.pangding.web.mq.CompanyProducer;
import com.pangding.web.mq.OrderProducer;
import com.pangding.web.mq.PayProducer;
import com.pangding.web.vo.order.req.CapitalFlowReqVo;
import com.pangding.web.vo.order.req.OrderLogReqVo;
import com.pangding.web.vo.order.req.OrderMoneyDetailReqVo;
import com.pangding.web.vo.order.req.back.CashWithdrawalBackReqVo;
import com.pangding.web.vo.order.tl.CashWithdrawalReqVo;
import com.pangding.web.vo.order.tl.SoundReqVo;
import com.pangding.web.vo.system.req.CompanyMsgReqVo;
import com.rabbitmq.client.Channel;
import com.yanzuoguang.mq.service.MqService;
......@@ -37,6 +39,8 @@ public class CompanyConsumer {
@Autowired
private PayProducer payProducer;
@Autowired
private OrderProducer orderProducer;
@Autowired
private MqService mqService;
@Autowired
private CompanyService companyService;
......@@ -53,6 +57,15 @@ public class CompanyConsumer {
companyProducer.init();
}
/**
* 保存订单日志mq
*
* @param orderLogReqVo
*/
public void saveOrderLog(OrderLogReqVo orderLogReqVo) {
orderProducer.saveOrderLog(orderLogReqVo);
}
/**
* 申请提现
* @param capitalFlowReqVo
......@@ -117,13 +130,13 @@ public class CompanyConsumer {
// 保存订单日志MQ
OrderLogReqVo orderLogReqVo = new OrderLogReqVo(StringHelper.getNewID(), req.getId(), OrderConstant.ORDER_REFUND_BACK,
JsonHelper.serialize(req), "", req.getCompanyId(), "");
// saveOrderLog(orderLogReqVo);
saveOrderLog(orderLogReqVo);
} catch (Exception e) {
Log.error(CompanyConsumer.class, e);
// 保存订单日志MQ
OrderLogReqVo orderLogReqVo = new OrderLogReqVo(StringHelper.getNewID(), req.getId(), OrderConstant.ORDER_REFUND_BACK,
JsonHelper.serialize(req), e.getMessage(), req.getCompanyId(), "");
// saveOrderLog(orderLogReqVo);
saveOrderLog(orderLogReqVo);
} finally {
mqService.basicAck(message, channel);
}
......@@ -180,4 +193,13 @@ public class CompanyConsumer {
}
}
/**
* 通联发送语音
*
* @param soundReqVo
*/
public void sendSound(SoundReqVo soundReqVo) {
payProducer.sendSound(soundReqVo);
}
}
......@@ -3,25 +3,27 @@ package com.pangding.web.authority.service.impl;
import com.pangding.web.authority.dao.CompanyMsgDao;
import com.pangding.web.authority.dao.DeviceDao;
import com.pangding.web.authority.dao.UserDao;
import com.pangding.web.authority.mq.CompanyConsumer;
import com.pangding.web.authority.service.CompanyMsgService;
import com.pangding.web.constant.CompanyConstant;
import com.pangding.web.partner.mq.PartnerProcedure;
import com.pangding.web.partner.vo.req.SoundContentVo;
import com.pangding.web.vo.order.tl.SoundContentInfoVo;
import com.pangding.web.vo.order.tl.SoundContentReqVo;
import com.pangding.web.vo.order.tl.SoundReqVo;
import com.pangding.web.vo.system.req.CompanyMsgReqVo;
import com.pangding.web.vo.system.req.DeviceReqVo;
import com.pangding.web.vo.system.req.authority.UserReqVo;
import com.pangding.web.vo.system.res.CompanyMsgResVo;
import com.pangding.web.vo.system.res.DeviceResVo;
import com.pangding.web.vo.system.res.authority.UserResVo;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.PageSizeData;
import com.yanzuoguang.util.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class CompanyMsgServiceImpl implements CompanyMsgService{
public class CompanyMsgServiceImpl implements CompanyMsgService {
@Autowired
private CompanyMsgDao companyMsgDao;
......@@ -31,15 +33,17 @@ public class CompanyMsgServiceImpl implements CompanyMsgService{
private DeviceDao deviceDao;
@Autowired
private PartnerProcedure partnerProcedure;
@Autowired
private CompanyConsumer companyConsumer;
@Override
public PageSizeData<CompanyMsgResVo> findCompanyMsgList(CompanyMsgReqVo req){
public PageSizeData<CompanyMsgResVo> findCompanyMsgList(CompanyMsgReqVo req) {
return companyMsgDao.findPageCompanyMsgList(req);
}
@Override
public ResponseResult saveCompanyMsg(CompanyMsgReqVo reqVo){
public ResponseResult saveCompanyMsg(CompanyMsgReqVo reqVo) {
companyMsgDao.create(reqVo);
......@@ -48,22 +52,36 @@ public class CompanyMsgServiceImpl implements CompanyMsgService{
soundContentVo.setTipSound(reqVo.getMsgSound());
soundContentVo.setTipUrl("http://frapp.pangdly.com?msg=" + soundContentVo.getTipContent());
UserReqVo userReqVo = new UserReqVo();
userReqVo.setCompanyId(reqVo.getCompanyId());
List<UserResVo> userResList = userDao.loadList(userReqVo, UserResVo.class);
for(int i = 0; i < userResList.size(); i++){
if(1 == userResList.get(i).getReceiveFlag()){
partnerProcedure.sendSoundContent(userResList.get(i).getId(), soundContentVo);
}
}
// UserReqVo userReqVo = new UserReqVo();
// userReqVo.setCompanyId(reqVo.getCompanyId());
// List<UserResVo> userResList = userDao.loadList(userReqVo, UserResVo.class);
// for (int i = 0; i < userResList.size(); i++) {
// if (1 == userResList.get(i).getReceiveFlag()) {
// partnerProcedure.sendSoundContent(userResList.get(i).getId(), soundContentVo);
// }
// }
DeviceReqVo deviceReqVo = new DeviceReqVo();
deviceReqVo.setCompanyId(reqVo.getCompanyId());
deviceReqVo.setDeviceType(CompanyConstant.DEVICE_SOUND);
DeviceResVo deviceResVo = deviceDao.load(deviceReqVo, DeviceResVo.class);
if(StringHelper.isEmpty(deviceResVo)){
if (!StringHelper.isEmpty(deviceResVo)) {
String deviceCode = deviceResVo.getDeviceCode();
String deviceName = deviceResVo.getDeviceName();
SoundContentInfoVo soundContentInfoVo = new SoundContentInfoVo();
soundContentInfoVo.setMsg_content(reqVo.getMsgContent());
soundContentInfoVo.setMsg_id(reqVo.getId());
soundContentInfoVo.setVoice_speed("50");
SoundContentReqVo soundContentReqVo = new SoundContentReqVo();
soundContentReqVo.setInfo(soundContentInfoVo);
soundContentReqVo.setType("audio");
SoundReqVo soundReqVo = new SoundReqVo();
soundReqVo.setContent(soundContentReqVo);
soundReqVo.setProKey(deviceCode);
soundReqVo.setTopicName("/" + deviceCode + "/" + deviceName + "/user/report");
companyConsumer.sendSound(soundReqVo);
}
return ResponseResult.result("处理成功");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment