Test1.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package com.tuoren.web;
  2. import com.tuoren.TuorenApplication;
  3. import com.tuoren.web.layer.controller.BusPatientController;
  4. import com.tuoren.web.layer.d0.PumpRemoveRequestDTO;
  5. import com.tuoren.web.layer.d0.PumpVo;
  6. import com.tuoren.web.layer.entity.BusPatientEntity;
  7. import com.tuoren.web.layer.service.IBusPatientService;
  8. import com.tuoren.web.layer.service.impl.BusPumpServiceImpl;
  9. import com.tuoren.web.layer.vo.PumpParam;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.junit.Test;
  12. import org.junit.runner.RunWith;
  13. import org.springframework.amqp.rabbit.core.RabbitTemplate;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.boot.test.context.SpringBootTest;
  16. import org.springframework.test.context.junit4.SpringRunner;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import javax.annotation.Resource;
  19. import java.util.Arrays;
  20. import java.util.Date;
  21. import java.util.List;
  22. /**
  23. * @ClassName : Test
  24. * @Description :
  25. * @Author : LF
  26. * @Date: 2025年03月12日
  27. */
  28. @RunWith(SpringRunner.class)
  29. @Slf4j
  30. @SpringBootTest(classes = TuorenApplication.class)
  31. public class Test1 {
  32. @Autowired
  33. private RabbitTemplate rabbitTemplate;
  34. @Resource
  35. private BusPumpServiceImpl busPumpService;
  36. @Resource
  37. private BusPatientController busPatientController;
  38. @Resource
  39. private IBusPatientService iBusPatientEntityService;
  40. @Test
  41. public void test() throws Exception {
  42. rabbitTemplate.convertAndSend("removePump","123412412", Arrays.asList("12","23","3455"));
  43. }
  44. @Test
  45. public void test2() throws Exception {
  46. PumpRemoveRequestDTO pumpRemoveRequestDTO = new PumpRemoveRequestDTO();
  47. pumpRemoveRequestDTO.setIds(Arrays.asList("382"));
  48. pumpRemoveRequestDTO.setRemoveUser("admin");
  49. pumpRemoveRequestDTO.setUndoTime(new Date());
  50. busPumpService.removePumpNew(pumpRemoveRequestDTO);
  51. }
  52. @Test
  53. public void test3() throws Exception {
  54. BusPatientEntity busPatientEntity = new BusPatientEntity();
  55. busPatientEntity.setPatientId("007a44e8-8c33-449f-bb96-78144352cfbc");
  56. /**
  57. * @return void
  58. * @author wangzl
  59. * @date 2025/6/18
  60. * @description
  61. *
  62. * "anesthesiaMode":"这是我的麻醉方式",
  63. * "bedCode":"这是我的床号",
  64. * "patientId":"ad649e03-7b5c-4f94-9a37-b994012b0120",
  65. * "sex":"男","name":"这是我的姓名",
  66. * "operationName":"这是我的手术名称",
  67. * "wardCode":"这是我的病区",
  68. * "operationDoctor":"这是我的手术医生",
  69. * "easyMode":"这是我的镇痛方式",
  70. * "patientCode":"5210800000000"
  71. */
  72. busPatientEntity.setAnesthesiaMode("这是我的麻醉方式");
  73. busPatientEntity.setBedCode("这是我的床号");
  74. busPatientEntity.setName("这是我的姓名");
  75. busPatientEntity.setOperationName("这是我的手术名称");
  76. busPatientEntity.setWardCode("这是我的病区");
  77. busPatientEntity.setOperationDoctor("这是我的手术医生");
  78. busPatientEntity.setEasyMode("这是我的镇痛方式");
  79. busPatientEntity.setPatientCode("5210800000000");
  80. boolean flag = this.iBusPatientEntityService.updateById(busPatientEntity);
  81. System.out.println(flag);
  82. if(flag){
  83. iBusPatientEntityService.sendPatientInfoToPump(busPatientEntity.getPatientId());
  84. }
  85. }
  86. @Test
  87. public void test4() throws Exception {
  88. PumpParam pumpParam = new PumpParam();
  89. pumpParam.setPumpCode("4319571630430293");
  90. pumpParam.setHospitalCode("5490dd8896e54ecab824b006074361de");
  91. pumpParam.setPatientId("5d892e4f-7c85-40b3-8b4d-8006f3771e2f");
  92. // pumpParam.setPatientCode("436167");
  93. List<PumpVo> pumpVos = busPumpService.queryPumpInfo(pumpParam);
  94. System.out.println(pumpVos);
  95. }
  96. }