Browse Source

Merge branch 'master' of http://192.168.1.222:3000/liyuanyuan/ylsf

1550076451 1 year ago
parent
commit
77c7b97957

+ 99 - 0
ylsf-api/src/main/java/api/controller/patient/LabelController.java

@@ -0,0 +1,99 @@
1
+package api.controller.patient;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import api.controller.BaseController;
7
+import api.entity.database.patient.Label;
8
+import api.entity.input.PageInput;
9
+import api.model.AjaxResult;
10
+import api.service.patient.ILabelService;
11
+import api.util.annotation.Log;
12
+import api.util.enums.BusinessType;
13
+import api.util.helper.StringHelper;
14
+import io.swagger.annotations.Api;
15
+import io.swagger.annotations.ApiOperation;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.web.bind.annotation.*;
18
+import java.util.Arrays;
19
+
20
+@Api(value = "p_label",tags = "p_label")
21
+@RestController
22
+@RequestMapping("/patient/label")
23
+public class LabelController extends BaseController {
24
+    @Autowired
25
+    private ILabelService labelService;
26
+
27
+    @ApiOperation("列表")
28
+    @Log(title = "查询p_label列表",businessType = BusinessType.QUERY)
29
+    @GetMapping
30
+    public AjaxResult getList(Label input, PageInput pageInput) {
31
+        LambdaQueryWrapper<Label> qw = new LambdaQueryWrapper();
32
+
33
+        qw.like(!StringHelper.isEmpty(input.getLabelName()), Label::getLabelName, input.getLabelName());
34
+
35
+
36
+        qw.eq(  Label::getIsDelete, 0L);
37
+        Page<Label> page = GetPage(pageInput);
38
+        if (page != null) {
39
+            IPage<Label> iPage = labelService.getListPage(page, qw);
40
+            return Success("成功", iPage.getRecords(), iPage.getTotal());
41
+        } else {
42
+            return Success("成功", labelService.getList(qw));
43
+        }
44
+    }
45
+
46
+    @ApiOperation("详情")
47
+    @Log(title = "查询p_label详情",businessType = BusinessType.QUERY)
48
+    @GetMapping("/{id}")
49
+    public AjaxResult getInfo(@PathVariable long id) {
50
+        return Success("成功", labelService.getEntity(id));
51
+    }
52
+
53
+    @ApiOperation("新增")
54
+    @Log(title = "新增p_label",businessType = BusinessType.INSERT)
55
+    @PostMapping
56
+    public AjaxResult add(@RequestBody Label input) {
57
+        LambdaQueryWrapper<Label> exist=new LambdaQueryWrapper<>();
58
+        exist.eq(Label::getLabelName,input.getLabelName());
59
+        exist.eq(Label::getIsDelete,0L);
60
+
61
+        if(  labelService.exists(exist)){
62
+            return  Success("标签名已存在");
63
+        }
64
+
65
+
66
+         input.setCreateUser(CurrentUser().getUserName());
67
+        boolean result = labelService.insert(input);
68
+        if (result) {
69
+            return Success("成功");
70
+        } else {
71
+            return Error("新增失败");
72
+        }
73
+    }
74
+
75
+    @ApiOperation("编辑")
76
+    @Log(title = "编辑p_label",businessType = BusinessType.UPDATE)
77
+    @PutMapping
78
+    public AjaxResult edit(@RequestBody Label input)  {
79
+        boolean result = labelService.update(input);
80
+        if (result) {
81
+            return Success("成功");
82
+        } else {
83
+            return Error("修改失败");
84
+        }
85
+    }
86
+
87
+    @ApiOperation("删除")
88
+    @Log(title = "删除p_label",businessType = BusinessType.DELETE)
89
+    @DeleteMapping("/{ids}")
90
+    public AjaxResult delete(@PathVariable Long[] ids)  {
91
+        boolean result = labelService.delete(Arrays.asList(ids));
92
+        if (result) {
93
+            return Success("成功");
94
+        } else {
95
+            return Error("删除失败");
96
+        }
97
+    }
98
+
99
+}

