}
public void confirmRechargehistory(User u,Rechargehistory rh,String confirmLx){
if(rh!=null&&rh.getCzzt()!=Rechargehistory.RECHARGEHISTORY_OVER){
Merchant _m = rh.getMerchant();
Organization _or = _m.getOrganization();
if(confirmLx.equals("1")){
rh.setCZQDR(u);
rh.setCzqdrq(new Date());
rh.setCzzt(Rechargehistory.RECHARGEHISTORY_OVER);
double flje = 0.0;
double czjfs=rh.getCZDHJFS();
Rebaterule re_rule = null;
if(_or != null&&!rh.getRESERVATION02().equals("02"))
{
if( _or.getJGLX().equals("2")){
re_rule = rebateRuleDao.findRebateRuleByLx("01");
double flqb = _or.getFlqb();
if(re_rule!=null){
flje = czjfs*re_rule.getFLLV();
Rebate re = new Rebate();
re.setFLED(flje);
re.setFLSJ(new Date());
re.setFLSYFBH(_or.getID());
re.setFLLX("01");
re.setRESERVATION01(_m.getSJMC());
re.setRESERVATION02(_m.getID()+"");
re.setRESERVATION03(_or.getJGMC());
_or.setFlqb(flqb+flje);
organizationDao.updateOrganization(_or);
rebateDao.createRebate(re);
}
}
if( _or.getJGLX().equals("3")){
re_rule = rebateRuleDao.findRebateRuleByLx("02");
double flqb = _or.getFlqb();
if(re_rule!=null){
flje = czjfs*re_rule.getFLLV();
Rebate re = new Rebate();
re.setFLED(flje);
re.setFLSJ(new Date());
re.setFLSYFBH(_or.getID());
re.setFLLX("02");
re.setRESERVATION01(_m.getSJMC());
re.setRESERVATION02(_m.getID()+"");
re.setRESERVATION03(_or.getJGMC());
_or.setFlqb(flqb+flje);
organizationDao.updateOrganization(_or);
rebateDao.createRebate(re);
}
}
if(_or.getJGLX().equals("4")){
re_rule = rebateRuleDao.findRebateRuleByLx("03");
double flqb = _or.getFlqb();
if(re_rule!=null){
flje = czjfs*re_rule.getFLLV();
Rebate re = new Rebate();
re.setFLED(flje);
re.setFLSJ(new Date());
re.setFLSYFBH(_or.getID());
re.setFLLX("03");
re.setRESERVATION01(_m.getSJMC());
re.setRESERVATION02(_m.getID()+"");
re.setRESERVATION03(_or.getJGMC());
_or.setFlqb(flqb+flje);
organizationDao.updateOrganization(_or);
rebateDao.createRebate(re);
}
}
Organization _por = _or.getSsjg();
if(_por != null && _por.getJGLX().equals("5")){
re_rule = rebateRuleDao.findRebateRuleByLx("04");
double flqb = _por.getFlqb();
if(re_rule!=null){
flje = czjfs*re_rule.getFLLV();
Rebate re = new Rebate();
re.setFLED(flje);
re.setFLSJ(new Date());
re.setFLSYFBH(_por.getID());
re.setFLLX("04");
re.setRESERVATION01(_m.getSJMC());
re.setRESERVATION02(_m.getID()+"");
re.setRESERVATION03(_por.getJGMC());
_por.setFlqb(flqb+flje);
organizationDao.updateOrganization(_por);
rebateDao.createRebate(re);
}
}
}