Search in sources :

Example 31 with Order

use of dataaccess.ex1.entity.Order in project jmix-docs by Haulmont.

the class Canvas method drawGeometry.

protected void drawGeometry() {
    Order order = ordersTable.getSingleSelected();
    CanvasLayer canvasLayer = map.getCanvas();
    CanvasLayer.Point location = canvasLayer.addPoint(order.getLocation());
    location.setStyle(geometryStyles.point().withFontIcon(JmixIcon.HOME).setIconPathFillColor("#f4d142").setIconTextFillColor("black").setIconPathStrokeColor("black")).setEditable(true);
}
Also used : Order(maps.ex1.entity.Order)

Example 32 with Order

use of dataaccess.ex1.entity.Order in project jmix-docs by Haulmont.

the class TaskAssignedNotificationSender2 method onOtherProcessTaskAssigned.

@EventListener
public void onOtherProcessTaskAssigned(UserTaskAssignedEvent event) {
    Order order = (Order) runtimeService.getVariable(event.getTask().getExecutionId(), "order");
    // ...
    // end::get-variable-1[]
    User user = dataManager.load(User.class).query("select u from smpl_User u where u.username = :username").parameter("username", event.getUsername()).one();
    Task task = event.getTask();
    String emailTitle = "New process task " + task.getName();
    String emailBody = "Hi " + user.getFirstName() + "\n" + "The task " + task.getName() + " has been assigned.";
    EmailInfo emailInfo = EmailInfoBuilder.create().setAddresses(user.getEmail()).setSubject(emailTitle).setFrom(null).setBody(emailBody).build();
    emailer.sendEmailAsync(emailInfo);
// tag::get-variable-2[]
}
Also used : Order(bpm.ex1.entity.Order) Task(org.flowable.task.api.Task) User(bpm.ex1.entity.User) EmailInfo(io.jmix.email.EmailInfo) EventListener(org.springframework.context.event.EventListener)

Example 33 with Order

use of dataaccess.ex1.entity.Order in project Today-I-Learn by kha0213.

the class OrderServiceTest method 주문취소.

@Test
public void 주문취소() throws Exception {
    // given
    Member member = createMember();
    Item book = createBook("JPA입문", 15000, 5);
    int orderCount = 2;
    // when
    Long orderId = orderService.order(member.getId(), book.getId(), orderCount);
    orderService.cancelOrder(orderId);
    // then
    Order getOrder = orderRepository.findOne(orderId);
    // 주문 취소 상태 검증
    assertEquals(OrderStatus.CANCEL, getOrder.getStatus());
    // 재고 원복 검증
    assertEquals(5, book.getStockQuantity());
}
Also used : Order(com.test.toyproject1.entity.Order) Item(com.test.toyproject1.entity.Item) Member(com.test.toyproject1.entity.Member) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

SpringBootTest (org.springframework.boot.test.context.SpringBootTest)18 Test (org.junit.jupiter.api.Test)17 Order (dataaccess.ex1.entity.Order)12 Order (security.ex1.entity.Order)6 OrderLine (dataaccess.ex1.entity.OrderLine)4 Subscribe (io.jmix.ui.screen.Subscribe)4 BigDecimal (java.math.BigDecimal)4 Order (maps.ex1.entity.Order)4 Order (bpm.ex1.entity.Order)3 UUID (java.util.UUID)3 EventListener (org.springframework.context.event.EventListener)3 Order (charts.ex1.entity.Order)2 Item (com.test.toyproject1.entity.Item)2 Member (com.test.toyproject1.entity.Member)2 Order (com.test.toyproject1.entity.Order)2 Customer (dataaccess.ex1.entity.Customer)2 Product (dataaccess.ex1.entity.Product)2 Order (datamodel.ex1.entity.Order)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2