Commit 2e81033c authored by tangfang's avatar tangfang

修改审核bug

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