Blame view

parking-module-bill/src/main/java/com/zteits/bill/biz/billingprement/BillingPrepaymentServiceImpl.java 2.25 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  package com.zteits.bill.biz.billingprement;
  
  import java.util.List;
  
  import org.apache.commons.lang3.StringUtils;
  import com.zteits.bill.dao.billprepayment.BillingPrepaymentDao;
  import com.zteits.clouds.api.apibase.bean.BizResult;
  import com.zteits.clouds.api.apibase.constants.ErrorType;
  import com.zteits.clouds.api.apibase.exception.BizException;
  import com.zteits.clouds.api.dto.bill.billprepayment.dto.BillingPrepaymentDTO;
  import com.zteits.clouds.api.dto.bill.billprepayment.param.BillingPrepaymentInfoQueryReq;
  import com.zteits.clouds.api.dto.bill.billprepayment.param.BillingPrepaymentQueryReq;
  import com.zteits.clouds.api.service.bill.billprepayment.BillingPrepaymentService;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  /**
   * Copyright: Copyright (c) 2017  zteits
   *
   * @ClassName: com.zteits.bill.biz.billingprement
   * @Description:
   * @version: v1.0.0
   * @author: atao
   * @date: 2017/11/15   下午7:15
   * Modification History:
   * Date         Author          Version      Description
   * ---------------------------------------------------------*
   * 2017/11/15      atao          v1.0.0          创建
   */
  @Component
  public class BillingPrepaymentServiceImpl implements BillingPrepaymentService {
      @Autowired
      private BillingPrepaymentDao billingPrepaymentDao;
  
      @Override
      public BizResult<BillingPrepaymentDTO> queryBillingPrepayment(BillingPrepaymentQueryReq req) {
          if (StringUtils.isBlank(req.getPlNo())) {
              throw new BizException(ErrorType.PARAMM_NULL, "停车场编号");
          }
  
          if (null == req.getCarType()) {
              throw new BizException(ErrorType.PARAMM_NULL, "车辆类型");
          }
  
          BillingPrepaymentDTO dto = billingPrepaymentDao.queryBillingPrepayment(req.getPlNo(), req.getCarType());
  
          return new BizResult<>(dto);
      }
  
      @Override
      public BizResult<List<BillingPrepaymentDTO>> queryBillingPrepaymentInfo(BillingPrepaymentInfoQueryReq req) {
          if (StringUtils.isBlank(req.getPlNo())) {
              throw new BizException(ErrorType.PARAMM_NULL, "停车场编号");
          }
  
          List<BillingPrepaymentDTO> dtos = billingPrepaymentDao.queryBillingPrepaymentInfo(req.getPlNo());
          return new BizResult<>(dtos);
      }
  }