Commit 32918cb1 authored by tangfang's avatar tangfang

修改审核bug

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