// 自提申请
  @Override
  @Transactional
  public String applicationByPickup(DeliveryOrder deliveryOrder) throws Exception {
    logger.info("自提申请");
    // 自提表
    IpoPickup ipoPickup = new IpoPickup();
    BeanUtils.copyProperties(deliveryOrder, ipoPickup);
    ipoPickupMapper.insert(ipoPickup);
    String pickupId = ipoPickup.getPickupId();

    // 提货单表
    IpoDeliveryorder ipoDeliveryorder = new IpoDeliveryorder();
    BeanUtils.copyProperties(deliveryOrder, ipoDeliveryorder);
    ipoDeliveryorder.setApprovalStatus(1);
    ipoDeliveryorder.setMethodId(pickupId);
    // 生成主键
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
    String id1 = sdf.format(new Date());
    String id2 = String.valueOf(ipoDeliveryorderMapper.sequence());
    String primaryKey = id1 + id2;
    ipoDeliveryorder.setDeliveryorderId(primaryKey);
    ipoDeliveryorder.setApplyDate(new Date());
    // 查询用户名称并插入表中
    String dealerId = ipoDeliveryorder.getDealerId();
    String dealername = ipoDeliveryorderMapper.selectByFrim(dealerId);
    ipoDeliveryorder.setDealerName(dealername);

    ipoDeliveryorderMapper.insert(ipoDeliveryorder);
    return "success";
  }
 // 撤销申请
 @Override
 @Transactional
 public String getRevocation(String deliveryorderid, String status) throws Exception {
   int status1 = Integer.parseInt(status);
   logger.info("撤销申请" + "deliveryorderid:" + deliveryorderid + "status:" + status1);
   ipoDeliveryorderMapper.updateByStatus(deliveryorderid, status1);
   return "success";
 }
 // 自提详细信息
 @Override
 public Pickup getDetail(String methodid) throws Exception {
   logger.info("自提信息信息" + "methodid:" + methodid);
   IpoPickupExtended ipoPickup = ipoDeliveryorderMapper.selectByPickUp(methodid);
   Pickup pickup = new Pickup();
   BeanUtils.copyProperties(ipoPickup, pickup);
   return pickup;
 }
 // 在线配送
 @Override
 public List<Express> getListByExpress(String page, String rows, Paging paging) throws Exception {
   logger.info("在线配送" + "用户ID:" + paging.getDealerId() + "单号:" + paging.getDeliveryorderId());
   page = (page == null ? "1" : page);
   rows = (rows == null ? "5" : rows);
   int curpage = Integer.parseInt(page);
   int pagesize = Integer.parseInt(rows);
   List<IpoExpressExtended> list1 =
       ipoDeliveryorderMapper.selectByExpress(
           (curpage - 1) * pagesize + 1, curpage * pagesize, paging);
   List<Express> list2 = new ArrayList<Express>();
   for (IpoExpressExtended ipoExpressExtended : list1) {
     Express express = new Express();
     BeanUtils.copyProperties(ipoExpressExtended, express);
     list2.add(express);
   }
   return list2;
 }
 // 自提打印
 @Override
 public List<DeliveryOrder> getPrint(String page, String rows, Paging paging) throws Exception {
   logger.info("自提打印:" + paging.getDealerId() + "单号:" + paging.getDeliveryorderId());
   page = (page == null ? "1" : page);
   rows = (rows == null ? "5" : rows);
   int curpage = Integer.parseInt(page);
   int pagesize = Integer.parseInt(rows);
   List<IpoDeliveryorder> list1 =
       ipoDeliveryorderMapper.selectByPickup(
           (curpage - 1) * pagesize + 1, curpage * pagesize, paging);
   List<DeliveryOrder> list2 = new ArrayList<DeliveryOrder>();
   for (IpoDeliveryorder ipoDeliveryorder : list1) {
     DeliveryOrder deliveryOrder = new DeliveryOrder();
     BeanUtils.copyProperties(ipoDeliveryorder, deliveryOrder);
     list2.add(deliveryOrder);
   }
   return list2;
 }
 // 提货查询总页数
 @Override
 public int countsByAll(Paging paging) throws Exception {
   logger.info("提货查询总页数" + "用户ID:" + paging.getDealerId() + "单号:" + paging.getDeliveryorderId());
   return ipoDeliveryorderMapper.allCounts(paging);
 }
 // 自提打印总页数
 @Override
 public int counts(Paging paging, String deliveryMethod) throws Exception {
   logger.info("自提打印总页数" + "userid:" + paging.getDealerId() + "单号:" + paging.getDeliveryorderId());
   return ipoDeliveryorderMapper.selectByCounts(paging, deliveryMethod);
 }