Commit 2e81033c authored by tangfang's avatar tangfang

修改审核bug

parent 39a3c049
......@@ -278,7 +278,7 @@ public class CompanyConsumer {
public void companyReward(String content, Message message, Channel channel) {
try {
CompanyResVo companyResVo = JsonHelper.deserialize(content, CompanyResVo.class);
companyService.companyReward(companyResVo);
// companyService.companyReward(companyResVo);
} catch (Exception e) {
Log.error(CompanyConsumer.class, e);
} finally {
......
......@@ -42,7 +42,8 @@ public class CompanyOtherMoneySavePdServiceImpl implements CompanyOtherMoneySave
if (!StringHelper.isEmpty(req.getCompanyId())){
// 检查改公司是否已经添加
CompanyRelationVo companyRelationVo = companyOtherMoneyUtil.checkCompanyRelation(req.getCompanyId(), companyOtherMoneyVo.getCompanyId());
CompanyRelationVo companyRelationVo = companyOtherMoneyUtil.checkCompanyRelation(req.getCompanyId(),
companyOtherMoneyVo.getCompanyId(), companyOtherMoneyVo.getCompanyOtherMoneyId());
if (StringHelper.isEmpty(companyRelationVo)) {
companyRelationVo = new CompanyRelationVo();
companyRelationVo.setCompanyId(companyOtherMoneyVo.getCompanyId());
......@@ -52,7 +53,7 @@ public class CompanyOtherMoneySavePdServiceImpl implements CompanyOtherMoneySave
companyRelationVo.setCreateTime(DateHelper.getNow());
companyRelationVo.setCompanyRelationId(StringHelper.getNewID());
companyRelationVo.setRelationType("2");
companyRelationVo.setRelationId(companyOtherMoneyId);
companyRelationVo.setRelationId(companyOtherMoneyVo.getCompanyOtherMoneyId());
temp.getCompanyRelationVoList().add(companyRelationVo);
}
}
......
......@@ -44,7 +44,8 @@ public class CompanyOtherMoneySaveServiceImpl implements CompanyOtherMoneySaveSe
if (!StringHelper.isEmpty(req.getCompanyId())){
// 检查改公司是否已经添加
CompanyRelationVo companyRelationVo = companyOtherMoneyUtil.checkCompanyRelation(req.getCompanyId(), companyOtherMoneyVo.getCompanyId());
CompanyRelationVo companyRelationVo = companyOtherMoneyUtil.checkCompanyRelation(req.getCompanyId(),
companyOtherMoneyVo.getCompanyId(), companyOtherMoney.getCompanyOtherMoneyId());
if (StringHelper.isEmpty(companyRelationVo)) {
companyRelationVo = new CompanyRelationVo();
companyRelationVo.setCompanyId(companyOtherMoneyVo.getCompanyId());
......
......@@ -131,13 +131,16 @@ public class CompanyOtherMoneyServiceImpl implements CompanyOtherMoenyService {
updateReq.setCompanyId(req.getCompanyId());
updateReq.setMerchantId(req.getMerchantId());
double otherMoney = 0;
double superOther = 0;
if(!StringHelper.isEmpty(req.getMoneyType()) && 11 == req.getMoneyType()){
// 消费
otherMoney = -req.getOtherMoney();
superOther = -req.getSuperOtherMoney();
}
if(!StringHelper.isEmpty(req.getMoneyType()) && 12 == req.getMoneyType()){
// 退票
otherMoney = req.getOtherMoney();
superOther = req.getSuperOtherMoney();
}
updateReq.setOtherMoney(otherMoney);
companyOtherMoneyDao.updateMoney(updateReq);
......@@ -157,7 +160,7 @@ public class CompanyOtherMoneyServiceImpl implements CompanyOtherMoenyService {
CompanyOtherMoneyUpdateReqVo superUpdateReq = new CompanyOtherMoneyUpdateReqVo();
superUpdateReq.setCompanyId(companyRelationVo.getCompanyPid());
superUpdateReq.setMerchantId(req.getMerchantId());
superUpdateReq.setOtherMoney(otherMoney);
superUpdateReq.setOtherMoney(superOther);
companyOtherMoneyDao.updateMoney(superUpdateReq);
}
}
......
......@@ -18,10 +18,11 @@ public class CompanyOtherMoneyUtil {
this.companyOtherMoneyDao = companyOtherMoneyDao;
}
public CompanyRelationVo checkCompanyRelation(String companyPid, String companyId){
public CompanyRelationVo checkCompanyRelation(String companyPid, String companyId, String relationId){
CompanyRelationVo req = new CompanyRelationVo();
req.setCompanyPid(companyPid);
req.setCompanyId(companyId);
req.setRelationId(relationId);
CompanyRelationVo companyRelationVo = companyRelationDao.load(req, CompanyRelationVo.class);
return companyRelationVo;
}
......
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