zhaozhiqiang лет назад: 5
Родитель
Сommit
5dcee788a1

+ 27 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/Department.cs

@@ -0,0 +1,27 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+    /// <summary>
11
+    /// 科室表
12
+    /// </summary>
13
+   public  class Department : IBaseModel<string>
14
+    {
15
+
16
+        /// <summary>
17
+        /// id
18
+        /// </summary>
19
+        [Key]
20
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
21
+        public string id { get; set; }
22
+        /// <summary>
23
+        /// 科室名称
24
+        /// </summary>
25
+        public string  name { get; set; }
26
+    }
27
+}

+ 30 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/Doctorlists.cs

@@ -0,0 +1,30 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+    /// <summary>
11
+    /// 医生表
12
+    /// </summary>
13
+   public  class Doctorlists : IBaseModel<string>
14
+    {
15
+        /// <summary>
16
+        /// id
17
+        /// </summary>
18
+        [Key]
19
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
20
+        public string id { get; set; }
21
+        /// <summary>
22
+        /// 医生姓名
23
+        /// </summary>
24
+        public string  doctorname { get; set; }
25
+        /// <summary>
26
+        /// 科室编号
27
+        /// </summary>
28
+        public string  departmentid { get; set; }
29
+    }
30
+}

+ 5 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/TestPager.cs

@@ -27,6 +27,11 @@ namespace MadRunFabric.Model.TestUserTypeApi
27 27
         /// 题目问题
28 28
         /// </summary>
29 29
         public string testtitle { get; set; }
30
+
31
+        /// <summary>
32
+        /// 题目类型
33
+        /// </summary>
34
+        public string tesquestionType { get; set; }
30 35
         /// <summary>
31 36
         /// 选项编号
32 37
         /// </summary>

+ 43 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/diagnosisinbases.cs

@@ -0,0 +1,43 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+   public  class diagnosisinbases : IBaseModel<string>
11
+    {
12
+        /// <summary>
13
+        /// id
14
+        /// </summary>
15
+        [Key]
16
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
17
+        public string id { get; set; }
18
+        /// <summary>
19
+        /// 参加会诊人姓名
20
+        /// </summary>
21
+        public string diagnoname { get; set; }
22
+        /// <summary>
23
+        /// 参加会诊人手机号
24
+        /// </summary>
25
+        public string diagnotel { get; set; }
26
+        /// <summary>
27
+        /// 参加会诊人电话号
28
+        /// </summary>
29
+        public string diagnophone { get; set; }
30
+        /// <summary>
31
+        /// 创建时间
32
+        /// </summary>
33
+        public DateTime? createdate { get; set; }
34
+        /// <summary>
35
+        /// 是否通知
36
+        /// </summary>
37
+        public string isnotice { get; set; }
38
+        /// <summary>
39
+        /// 是否删除
40
+        /// </summary>
41
+        public int isdelete { get; set; }
42
+    }
43
+}

+ 64 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/diagnosisinfo.cs

@@ -0,0 +1,64 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+    /// <summary>
11
+    /// 会诊信息表
12
+    /// </summary>
13
+    public   class diagnosisinfo : IBaseModel<string>
14
+    {
15
+        /// <summary>
16
+        /// id
17
+        /// </summary>
18
+        [Key]
19
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
20
+        public string id { get; set; }
21
+
22
+        /// <summary>
23
+        /// 患者表id
24
+        /// </summary>
25
+        public string patientid { get; set; }
26
+        /// <summary>
27
+        /// 科室id
28
+        /// </summary>
29
+        public string Departmentid { get; set; }
30
+        /// <summary>
31
+        /// 会诊医生编号
32
+        /// </summary>
33
+        public string Hzdoctorid { get; set; }
34
+        /// <summary>
35
+        /// 发起申请人
36
+        /// </summary>
37
+        public string Qdoctorid { get; set; }
38
+        /// <summary>
39
+        /// 会诊内容
40
+        /// </summary>
41
+        public string diagnosiscenter { get; set; }
42
+
43
+        /// <summary>
44
+        /// 会诊结果
45
+        /// </summary>
46
+        public string diagnosisresult { get; set; }
47
+        /// <summary>
48
+        /// 发起请求时间
49
+        /// </summary>
50
+        public DateTime? playdate { get; set; }
51
+        /// <summary>
52
+        /// 会诊时间点
53
+        /// </summary>
54
+        public DateTime? playingdate { get; set; }
55
+        /// <summary>
56
+        /// 结束时间
57
+        /// </summary>
58
+        public DateTime? enddate { get; set; }
59
+        /// <summary>
60
+        /// 是否删除
61
+        /// </summary>
62
+        public int isdelete { get; set; }
63
+    }
64
+}

+ 48 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/equipmentmanagementlist.cs

