// 自提申请 @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 public Pickup getDetailByPickup(String methodid) throws Exception { logger.info("提货查询(自提)详细信息" + "methodid:" + methodid); IpoPickup ipoPickup = ipoPickupMapper.selectByPrimaryKey(methodid); Pickup pickup = new Pickup(); BeanUtils.copyProperties(ipoPickup, pickup); return pickup; }