Commit 32918cb1 authored by tangfang's avatar tangfang

修改审核bug

parent e4017cc8
......@@ -10,7 +10,6 @@ import freemarker.template.Configuration;
import freemarker.template.Template;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -21,7 +20,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.StandardProtocolFamily;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
......@@ -35,9 +33,12 @@ import java.nio.charset.StandardCharsets;
@Api(value = "合同模板类", description = "合同模板的查询,新增,修改,删除等相关操作")
public class AgreementController {
@Autowired
private AgreementService agreementService;
public AgreementController(AgreementService agreementService) {
this.agreementService = agreementService;
}
@RequestMapping(value = "/getListAgreement")
@ApiOperation(value = "获取合同模板列表", notes = "返回合同模板列表")
public ResponseResult getListAgreement(@RequestBody AgreementTemplateReqVo req) {
......
......@@ -20,6 +20,7 @@ import com.pangding.web.vo.system.req.CompanyMsgReqVo;
import com.pangding.web.vo.system.req.SystemWarnReqVo;
import com.pangding.web.vo.system.req.company.UpdateCompanyMoneyReqVo;
import com.pangding.web.vo.system.res.company.CompanyResVo;
import com.pangding.web.vo2.distribution.sound.req.SendMsgReqVo;
import com.pangding.web.vo2.user.company.req.CompanyOtherMoneyUpdateReqVo;
import com.rabbitmq.client.Channel;
import com.yanzuoguang.mq.service.MqService;
......@@ -236,6 +237,10 @@ public class CompanyConsumer {
payProducer.sendSound(soundReqVo);
}
public void thirdSendSound(SendMsgReqVo sendMsgReqVo) {
payProducer.thirdSendSound(sendMsgReqVo);
}
/**
* 同步公司信息
*
......
......@@ -10,14 +10,18 @@ import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.PageSizeData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@Service
@Component
public class AgreementServiceImpl implements AgreementService {
@Autowired
private AgreementTemplateDao agreementTemplateDao;
public AgreementServiceImpl(AgreementTemplateDao agreementTemplateDao) {
this.agreementTemplateDao = agreementTemplateDao;
}
@Override
public AgreementTemplateResVo findAgreementDetail(AgreementTemplateReqVo req) {
AgreementTemplateResVo agreementTemplateResVo = agreementTemplateDao.load(req, AgreementTemplateResVo.class);
......
......@@ -21,6 +21,7 @@ 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.pangding.web.vo.system.res.company.CompanyResVo;
import com.pangding.web.vo2.distribution.sound.req.SendMsgReqVo;
import com.yanzuoguang.util.base.ObjectHelper;
import com.yanzuoguang.util.helper.DateHelper;
import com.yanzuoguang.util.helper.JsonHelper;
......@@ -72,20 +73,12 @@ public class CompanyMsgServiceImpl implements CompanyMsgService {
System.out.println("请求参数:" + JsonHelper.serialize(deviceReqVo) + ",查询结果:" + JsonHelper.serialize(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);
if("a1hCrozAwg1".equals(deviceCode)){
// 通联音响
sendTonglianSound(reqVo, deviceResVo);
}else{
sendThirdSound(reqVo, deviceResVo);
}
}
SoundContentVo soundContentVo = new SoundContentVo();
......@@ -107,6 +100,37 @@ public class CompanyMsgServiceImpl implements CompanyMsgService {
}
public void sendTonglianSound(CompanyMsgReqVo reqVo, DeviceResVo 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);
}
public void sendThirdSound(CompanyMsgReqVo reqVo, DeviceResVo deviceResVo){
String deviceCode = deviceResVo.getDeviceCode();
SendMsgReqVo sendMsgReqVo = new SendMsgReqVo();
sendMsgReqVo.setMessage(reqVo.getMsgContent());
sendMsgReqVo.setTime(String.valueOf(System.currentTimeMillis()));
sendMsgReqVo.setType(1);
sendMsgReqVo.setDevid(deviceCode);
sendMsgReqVo.setOrderid("");
sendMsgReqVo.setPayment(100);
sendMsgReqVo.setReqid(StringHelper.getNewID());
companyConsumer.thirdSendSound(sendMsgReqVo);
}
public void checkCompanyExpirationDate(CompanyReqVo req){
CompanyResVo companyResVo = companyDao.load(req.getId(), CompanyResVo.class);
......
......@@ -24,15 +24,15 @@ import java.util.concurrent.TimeUnit;
public class CodeService {
private final DefaultKaptcha defaultKaptcha;
private final DebugConfig debugConfig;
private final PdDebugConfig pdDebugConfig;
@CreateCache(name = CacheName.USER_PASSWORD_CODE, cacheType = CacheType.REMOTE, expire = 60, timeUnit = TimeUnit.MINUTES)
private Cache<String, String> cache;
public CodeService(DefaultKaptcha defaultKaptcha, DebugConfig debugConfig) {
public CodeService(DefaultKaptcha defaultKaptcha, PdDebugConfig pdDebugConfig) {
this.defaultKaptcha = defaultKaptcha;
this.debugConfig = debugConfig;
this.pdDebugConfig = pdDebugConfig;
}
......@@ -55,7 +55,7 @@ public class CodeService {
// 对字节组Base64编码
String img = Base64.getEncoder().encodeToString(out.toByteArray());
CodeVo code = new CodeVo(StringHelper.getNewID(), img);
if (debugConfig.isDebug()) {
if (pdDebugConfig.isDebug()) {
code.setCode(text);
}
// 验证验证码文字
......
......@@ -4,7 +4,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class DebugConfig {
public class PdDebugConfig {
@Value("${pd.debug:false}")
private boolean debug;
@Value("${pd.debugLog:false}")
......@@ -12,7 +12,7 @@ public class DebugConfig {
@Value("${pd.cache:true}")
private boolean cache;
public DebugConfig() {
public PdDebugConfig() {
}
public boolean isDebug() {
......
......@@ -8,6 +8,8 @@ yzg:
PrintSql: true
pd:
debug: true
debugLog: false
cache: true
msg:
payMsgId: 4
......
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