RbService.java 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.bofeng.service;
  2. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  3. import com.bofeng.dao.QzTaskDao;
  4. import com.bofeng.dao.RbMapper;
  5. import com.bofeng.entity.*;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import java.text.SimpleDateFormat;
  9. import java.util.Date;
  10. import java.util.List;
  11. @Service
  12. public class RbService {
  13. @Autowired
  14. private RbMapper rbMapper;
  15. public List<sysUptownUnit> selectAll (Long userId) {
  16. List<sysUptownUnit> sysUptownUnits = rbMapper.selectDY(userId);
  17. return sysUptownUnits;
  18. }
  19. public List<SysUptownHouse> selectXq (Long str) {
  20. // userId = 1224706869998772226L;
  21. // List<SysUptownHouse> sysUptownHouses = rbMapper.selectList(new EntityWrapper<SysUptownHouse>().eq("ridgepole",ridgepole).eq("unit",unit));
  22. Date date = new Date();
  23. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
  24. String dateStr = simpleDateFormat.format(date);
  25. List<SysUptownHouse> sysUptownHousesss = rbMapper.selectMp(str,dateStr);
  26. return sysUptownHousesss;
  27. }
  28. public List<MsSuspected> selectYcXq (Long houseId) {
  29. Date date = new Date();
  30. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
  31. String dateStr = simpleDateFormat.format(date);
  32. List<MsSuspected> sysUptownHouses = rbMapper.selectYcXq(houseId, dateStr);
  33. String bingqingDesc = "";
  34. if(sysUptownHouses.size() != 0 ){
  35. for (int i = 0; i < sysUptownHouses.size(); i++) {
  36. Integer cough = sysUptownHouses.get(i).getCough();
  37. if(cough != null && cough ==1){
  38. bingqingDesc += "偶尔短暂咳嗽、";
  39. }else if(cough != null && cough ==2){
  40. bingqingDesc += "咳嗽轻度影响生活、";
  41. }else if(cough != null && cough ==3){
  42. bingqingDesc += "咳嗽严重影响生活、";
  43. }
  44. Integer muscle = sysUptownHouses.get(i).getMuscle();
  45. if(muscle != null && muscle ==1){
  46. bingqingDesc += "肌肉按压有酸痛、";
  47. }else if(muscle != null && muscle ==2){
  48. bingqingDesc += "偶尔肌肉按压酸痛、";
  49. }else if(muscle != null && muscle ==3){
  50. bingqingDesc += "肌肉按压持续酸痛、";
  51. }
  52. Integer dyspnea = sysUptownHouses.get(i).getDyspnea();
  53. if(dyspnea != null && dyspnea ==1){
  54. bingqingDesc += "呼吸急走或上坡气短、";
  55. }else if(dyspnea != null && dyspnea ==2){
  56. bingqingDesc += "呼吸气短而走路变慢、";
  57. }else if(dyspnea != null && dyspnea ==3){
  58. bingqingDesc += "呼吸走路数分钟后气短、";
  59. }else if(dyspnea != null && dyspnea ==4){
  60. bingqingDesc += "呼吸气短无法离开房间、";
  61. }
  62. Integer fatigue = sysUptownHouses.get(i).getFatigue();
  63. if(fatigue !=null && fatigue == 1){
  64. bingqingDesc += "可体力劳动但觉得累、";
  65. }else if(fatigue !=null && fatigue == 2){
  66. bingqingDesc += "轻体力劳动后长时间不能恢复、";
  67. }else if(fatigue !=null && fatigue == 3){
  68. bingqingDesc += "不能正常生活、";
  69. }
  70. Integer diarrhea = sysUptownHouses.get(i).getDiarrhea();
  71. if(diarrhea !=null && diarrhea == 1){
  72. bingqingDesc += "轻度腹泻少于于3次、";
  73. }else if(diarrhea !=null && diarrhea == 2){
  74. bingqingDesc += "中度腹泻4-6次、";
  75. }else if(diarrhea !=null && diarrhea == 3){
  76. bingqingDesc += "重度腹泻超过6次、";
  77. }
  78. Integer singleRoom = sysUptownHouses.get(i).getSingleRoom();
  79. if(singleRoom != null && singleRoom == 1){
  80. bingqingDesc += "单间隔离";
  81. }
  82. sysUptownHouses.get(i).setZhengzhuang(bingqingDesc);
  83. }
  84. }
  85. return sysUptownHouses;
  86. }
  87. }