+ 26 - 7
ylsf-api/src/main/java/api/controller/patient/PatientLabelController.java

@@ -1,8 +1,10 @@
1 1
 package api.controller.patient;
2 2
 
3
+import api.entity.database.patient.Label;
3 4
 import api.entity.database.patient.Patient;
4 5
 import api.entity.database.patient.PatientLog;
5 6
 import api.entity.input.patient.LabelInput;
7
+import api.service.patient.ILabelService;
6 8
 import api.service.patient.IPatientLogService;
7 9
 import api.service.patient.IPatientService;
8 10
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -38,13 +40,16 @@ public class PatientLabelController extends BaseController {
38 40
     @Autowired
39 41
     private IPatientService patientService;
40 42
 
43
+    @Autowired
44
+    private ILabelService labelService;
45
+
41 46
     @ApiOperation("列表")
42 47
     @Log(title = "查询p_patientlabel列表",businessType = BusinessType.QUERY)
43 48
     @GetMapping
44 49
     public AjaxResult getList(PatientLabel input, PageInput pageInput) {
45 50
         LambdaQueryWrapper<PatientLabel> qw = new LambdaQueryWrapper();
46
-        qw.eq(input.getLabelId() != null && input.getLabelId() > 0, PatientLabel::getLabelId, input.getLabelId());
47
-        qw.like(!StringHelper.isEmpty(input.getPatientId()), PatientLabel::getPatientId, input.getPatientId());
51
+        qw.eq(input.getLabelId() != null , PatientLabel::getLabelId, input.getLabelId());
52
+        qw.eq(!StringHelper.isEmpty(input.getPatientId()), PatientLabel::getPatientId, input.getPatientId());
48 53
         qw.like(!StringHelper.isEmpty(input.getPatientName()), PatientLabel::getPatientName, input.getPatientName());
49 54
         qw.like(!StringHelper.isEmpty(input.getPhoneNumber()), PatientLabel::getPhoneNumber, input.getPhoneNumber());
50 55
         qw.like(!StringHelper.isEmpty(input.getLabelName()), PatientLabel::getLabelName, input.getLabelName());
@@ -71,6 +76,8 @@ public class PatientLabelController extends BaseController {
71 76
     @Log(title = "新增p_patientlabel",businessType = BusinessType.INSERT)
72 77
     @PostMapping
73 78
     public AjaxResult add(@RequestBody PatientLabel input) {
79
+
80
+
74 81
         Date currentDate = new Date(System.currentTimeMillis());
75 82
         input.setCreateTime(currentDate);
76 83
         input.setCreateUserName(CurrentUser().getNickName());
@@ -118,7 +125,8 @@ public class PatientLabelController extends BaseController {
118 125
 
119 126
         LambdaQueryWrapper<PatientLabel> lp = new LambdaQueryWrapper<>();
120 127
         lp.in(PatientLabel::getPatientId, patientids);
121
-        lp.eq(PatientLabel::getLabelName, input.getLabelName());
128
+
129
+        lp.eq(PatientLabel::getLabelId, input.getLabelId());
122 130
         boolean result = patientlabelService.delete(lp);
123 131
         if (result) {
124 132
             //删除标签 存log记录
@@ -142,14 +150,26 @@ public class PatientLabelController extends BaseController {
142 150
     @ApiOperation("批量打标签")
143 151
     @Log(title = "新增p_patientlabel",businessType = BusinessType.INSERT)
144 152
     @PostMapping("/batchadd")
145
-   // public AjaxResult batchadd(@PathVariable List<String> patientids, @PathVariable  String  labelname) {
153
+
146 154
     public AjaxResult batchadd(@RequestBody LabelInput inputlabel) {
155
+        Label labelmodel=new Label();
156
+        if(inputlabel.getLabelId()!=null && inputlabel.getLabelId()>0){}
157
+        else{
158
+            //先添加标签
159
+            labelmodel.setLabelName(inputlabel.getLabelName());
160
+            labelmodel.setPatientCount(inputlabel.getPatientids().stream().count());
161
+            labelmodel.setCreateUser(CurrentUser().getUserName());
162
+             labelService.insert(labelmodel);
163
+        }
164
+
147 165
         Date currentDate = new Date(System.currentTimeMillis());
148 166
         List<String> patientids= inputlabel.getPatientids();
149 167
         LambdaQueryWrapper<Patient> lp=new LambdaQueryWrapper<>();
150 168
         lp.in(Patient::getPatientId,inputlabel.getPatientids());
151 169
        List<Patient> patientList= patientService.getList(lp);
152 170
 
171
+       Long labelid=inputlabel.getLabelId()==null?labelmodel.getLabelId():inputlabel.getLabelId();
172
+
153 173
         StringBuilder error = new StringBuilder();
154 174
         for (int i = 0; i < patientids.stream().count(); i++) {
155 175
             PatientLabel input=new PatientLabel();
@@ -158,15 +178,14 @@ public class PatientLabelController extends BaseController {
158 178
             input.setCreateUserName(CurrentUser().getNickName());
159 179
             input.setCreateUser(CurrentUser().getUserName());
160 180
             input.setIsDelete(0L);
181
+            input.setLabelId(labelid);
161 182
             input.setPatientId(String_id);
162 183
             var patient=  patientList.stream().filter(x->x.getPatientId().equals(String_id)).collect(Collectors.toList()).stream().findFirst();
163 184
             input.setLabelName(inputlabel.getLabelName());
164 185
             input.setPatientName(patient.get().getName() );
165 186
             input.setPhoneNumber(patient.get().getPhoneNumber());
166 187
             boolean result = patientlabelService.insert(input);
167
-            if (!result) {
168
-              //  error.append(patientids.get(i)).append("删除失败;");
169
-            } else {
188
+            if (result)  {
170 189
                 //添加标签 存log记录
171 190
             var ppp=  patientList.stream().filter(x->x.getPatientId().equals(String_id)).findFirst().get();
172 191
                ppp.setUpdateTime(currentDate);

+ 35 - 0
ylsf-entity/src/main/java/api/entity/database/patient/Label.java

@@ -0,0 +1,35 @@
1
+package api.entity.database.patient;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import java.util.Date;
10
+
11
+/** p_label */
12
+@ApiModel(value = "Label", description = "p_label实体")
13
+@Data
14
+@TableName("p_label")
15
+public class Label {
16
+    /** label_id */
17
+    @ApiModelProperty("label_id")
18
+    @TableId(type = IdType.AUTO)
19
+    private Long labelId;
20
+    /** 标签名 */
21
+    @ApiModelProperty("标签名")
22
+    private String labelName;
23
+    /** 患者数量 */
24
+    @ApiModelProperty("患者数量")
25
+    private Long patientCount;
26
+    /** 创建时间 */
27
+    @ApiModelProperty("创建时间")
28
+    private Date createTime;
29
+    /** 创建人 */
30
+    @ApiModelProperty("创建人")
31
+    private String createUser;
32
+    /** 删除标志0否1是 */
33
+    @ApiModelProperty("删除标志0否1是")
34
+    private Long isDelete;
35
+}

+ 63 - 15
ylsf-entity/src/main/java/api/entity/database/patient/Patient.java

@@ -78,12 +78,7 @@ public class Patient {
78 78
     /** 最近就诊时间 */
79 79
     @ApiModelProperty("最近就诊时间")
80 80
     private Date jzsj;
81
-    /** 最近入院时间 */
82
-    @ApiModelProperty("最近入院时间")
83
-    private Date rysj;
84
-    /** 最近出院时间 */
85
-    @ApiModelProperty("最近出院时间")
86
-    private Date cysj;
81
+
87 82
     /** 最近就诊科室 */
88 83
     @ApiModelProperty("最近就诊科室")
89 84
     private Long jzks;
@@ -92,15 +87,70 @@ public class Patient {
92 87
     @ApiModelProperty("最近就诊科室展示用")
93 88
     private String jzksName;
94 89
 
95
-    /** 病区 */
96
-    @ApiModelProperty("病区")
97
-    private String ssbq;
98
-    /** 诊断疾病 */
99
-    @ApiModelProperty("诊断疾病")
100
-    private String zdjb;
90
+
91
+    /** 最近就诊科室展示用 */
92
+    @ApiModelProperty("最近就诊诊断")
93
+    private String zjjzzd;
94
+
95
+    @ApiModelProperty("最近就诊疾病")
96
+    private String zjjzjb;
97
+
98
+    @ApiModelProperty("最近就诊医生")
99
+    private  String zjjzys;
100
+
101
+
102
+
103
+    /** 最近入院时间 */
104
+    @ApiModelProperty("最近入院时间")
105
+    private Date rysj;
106
+
107
+    @ApiModelProperty("最近入院诊断")
108
+    private  String zjryzd;
109
+
110
+
111
+    @ApiModelProperty("最近入院疾病")
112
+    private  String zjryjb;
113
+
114
+
115
+    @ApiModelProperty("最近住院科室展示用")
116
+    private  String zjzyksName;
117
+
118
+    @ApiModelProperty("最近住院科室id")
119
+    private  Long zjzyks;
120
+
101 121
     /** 主治医生 */
102 122
     @ApiModelProperty("主治医生")
103 123
     private String zzys;
124
+    /** 主治医生name */
125
+    @ApiModelProperty("主治医生name")
126
+    private String zzysName;
127
+    /** 最近出院时间 */
128
+    @ApiModelProperty("最近出院时间(如果有新的住院记录,还未出院该字段为空)")
129
+    private Date cysj;
130
+
131
+    /** 最近出院诊断疾病 */
132
+    @ApiModelProperty("最近出院诊断")
133
+    private String zjcyzd;
134
+
135
+    /** 最近出院诊断疾病 */
136
+    @ApiModelProperty("最近出院疾病")
137
+    private String zjcyjb;
138
+
139
+
140
+
141
+    @ApiModelProperty("最近出院科室id")
142
+    private  Long zjcyks;
143
+
144
+
145
+    @ApiModelProperty("最近出院科室展示用")
146
+    private  String zjcyksName;
147
+
148
+
149
+    /** 病区 */
150
+    @ApiModelProperty("所属病区")
151
+    private String ssbq;
152
+
153
+
104 154
     /** 创建人 */
105 155
     @ApiModelProperty("创建人")
106 156
     private String createUser;
@@ -124,9 +174,7 @@ public class Patient {
124 174
     private Date updateTime;
125 175
 
126 176
 
127
-    /** 主治医生name */
128
-    @ApiModelProperty("主治医生name")
129
-    private String zzysName;
177
+
130 178
 
131 179
     /** 责任护士name */
132 180
     @ApiModelProperty("责任护士name")

+ 5 - 1
ylsf-entity/src/main/java/api/entity/database/patient/PatientLabel.java

@@ -16,7 +16,7 @@ public class PatientLabel {
16 16
     /** 主键 标签id */
17 17
     @ApiModelProperty("主键 标签id")
18 18
     @TableId(type = IdType.AUTO)
19
-    private Long labelId;
19
+    private Long patientlabelId;
20 20
     /** 患者id */
21 21
     @ApiModelProperty("患者id")
22 22
     private String patientId;
@@ -43,4 +43,8 @@ public class PatientLabel {
43 43
     @ApiModelProperty("创建人姓名")
44 44
     private String createUserName;
45 45
 
46
+    /** label表的id */
47
+    @ApiModelProperty("label表的id")
48
+    private Long labelId;
49
+
46 50
 }

+ 1 - 0
ylsf-entity/src/main/java/api/entity/input/patient/LabelInput.java

@@ -9,6 +9,7 @@ import java.util.List;
9 9
 public class LabelInput {
10 10
 
11 11
     private  String    LabelName;
12
+private  Long LabelId;
12 13
 
13 14
    private List<String> patientids;
14 15
 }

+ 9 - 0
ylsf-mapper/src/main/java/api/mapper/patient/LabelMapper.java

@@ -0,0 +1,9 @@
1
+package api.mapper.patient;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import api.entity.database.patient.Label;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+@Mapper
8
+public interface LabelMapper extends BaseMapper<Label> {
9
+}

+ 7 - 0
ylsf-service/src/main/java/api/service/patient/ILabelService.java

@@ -0,0 +1,7 @@
1
+package api.service.patient;
2
+
3
+import api.entity.database.patient.Label;
4
+import api.service.IBaseService;
5
+
6
+public interface ILabelService extends IBaseService<Label> {
7
+}

+ 6 - 0
ylsf-service/src/main/java/api/service/patient/IPatientService.java

@@ -1,7 +1,13 @@
1 1
 package api.service.patient;
2 2
 
3 3
 import api.entity.database.patient.Patient;
4
+import api.entity.input.sf.BatchPhoneInput;
4 5
 import api.service.IBaseService;
5 6
 
7
+import java.util.List;
8
+
6 9
 public interface IPatientService extends IBaseService<Patient> {
10
+
11
+
12
+    boolean updatephonestatus(String phone,String status);
7 13
 }

+ 14 - 0
ylsf-service/src/main/java/api/service/patient/impl/LabelServiceImpl.java

@@ -0,0 +1,14 @@
1
+package api.service.patient.impl;
2
+
3
+import api.entity.database.patient.Label;
4
+import api.mapper.patient.LabelMapper;
5
+import api.service.patient.ILabelService;
6
+import api.service.BaseServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+import org.springframework.transaction.annotation.Transactional;
9
+
10
+@Transactional
11
+@Service
12
+public class LabelServiceImpl extends BaseServiceImpl<LabelMapper, Label> implements ILabelService{
13
+    public LabelServiceImpl(){ super(false); }
14
+}

+ 9 - 0
ylsf-service/src/main/java/api/service/patient/impl/PatientServiceImpl.java

@@ -4,6 +4,7 @@ import api.entity.database.patient.Patient;
4 4
 import api.mapper.patient.PatientMapper;
5 5
 import api.service.patient.IPatientService;
6 6
 import api.service.BaseServiceImpl;
7
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
7 8
 import org.springframework.stereotype.Service;
8 9
 import org.springframework.transaction.annotation.Transactional;
9 10
 
@@ -11,4 +12,12 @@ import org.springframework.transaction.annotation.Transactional;
11 12
 @Service
12 13
 public class PatientServiceImpl extends BaseServiceImpl<PatientMapper, Patient> implements IPatientService{
13 14
     public PatientServiceImpl(){ super(false); }
15
+@Override
16
+   public  boolean updatephonestatus(String patientid,String status) {
17
+       LambdaUpdateWrapper<Patient> patient=new LambdaUpdateWrapper<>();
18
+       patient.eq(Patient::getPatientId,patientid);
19
+       patient.set(Patient::getPhoneNumber,status);
20
+       return   this.updateBatch(patient);
21
+
22
+   }
14 23
 }

+ 1 - 1
ylsf-service/src/main/java/api/service/sf/impl/SfPlanPatientServiceImpl.java

@@ -262,7 +262,7 @@ public class SfPlanPatientServiceImpl extends BaseServiceImpl<SfPlanPatientMappe
262 262
             {
263 263
                 ov.setJzks(patientData.getJzks());
264 264
                 ov.setJzksName(patientData.getJzksName());
265
-                ov.setZdjb(patientData.getZdjb());
265
+                ov.setZdjb(patientData.getZjjzjb());
266 266
             }
267 267
             SfPlan Plan = sfPlanService.getEntity(Patients.getPlId());
268 268
             if (Plan!=null)