Blame view

parking-module-bill/src/main/java/com/zteits/bill/biz/settlementrule/SettlementRuleServiceImpl.java 1.37 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  package com.zteits.bill.biz.settlementrule;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  import com.zteits.bill.dao.settlementrule.SettlementRuleDao;
  import com.zteits.bill.domain.TSettlementRule;
  import com.zteits.clouds.api.apibase.bean.BizResult;
  import com.zteits.clouds.api.dto.bill.settlementrule.param.QueryPlateFormServiceFeeReq;
  import com.zteits.clouds.api.service.bill.settlementrule.SettlementRuleService;
  @Component("com.zteits.bill.biz.settlementrule.SettlementRuleServiceImpl")
  public class SettlementRuleServiceImpl implements SettlementRuleService{
  	private static final Logger logger = LoggerFactory.getLogger(SettlementRuleServiceImpl.class);
  	@Autowired
  	private SettlementRuleDao settlementRuleDao;
  	@Override
  	public BizResult<Long> queryPlateFormServiceFee(QueryPlateFormServiceFeeReq req) {
  		logger.info("开始查询结算规则,plNo:"+req.getPlNo());
  		Double serviceRatio = 0d;
  		TSettlementRule tSettlementRule = settlementRuleDao.querySettlementRuleByPlNo(req.getPlNo());
  		if(tSettlementRule==null){
  			logger.info("未查询到结算规则,使用默认结算比例:0.3");
  			serviceRatio = 0.3;
  		}else{
  			serviceRatio = tSettlementRule.getSettlementRatio();
  		}
  		return new BizResult<Long>(req.getTotalFee()*serviceRatio.intValue());
  	}
  
  }