MockUtils.java 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.nb.bus.utils;
  2. import cn.hutool.core.util.RandomUtil;
  3. import com.nb.bus.entity.BusDeviceRunningEntity;
  4. import com.nb.bus.enums.DeviceTypeEnum;
  5. import java.math.BigDecimal;
  6. import java.util.Date;
  7. /**
  8. * @author lifang
  9. * @version 1.0.0
  10. * @ClassName MockUtils.java
  11. * @Description TODO
  12. * @createTime 2022年05月05日 14:29:00
  13. */
  14. public class MockUtils {
  15. public static BusDeviceRunningEntity mock(String deviceId,String patientCode,String classify,DeviceTypeEnum type){
  16. BusDeviceRunningEntity pump = new BusDeviceRunningEntity();
  17. pump.setType(type);
  18. pump.setClassification(classify);
  19. pump.setDeviceId(deviceId);
  20. pump.setPatientCode(patientCode);
  21. pump.setTotalDose(RandomUtil.randomInt(100));
  22. pump.setFirstDose(RandomUtil.randomInt(100));
  23. pump.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  24. pump.setInputDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  25. pump.setAppendDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  26. pump.setAppendLockTime(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  27. pump.setMaxDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  28. // pump.setSelfControlCount(RandomUtil.randomInt(100));
  29. pump.setSelfControlLockTime(RandomUtil.randomInt(100));
  30. pump.setFirstDose(RandomUtil.randomInt(100));
  31. pump.setRemainDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  32. pump.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  33. pump.setSelfControlLockTime(RandomUtil.randomInt(100));
  34. pump.setPcaValidCount(RandomUtil.randomInt(100));
  35. pump.setPcaInvalidCount(RandomUtil.randomInt(100));
  36. pump.setPcaTotalCount(pump.getPcaInvalidCount()+pump.getPcaValidCount());
  37. pump.setContinueDose(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  38. pump.setPulseDose(RandomUtil.randomInt(100));
  39. pump.setPulseLockTime(RandomUtil.randomInt(100));
  40. pump.setPulseFirstLockTime(RandomUtil.randomInt(100));
  41. pump.setFlowAdjustRate(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  42. pump.setFlowCount(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  43. pump.setFlowDownCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  44. pump.setFlowDownLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  45. pump.setFlowUpCycle(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  46. pump.setFlowUpLimit(BigDecimal.valueOf(RandomUtil.randomInt(100)));
  47. pump.setUploadTime(new Date());
  48. return pump;
  49. }
  50. }