@@ -0,0 +1,48 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+   public  class equipmentmanagementlist : IBaseModel<string>
11
+    {
12
+        /// <summary>
13
+        /// id
14
+        /// </summary>
15
+        [Key]
16
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
17
+        public string id { get; set; }
18
+        /// <summary>
19
+        /// 设备编号
20
+        /// </summary>
21
+        public string equipmentmanagementsid { get; set; }
22
+        /// <summary>
23
+        /// 设备名称
24
+        /// </summary>
25
+        public string equipmentmanagementsname { get; set; }
26
+        /// <summary>
27
+        /// 申请科室
28
+        /// </summary>
29
+        public string Qdepartment { get; set; }
30
+        /// <summary>
31
+        /// 申请时间
32
+        /// </summary>
33
+        public DateTime? Qqtime { get; set; }
34
+
35
+        /// <summary>
36
+        /// 出库时间
37
+        /// </summary>
38
+        public DateTime? Cktime { get; set; }
39
+        /// <summary>
40
+        /// 入库时间
41
+        /// </summary>
42
+        public DateTime? Rktime { get; set; }
43
+        /// <summary>
44
+        /// 是否删除
45
+        /// </summary>
46
+        public int isdelete { get; set; }
47
+    }
48
+}

+ 32 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/equipmentmanagements.cs

@@ -0,0 +1,32 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+   public  class equipmentmanagements: IBaseModel<string>
11
+    {
12
+        /// <summary>
13
+        /// id
14
+        /// </summary>
15
+        [Key]
16
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
17
+        public string id { get; set; }
18
+        /// <summary>
19
+        /// 名称
20
+        /// </summary>
21
+        public string equipmentmanagementsname { get; set; }
22
+        /// <summary>
23
+        /// 状态  0 闲置、 1在用、 2故障、 3等待维修
24
+        /// </summary>
25
+        public string equipmentmanagementstate { get; set; }
26
+
27
+        /// <summary>
28
+        /// 是否删除
29
+        /// </summary>
30
+        public int isdelete { get; set; }
31
+    }
32
+}

+ 62 - 0
代码/MadRunFabirc.Model/TestUserTypeApi/patient.cs

@@ -0,0 +1,62 @@
1
+using MadRunFabric.Common;
2
+using MongoDB.Bson.Serialization.Attributes;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.ComponentModel.DataAnnotations;
6
+using System.Text;
7
+
8
+namespace MadRunFabric.Model.TestUserTypeApi
9
+{
10
+    /// <summary>
11
+    /// 患者表
12
+    /// </summary>
13
+  public class patient : IBaseModel<string>
14
+    {
15
+        /// <summary>
16
+        /// id
17
+        /// </summary>
18
+        [Key]
19
+        [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]
20
+        public string id { get; set; }
21
+        /// <summary>
22
+        /// 患者姓名
23
+        /// </summary>
24
+        public string  name { get; set; }
25
+        /// <summary>
26
+        /// 性别
27
+        /// </summary>
28
+        public string Gender { get; set; }
29
+        /// <summary>
30
+        /// 出生地
31
+        /// </summary>
32
+        public string BirthPlace { get; set; }
33
+        /// <summary>
34
+        /// 联系电话
35
+        /// </summary>
36
+        public string Telephone { get; set; }
37
+        /// <summary>
38
+        /// 身份证号
39
+        /// </summary>
40
+        public string IdCard { get; set; }
41
+        /// <summary>
42
+        /// 医保号
43
+        /// </summary>
44
+        public string InsuranceCard { get; set; }
45
+        /// <summary>
46
+        /// 医生编号
47
+        /// </summary>
48
+        public string  doctorid { get; set; }
49
+        /// <summary>
50
+        /// 出生日期
51
+        /// </summary>
52
+        public DateTime? Birthday { get; set; }
53
+
54
+         
55
+ 
56
+ 
57
+ 
58
+ 
59
+
60
+
61
+    }
62
+}

+ 13 - 0
代码/MadRunFabric.TestUserTypeApi/TestUserTypeApi.IRepositories/IequipmentmanagementlistRepository.cs

@@ -0,0 +1,13 @@
1
+using MadRunFabric.Common;
2
+using MadRunFabric.Model.TestUserTypeApi;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Text;
6
+
7
+namespace TestUserTypeApi.IRepositories
8
+{
9
+    public interface  IequipmentmanagementlistRepository : IRepository<equipmentmanagementlist, string>
10
+    {
11
+
12
+    }
13
+}

+ 12 - 0
代码/MadRunFabric.TestUserTypeApi/TestUserTypeApi.IRepositories/IequipmentmanagementsRepository.cs

@@ -0,0 +1,12 @@
1
+using MadRunFabric.Common;
2
+using MadRunFabric.Model.TestUserTypeApi;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Text;
6
+
7
+namespace TestUserTypeApi.IRepositories
8
+{
9
+   public  interface IequipmentmanagementsRepository : IRepository<equipmentmanagements, string>
10
+    {
11
+    }
12
+}

