|
@@ -1,65 +1,65 @@
|
|
-package com.imed.costaccount.service.impl;
|
|
|
|
-
|
|
|
|
-import com.imed.costaccount.common.util.PageUtils;
|
|
|
|
-import com.imed.costaccount.model.Allocation;
|
|
|
|
-import com.imed.costaccount.service.AccountingService;
|
|
|
|
-import com.imed.costaccount.service.AllocationService;
|
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
-import org.junit.Assert;
|
|
|
|
-import org.junit.Test;
|
|
|
|
-import org.junit.runner.RunWith;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
-import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-
|
|
|
|
-@RunWith(SpringRunner.class)
|
|
|
|
-@SpringBootTest
|
|
|
|
-@Slf4j
|
|
|
|
-public class AllocationServiceImplTest {
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private AllocationService allocationService;
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void testShareAfterQueryTest() {
|
|
|
|
- String year = "2021-01-01";
|
|
|
|
- String responsibilityCode = "";
|
|
|
|
- int current = 1;
|
|
|
|
- int pageSize = 10;
|
|
|
|
- long hospId = 11L;
|
|
|
|
- PageUtils pageUtils = allocationService.queryAfterAllocation(year, responsibilityCode, current, pageSize, hospId);
|
|
|
|
- Assert.assertNotNull(pageUtils);
|
|
|
|
- log.info("pageUtils={}", pageUtils);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- @Transactional
|
|
|
|
- public void testTransaction1() {
|
|
|
|
- Allocation before = allocationService.getById(40);
|
|
|
|
|
|
+//package com.imed.costaccount.service.impl;
|
|
|
|
+//
|
|
|
|
+//import com.imed.costaccount.common.util.PageUtils;
|
|
|
|
+//import com.imed.costaccount.model.Allocation;
|
|
|
|
+//import com.imed.costaccount.service.AccountingService;
|
|
|
|
+//import com.imed.costaccount.service.AllocationService;
|
|
|
|
+//import lombok.extern.slf4j.Slf4j;
|
|
|
|
+//import org.junit.Assert;
|
|
|
|
+//import org.junit.Test;
|
|
|
|
+//import org.junit.runner.RunWith;
|
|
|
|
+//import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+//import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
+//import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
+//import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+//
|
|
|
|
+//@RunWith(SpringRunner.class)
|
|
|
|
+//@SpringBootTest
|
|
|
|
+//@Slf4j
|
|
|
|
+//public class AllocationServiceImplTest {
|
|
|
|
+//
|
|
|
|
+// @Autowired
|
|
|
|
+// private AllocationService allocationService;
|
|
|
|
+//
|
|
|
|
+// @Test
|
|
|
|
+// public void testShareAfterQueryTest() {
|
|
|
|
+// String year = "2021-01-01";
|
|
|
|
+// String responsibilityCode = "";
|
|
|
|
+// int current = 1;
|
|
|
|
+// int pageSize = 10;
|
|
|
|
+// long hospId = 11L;
|
|
|
|
+// PageUtils pageUtils = allocationService.queryAfterAllocation(year, responsibilityCode, current, pageSize, hospId);
|
|
|
|
+// Assert.assertNotNull(pageUtils);
|
|
|
|
+// log.info("pageUtils={}", pageUtils);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @Test
|
|
|
|
+// @Transactional
|
|
|
|
+// public void testTransaction1() {
|
|
|
|
+// Allocation before = allocationService.getById(40);
|
|
|
|
+//// allocationService.removeById(40);
|
|
|
|
+// try {
|
|
|
|
+// Thread.sleep(1000);
|
|
|
|
+// } catch (InterruptedException e) {
|
|
|
|
+// throw new RuntimeException("111");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// Allocation after = allocationService.getById(40);
|
|
|
|
+// Assert.assertEquals(before, after);
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// @Test
|
|
|
|
+// public void test() {
|
|
|
|
+// new Thread(this::testTransaction1).start();
|
|
|
|
+// new Thread(this::testDel).start();
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// @Test
|
|
|
|
+// @Transactional
|
|
|
|
+// public void testDel() {
|
|
// allocationService.removeById(40);
|
|
// allocationService.removeById(40);
|
|
- try {
|
|
|
|
- Thread.sleep(1000);
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
|
- throw new RuntimeException("111");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Allocation after = allocationService.getById(40);
|
|
|
|
- Assert.assertEquals(before, after);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void test() {
|
|
|
|
- new Thread(this::testTransaction1).start();
|
|
|
|
- new Thread(this::testDel).start();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- @Transactional
|
|
|
|
- public void testDel() {
|
|
|
|
- allocationService.removeById(40);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//}
|