+ 12 - 0
代码/MadRunFabric.TestUserTypeApi/TestUserTypeApi.IRepositories/IpatientRepository.cs

@@ -0,0 +1,12 @@
1
+using MadRunFabric.Common;
2
+using MadRunFabric.Model.TestUserTypeApi;
3
+using System;
4
+using System.Collections.Generic;
5
+using System.Text;
6
+
7
+namespace TestUserTypeApi.IRepositories
8
+{
9
+    public interface IpatientRepository : IRepository<patient, string>
10
+    {
11
+    }
12
+}

+ 536 - 17
代码/MadRunFabric.TestUserTypeApi/TestUserTypeApi/Controllers/TestUserTypeController.cs

@@ -40,39 +40,56 @@ namespace TestUserTypeApi.Controllers
40 40
             return View();
41 41
         }
42 42
         #region 定义接口模块
43
-
43
+        
44
+        #region 试卷满意度调查部分
44 45
         private readonly ILogger<TestUserTypeController> _logger;
45 46
         private readonly IConfiguration _configuration;
46 47
         private readonly ItestusertypeRepository _tsertuserRepository;//每一道试题信息表
47 48
         private readonly ItesttypeRepository _ItesttypeRepository;    //试题类型表
48 49
         private readonly IUserTestRepository _IUserTestRepository;  //用户总分表
49
-        private readonly IUserDoTestRepository _IUserDoTestRepository;//用户做每一题的信息表
50
+        private readonly IUserDoTestRepository _IUserDoTestRepository;//用户做每一题的信息表 
51
+        #endregion
52
+        #region 信息模块
50 53
         /// <summary>
51 54
         /// 信息模块
52 55
         /// </summary>
53 56
         private readonly IMassageInfoRepository _IMassageInfoRepository;//发送信息记录表
54 57
         private readonly ItestquestionRepository _ItestquestionRepository;//发送信息记录表
55
-        private readonly IMassageTypeRepository _IMassageTypeRepository;//短信模板
56
-
58
+        private readonly IMassageTypeRepository _IMassageTypeRepository;//短信模板 
59
+        #endregion
60
+        #region 在线客服模块
57 61
         /// <summary>
58 62
         /// 在线客服模块
59 63
         /// </summary>
60 64
         private readonly ImsgonlineRepository _ImsgonlineRepository;//在线客服
61
-        private readonly ImsgonlinemapRepository _ImsgonlinemapRepository;//在线客服
65
+        private readonly ImsgonlinemapRepository _ImsgonlinemapRepository;//在线客服 
66
+        #endregion
67
+        #region 会诊信息
68
+        private readonly IdiagnosisinfoRepository _IdiagnosisinfoRepository;//会诊信息表 
69
+        private readonly IpatientRepository _IpatientRepository;//患者信息
70
+        private readonly IdiagnosisinbasesRepository _IdiagnosisinbasesRepository;//会诊通知基础信息表
71
+        #endregion
62 72
 
73
+        #region 设备调配
74
+        private readonly IequipmentmanagementsRepository _IequipmentmanagementsRepository;
75
+        private readonly IequipmentmanagementlistRepository _IequipmentmanagementlistRepository; 
76
+        #endregion
63 77
 
78
+        #region 全局定义
64 79
         public TestUserTypeController(ILogger<TestUserTypeController> logger,
65
-           IConfiguration configuration,
66
-           ItestusertypeRepository tsertuserRepository,
67
-           ItesttypeRepository testtypeRepository,
68
-           IUserTestRepository UserTestRepository,
69
-           IUserDoTestRepository UserDoTestRepository,
70
-           IMassageInfoRepository MassageInfoRepository,
71
-           ItestquestionRepository ItestquestionRepository,
72
-           IMassageTypeRepository IMassageTypeRepository,
73
-           ImsgonlineRepository ImsgonlineRepository,//在线客服
74
-           ImsgonlinemapRepository ImsgonlinemapRepository//在线客服
75
-           )
80
+         IConfiguration configuration,
81
+         ItestusertypeRepository tsertuserRepository,
82
+         ItesttypeRepository testtypeRepository,
83
+         IUserTestRepository UserTestRepository,
84
+         IUserDoTestRepository UserDoTestRepository,
85
+         IMassageInfoRepository MassageInfoRepository,
86
+         ItestquestionRepository ItestquestionRepository,
87
+         IMassageTypeRepository IMassageTypeRepository,
88
+         ImsgonlineRepository ImsgonlineRepository,//在线客服
89
+         ImsgonlinemapRepository ImsgonlinemapRepository,//在线客服
90
+         IdiagnosisinfoRepository IdiagnosisinfoRepository,//会诊
91
+         IdiagnosisinbasesRepository IdiagnosisinbasesRepository
92
+         )
76 93
         {
77 94
             _logger = logger;
78 95
             _configuration = configuration;
@@ -85,7 +102,13 @@ namespace TestUserTypeApi.Controllers
85 102
             _IMassageTypeRepository = IMassageTypeRepository;
86 103
             _ImsgonlineRepository = ImsgonlineRepository;
87 104
             _ImsgonlinemapRepository = ImsgonlinemapRepository;
88
-        } 
105
+            _IdiagnosisinfoRepository = IdiagnosisinfoRepository;
106
+            _IdiagnosisinbasesRepository = IdiagnosisinbasesRepository;
107
+        }
108
+        #endregion
109
+
110
+
111
+     
89 112
         #endregion
90 113
         #region 满意度模块
91 114
         /// <summary>
@@ -1492,6 +1515,502 @@ namespace TestUserTypeApi.Controllers
1492 1515
             return Success("成功", obj);
1493 1516
         }
1494 1517
         #endregion
1518
+        #region 会诊模块
1519
+        /// <summary>
1520
+        /// 获取会诊信息列表
1521
+        /// </summary>
1522
+        /// <param name="PageIndex"></param>
1523
+        /// <param name="PageSize"></param>
1524
+        /// <returns></returns>
1525
+        [HttpGet("getlistdiagnosisinfo")]
1526
+        public async Task<IActionResult> GetListdiagnosisinfo(int PageIndex, int PageSize,string Qdoctorid,string Hzdoctorid)
1527
+        {
1528
+           
1529
+            //排序字段
1530
+            var sort = Builders<diagnosisinfo>.Sort.Ascending("testcode");
1531
+            //根据条件查询集合
1532
+            var listApp = new List<FilterDefinition<diagnosisinfo>>();
1533
+            listApp.Add(Builders<diagnosisinfo>.Filter.Eq("isdelete", 0));
1534
+            //我申请的会诊工单
1535
+            if (Qdoctorid != null)
1536
+            {
1537
+                if (Qdoctorid != "")
1538
+                {
1539
+                    listApp.Add(Builders<diagnosisinfo>.Filter.Eq("Qdoctorid", Qdoctorid));
1540
+                }
1541
+            }
1542
+            ///接诊的工单
1543
+            if (Hzdoctorid != null)
1544
+            {
1545
+                if (Hzdoctorid != "")
1546
+                {
1547
+                    listApp.Add(Builders<diagnosisinfo>.Filter.Eq("Hzdoctorid", Qdoctorid));
1548
+                }
1549
+            }
1550
+            var filter = Builders<diagnosisinfo>.Filter.And(listApp);
1551
+
1552
+            var list = await _IdiagnosisinfoRepository.GetByPage(filter, PageIndex, PageSize, sort);
1553
+            var redCount = await _IdiagnosisinfoRepository.CountAsync(filter);   //获取总数
1554
+            var listmodel = new List<diagnosisinfo>();
1555
+
1556
+
1557
+            int iscount = 1;
1558
+            foreach (var item in list)
1559
+            {
1560
+                ///定义选项
1561
+                var model = new diagnosisinfo();
1562
+                model.id = item.id;
1563
+                model.Departmentid = item.Departmentid;//科室编号
1564
+                model.Hzdoctorid = item.Hzdoctorid;//会诊医生编号
1565
+                model.Qdoctorid = item.Qdoctorid;//会诊申请医生编号
1566
+                model.diagnosiscenter = item.diagnosiscenter;//会诊内容
1567
+                model.diagnosisresult = item.diagnosisresult;//会诊结果
1568
+                model.playdate = item.playdate;//发起会诊时间
1569
+                model.enddate = item.enddate;//结束会诊时间
1570
+                model.patientid = item.patientid;//患者姓名
1571
+                model.isdelete = item.isdelete;//是否启用
1572
+                listmodel.Add(model);
1573
+            }
1574
+            var obj = new
1575
+            {
1576
+                rows = listmodel,
1577
+                total = redCount
1578
+            };
1579
+            return Success("成功", obj);
1580
+        }
1581
+        /// <summary>
1582
+        /// 添加会诊信息记录
1583
+        /// </summary>
1584
+        /// <param name="tps"></param>
1585
+        /// <returns></returns>
1586
+        [HttpGet("adddiagnosisinfo")]
1587
+        public async Task<IActionResult> Adddiagnosisinfo(Model.Dto.diagnosisinfo tps)
1588
+        {
1589
+            diagnosisinfo tp = new diagnosisinfo();
1590
+            tp.isdelete = 0;
1591
+            tp.Departmentid = tps.Departmentid;//科室编号
1592
+            tp.Hzdoctorid = tps.Hzdoctorid;//会诊医生编号
1593
+            tp.Qdoctorid = tps.Qdoctorid;//会诊申请医生编号
1594
+            tp.diagnosiscenter = tps.diagnosiscenter;//会诊内容
1595
+            tp.diagnosisresult = tps.diagnosisresult;//会诊结果
1596
+            tp.playdate = DateTime.Now;//发起会诊时间
1597
+            tp.playingdate = tps.playingdate;//会诊准确时间点
1598
+            tp.enddate = tps.enddate;//结束会诊时间
1599
+            tp.patientid = tps.patientid;//患者id
1600
+        var a = _IdiagnosisinfoRepository.AddRetID(tp);
1601
+            if (a.Result != null || a.Result != "")
1602
+            {
1603
+                return Success("成功", a.Result);
1604
+            }
1605
+            else
1606
+            {
1607
+                return Error("失败");
1608
+            }
1609
+
1610
+        }
1611
+        /// <summary>
1612
+        /// 删除会诊信息
1613
+        /// </summary>
1614
+        /// <param name="id"></param>
1615
+        /// <returns></returns>
1616
+        [HttpGet("deldiagnosisinfo")]
1617
+        public async Task<IActionResult> Deldiagnosisinfo(string id)
1618
+        {
1619
+            var result = _IdiagnosisinfoRepository.Remove(id);
1620
+            if (result.Result)
1621
+            {
1622
+                return Success("成功");
1623
+            }
1624
+            else
1625
+            {
1626
+                return Error("失败");
1627
+            }
1628
+        }
1629
+        /// <summary>
1630
+        /// 根据id获取会诊详情信息
1631
+        /// </summary>
1632
+        /// <param name="id"></param>
1633
+        /// <returns></returns>
1634
+        [HttpGet("getdiagnosisinfo")]
1635
+        public async Task<IActionResult> Getdiagnosisinfo(string id)
1636
+        {
1637
+            var model = await _IdiagnosisinfoRepository.GetSingle(p => p.id == id);
1638
+            var listmodel = new List<diagnosisinfo>();
1639
+            listmodel.Add(model);
1640
+
1641
+            return Success("成功", listmodel);
1642
+        }
1643
+        /// <summary>
1644
+        /// 修改会诊信息
1645
+        /// </summary>
1646
+        /// <param name="tps"></param>
1647
+        /// <returns></returns>
1648
+        [HttpGet("updatediagnosisinfo")]
1649
+        public async Task<IActionResult> updatediagnosisinfo(Model.Dto.diagnosisinfo tps)
1650
+        {
1651
+            diagnosisinfo tp = new diagnosisinfo();
1652
+            tp.id = tps.id;
1653
+            var resua = _IdiagnosisinfoRepository.Update(tp);
1654
+            if (resua.Result)
1655
+            {
1656
+                return Success("成功");
1657
+            }
1658
+            else
1659
+            {
1660
+                return Error("失败");
1661
+            }
1662
+
1663
+        }
1664
+        /// <summary>
1665
+        /// 获取要通知会诊的人的列表
1666
+        /// </summary>
1667
+        /// <param name="PageIndex"></param>
1668
+        /// <param name="PageSize"></param>
1669
+        /// <returns></returns>
1670
+        [HttpGet("getlistdiagnosisinbases")]
1671
+        public async Task<IActionResult> GetListdiagnosisinbases(int PageIndex, int PageSize)
1672
+        {
1673
+
1674
+            //排序字段
1675
+            var sort = Builders<diagnosisinbases>.Sort.Ascending("testcode");
1676
+            //根据条件查询集合
1677
+            var listApp = new List<FilterDefinition<diagnosisinbases>>();
1678
+            listApp.Add(Builders<diagnosisinbases>.Filter.Eq("isdelete", 0));
1679
+         
1680
+            var filter = Builders<diagnosisinbases>.Filter.And(listApp);
1681
+
1682
+            var list = await _IdiagnosisinbasesRepository.GetByPage(filter, PageIndex, PageSize, sort);
1683
+            var redCount = await _IdiagnosisinbasesRepository.CountAsync(filter);   //获取总数
1684
+            var listmodel = new List<diagnosisinbases>();
1685
+
1686
+
1687
+            int iscount = 1;
1688
+            foreach (var item in list)
1689
+            {
1690
+                ///定义选项
1691
+                var model = new diagnosisinbases();
1692
+                model.id = item.id;
1693
+                model.diagnoname = item.diagnoname;// 参加会诊人姓名
1694
+                model.diagnotel = item.diagnotel;// 参加会诊人手机号
1695
+                model.diagnophone = item.diagnophone;// 参加会诊人电话号
1696
+                model.createdate = item.createdate;// 创建时间
1697
+                model.isnotice = item.isnotice;//是否通知 默认未通知为0
1698
+                model.isdelete = item.isdelete;//是否启用
1699
+                listmodel.Add(model);
1700
+            }
1701
+            var obj = new
1702
+            {
1703
+                rows = listmodel,
1704
+                total = redCount
1705
+            };
1706
+            return Success("成功", obj);
1707
+        }
1708
+        /// <summary>
1709
+        /// 修改是否通知了会诊的人
1710
+        /// </summary>
1711
+        /// <param name="tps"></param>
1712
+        /// <returns></returns>
1713
+        [HttpGet("updatediagnosisinbases")]
1714
+        public async Task<IActionResult> updatediagnosisinbases(Model.Dto.diagnosisinbases tps)
1715
+        {
1716
+            diagnosisinbases tp = new diagnosisinbases();
1717
+            tp.id = tps.id;
1718
+            tp.isnotice = tps.isnotice;
1719
+            var resua = _IdiagnosisinbasesRepository.Update(tp);
1720
+            if (resua.Result)
1721
+            {
1722
+                return Success("成功");
1723
+            }
1724
+            else
1725
+            {
1726
+                return Error("失败");
1727
+            }
1728
+
1729
+        }
1730
+        /// <summary>
1731
+        /// 添加参与会诊人员信息
1732
+        /// </summary>
1733
+        /// <param name="tps"></param>
1734
+        /// <returns></returns>
1735
+        [HttpGet("adddiagnosisinbases")]
1736
+        public async Task<IActionResult> Adddiagnosisinbases(Model.Dto.diagnosisinbases tps)
1737
+        {
1738
+            diagnosisinbases tp = new diagnosisinbases();
1739
+            tp.isdelete = 0;
1740
+            tp.diagnoname = tps.diagnoname;// 参加会诊人姓名
1741
+            tp.diagnotel = tps.diagnotel;// 参加会诊人手机号
1742
+            tp.diagnophone = tps.diagnophone;// 参加会诊人电话号
1743
+            tp.createdate = DateTime.Now;// 创建时间
1744
+            tp.isnotice ="0";//是否通知 默认未通知为0
1745
+            tp.isdelete =0;//是否启用
1746
+            var a = _IdiagnosisinbasesRepository.AddRetID(tp);
1747
+            if (a.Result != null || a.Result != "")
1748
+            {
1749
+                return Success("成功", a.Result);
1750
+            }
1751
+            else
1752
+            {
1753
+                return Error("失败");
1754
+            }
1755
+
1756
+        }
1757
+        #endregion
1758
+
1759
+        #region 设备调配
1760
+        /// <summary>
1761
+        /// 获取设备信息状态
1762
+        /// </summary>
1763
+        /// <param name="PageIndex"></param>
1764
+        /// <param name="PageSize"></param>
1765
+        /// <returns></returns>
1766
+        [HttpGet("getequipmentmanagements")]
1767
+        public async Task<IActionResult> Getequipmentmanagements(int PageIndex, int PageSize)
1768
+        {
1769
+
1770
+            //排序字段
1771
+            var sort = Builders<equipmentmanagements>.Sort.Ascending("testcode");
1772
+            //根据条件查询集合
1773
+            var listApp = new List<FilterDefinition<equipmentmanagements>>();
1774
+            listApp.Add(Builders<equipmentmanagements>.Filter.Eq("isdelete", 0));
1775
+
1776
+            var filter = Builders<equipmentmanagements>.Filter.And(listApp);
1777
+
1778
+            var list = await _IequipmentmanagementsRepository.GetByPage(filter, PageIndex, PageSize, sort);
1779
+            var redCount = await _IequipmentmanagementsRepository.CountAsync(filter);   //获取总数
1780
+            var listmodel = new List<equipmentmanagements>();
1781
+
1782
+
1783
+            foreach (var item in list)
1784
+            {
1785
+                ///定义选项
1786
+                var model = new equipmentmanagements();
1787
+                model.id = item.id;
1788
+                model.equipmentmanagementsname = item.equipmentmanagementsname;//名称
1789
+                model.equipmentmanagementstate = item.equipmentmanagementstate;//状态
1790
+                model.isdelete = item.isdelete;//是否启用
1791
+                listmodel.Add(model);
1792
+            }
1793
+            var obj = new
1794
+            {
1795
+                rows = listmodel,
1796
+                total = redCount
1797
+            };
1798
+            return Success("成功", obj);
1799
+        }
1800
+
1801
+        /// <summary>
1802
+        /// 添加设备信息
1803
+        /// </summary>
1804
+        /// <param name="tps"></param>
1805
+        /// <returns></returns>
1806
+        [HttpGet("addequipmentmanagements")]
1807
+        public async Task<IActionResult> Addequipmentmanagements(Model.Dto.equipmentmanagements tps)
1808
+        {
1809
+            equipmentmanagements tp = new equipmentmanagements();
1810
+            tp.equipmentmanagementsname = tps.equipmentmanagementsname;//设备名称
1811
+            tp.equipmentmanagementstate = tps.equipmentmanagementstate;//设备状态
1812
+            tp.isdelete = 0;//是否启用
1813
+            var a = _IequipmentmanagementsRepository.AddRetID(tp);
1814
+            if (a.Result != null || a.Result != "")
1815
+            {
1816
+                return Success("成功", a.Result);
1817
+            }
1818
+            else
1819
+            {
1820
+                return Error("失败");
1821
+            }
1822
+
1823
+        }
1824
+
1825
+        /// <summary>
1826
+        /// 删除设备信息
1827
+        /// </summary>
1828
+        /// <param name="id"></param>
1829
+        /// <returns></returns>
1830
+        [HttpGet("delequipmentmanagements")]
1831
+        public async Task<IActionResult> delequipmentmanagements(string id)
1832
+        {
1833
+            var result = _IequipmentmanagementsRepository.Remove(id);
1834
+            if (result.Result)
1835
+            {
1836
+                return Success("成功");
1837
+            }
1838
+            else
1839
+            {
1840
+                return Error("失败");
1841
+            }
1842
+
1843
+        }
1844
+
1845
+        /// <summary>
1846
+        /// 修改设备信息
1847
+        /// </summary>
1848
+        /// <param name="tps"></param>
1849
+        /// <returns></returns>
1850
+        [HttpGet("upequipmentmanagements")]
1851
+        public async Task<IActionResult> upequipmentmanagements(Model.Dto.equipmentmanagements tps)
1852
+        {
1853
+            equipmentmanagements tp = new equipmentmanagements();
1854
+            tp.id = tps.id;
1855
+            tp.equipmentmanagementsname = tps.equipmentmanagementsname;//设备名称
1856
+            tp.equipmentmanagementstate = tps.equipmentmanagementstate;//设备状态
1857
+            tp.isdelete = 0;//是否启用
1858
+            var resua = _IequipmentmanagementsRepository.Update(tp);
1859
+            if (resua.Result)
1860
+            {
1861
+                return Success("成功");
1862
+            }
1863
+            else
1864
+            {
1865
+                return Error("失败");
1866
+            }
1867
+
1868
+        }
1869
+
1870
+        /// <summary>
1871
+        /// 根据id获取设备详情信息
1872
+        /// </summary>
1873
+        /// <param name="id"></param>
1874
+        /// <returns></returns>
1875
+        [HttpGet("getequipmentmanagementsbyid")]
1876
+        public async Task<IActionResult> Getequipmentmanagementsbyid(string id)
1877
+        {
1878
+            var model = await _IequipmentmanagementsRepository.Get(p => p.id == id);
1879
+            return Success("成功", model);
1880
+        }
1881
+
1882
+        /// <summary>
1883
+        /// 获取设备出入库记录信息
1884
+        /// </summary>
1885
+        /// <param name="PageIndex"></param>
1886
+        /// <param name="PageSize"></param>
1887
+        /// <returns></returns>
1888
+        [HttpGet("getequipmentmanagementlist")]
1889
+        public async Task<IActionResult> Getequipmentmanagementlist(int PageIndex, int PageSize)
1890
+        {
1891
+
1892
+            //排序字段
1893
+            var sort = Builders<equipmentmanagementlist>.Sort.Ascending("testcode");
1894
+            //根据条件查询集合
1895
+            var listApp = new List<FilterDefinition<equipmentmanagementlist>>();
1896
+            listApp.Add(Builders<equipmentmanagementlist>.Filter.Eq("isdelete", 0));
1897
+
1898
+            var filter = Builders<equipmentmanagementlist>.Filter.And(listApp);
1899
+
1900
+            var list = await _IequipmentmanagementlistRepository.GetByPage(filter, PageIndex, PageSize, sort);
1901
+            var redCount = await _IequipmentmanagementlistRepository.CountAsync(filter);   //获取总数
1902
+            var listmodel = new List<equipmentmanagementlist>();
1903
+
1904
+
1905
+            foreach (var item in list)
1906
+            {
1907
+                equipmentmanagements stamodel = await _IequipmentmanagementsRepository.GetSingle(p=>p.id==item.equipmentmanagementsid);
1908
+                ///定义选项
1909
+                var model = new equipmentmanagementlist();
1910
+                model.id = item.id;
1911
+                if (stamodel != null)
1912
+                {
1913
+                    model.equipmentmanagementsname = stamodel.equipmentmanagementsname ;
1914
+                }
1915
+                else {
1916
+                    model.equipmentmanagementsname = "";
1917
+                }
1918
+                
1919
+                model.Qdepartment = item.Qdepartment;// 申请科室
1920
+                model.Qqtime = item.Qqtime;// 申请时间
1921
+                model.Cktime = item.Cktime;// 出库时间
1922
+                model.Rktime = item.Rktime;//入库时间
1923
+                model.isdelete = item.isdelete;//是否启用
1924
+                listmodel.Add(model);
1925
+            }
1926
+            var obj = new
1927
+            {
1928
+                rows = listmodel,
1929
+                total = redCount
1930
+            };
1931
+            return Success("成功", obj);
1932
+        }
1933
+
1934
+        /// <summary>
1935
+        /// 申请接口(添加申请记录信息)
1936
+        /// </summary>
1937
+        /// <param name="tps"></param>
1938
+        /// <returns></returns>
1939
+        [HttpGet("addquipmentmanagementlist")]
1940
+        public async Task<IActionResult> addquipmentmanagementlist(Model.Dto.equipmentmanagements tps)
1941
+        {
1942
+            
1943
+            equipmentmanagementlist tp = new equipmentmanagementlist();
1944
+            tp.equipmentmanagementsid = tps.id;//设备编号
1945
+            tp.Qdepartment = tps.Sqperpro;//申请科室
1946
+            tp.Qqtime = DateTime.Now;//申请时间
1947
+            tp.Cktime = null;//出库时间
1948
+            tp.Rktime = null;//入库时间
1949
+            tp.isdelete = 0;
1950
+            var a = _IequipmentmanagementlistRepository.AddRetID(tp);
1951
+
1952
+            if (a.Result != null || a.Result != "")
1953
+            {
1954
+                return Success("成功", a.Result);
1955
+            }
1956
+            else
1957
+            {
1958
+                return Error("失败");
1959
+            }
1960
+
1961
+
1962
+        }
1963
+
1964
+        /// <summary>
1965
+        /// 出库接口
1966
+        /// </summary>
1967
+        /// <param name="tps"></param>
1968
+        /// <returns></returns>
1969
+        [HttpGet("upquipmentmanagementlistc")]
1970
+        public async Task<IActionResult> upquipmentmanagementlistc(string id)
1971
+        {
1972
+            equipmentmanagementlist model = await _IequipmentmanagementlistRepository.GetSingle(p => p.id == id);
1973
+            model.id = id;
1974
+            model.Cktime = DateTime.Now;//出库时间
1975
+          
1976
+            var a = _IequipmentmanagementlistRepository.Update(model);
1977
+
1978
+            if (a.Result)
1979
+            {
1980
+                return Success("成功");
1981
+            }
1982
+            else
1983
+            {
1984
+                return Error("失败");
1985
+            }
1986
+        }
1987
+
1988
+
1989
+        /// <summary>
1990
+        /// 入库接口
1991
+        /// </summary>
1992
+        /// <param name="tps"></param>
1993
+        /// <returns></returns>
1994
+        [HttpGet("upquipmentmanagementlistr")]
1995
+        public async Task<IActionResult> upquipmentmanagementlistr(string id)
1996
+        {
1997
+            equipmentmanagementlist tp = await _IequipmentmanagementlistRepository.GetSingle(p => p.id == id);
1998
+            tp.id = id;
1999
+            tp.Rktime = DateTime.Now;//入库时间
2000
+            var a = _IequipmentmanagementlistRepository.Update(tp);
2001
+
2002
+            if (a.Result)
2003
+            {
2004
+                return Success("成功");
2005
+            }
2006
+            else
2007
+            {
2008
+                return Error("失败");
2009
+            }
2010
+        }
2011
+
2012
+        #endregion
2013
+
1495 2014
 
1496 2015
     }
1497 2016
 }

+ 8 - 0
代码/MadRunFabric.TestUserTypeApi/TestUserTypeApi/Startup.cs

@@ -174,6 +174,14 @@ namespace TestUserTypeApi
174 174
             services.AddTransient<IMassageInfoRepository, MassageInfoRepository>();
175 175
             services.AddTransient<ItestquestionRepository, testquestionRepository>();
176 176
             services.AddTransient<IMassageTypeRepository, MassageTypeRepository>();
177
+            services.AddTransient<ImsgonlinemapRepository, msgonlinemapRepository>();//聊天记录是否已读关联表
178
+            services.AddTransient<ImsgonlineRepository, msgonlineRepository>();//聊天记录表
179
+            services.AddTransient<IdiagnosisinfoRepository, diagnosisinfoRepository>();//会诊
180
+            services.AddTransient<IpatientRepository, patientRepository>();//患者
181
+            services.AddTransient<IdiagnosisinbasesRepository, diagnosisinbasesRepository>();//会诊人员信息
182
+
183
+            services.AddTransient<IequipmentmanagementsRepository, equipmentmanagementsRepository>();//设备调配设备表
184
+            services.AddTransient<IequipmentmanagementlistRepository, equipmentmanagementlistRepository>();//设备调配记录表
177 185
             #endregion
178 186
             //services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
179 187
         }