Selaa lähdekoodia

修个部分问题

张保健 4 vuotta sitten
vanhempi
commit
dc62043684

+ 4 - 4
controllers/base_api_controller.go Näytä tiedosto

@@ -136,9 +136,9 @@ func (this *BaseAuthAPIController) Prepare() {
136 136
 			allPermission, _ := service.GetAllFunctionPurview()
137 137
 
138 138
 			for _, item := range allPermission {
139
-				fmt.Println(len(strings.Split(item.Urlfor, ",")))
139
+				// fmt.Println(len(strings.Split(item.Urlfor, ",")))
140 140
 
141
-				fmt.Println(strings.Split(item.Urlfor, ","))
141
+				// fmt.Println(strings.Split(item.Urlfor, ","))
142 142
 				//fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
143 143
 
144 144
 				//判断当前路由是否在权限路由列表里面
@@ -204,8 +204,8 @@ func (this *BaseAuthAPIController) Prepare() {
204 204
 			allPermission, _ := service.GetAllFunctionPurview()
205 205
 
206 206
 			for _, item := range allPermission {
207
-				fmt.Println(strings.Split(item.Urlfor, ",")[2])
208
-				fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
207
+				// fmt.Println(strings.Split(item.Urlfor, ",")[2])
208
+				// fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
209 209
 
210 210
 				//判断当前路由是否在权限路由列表里面
211 211
 				if strings.Split(item.Urlfor, ",")[2] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {

+ 3 - 0
controllers/dialysis_api_controller.go Näytä tiedosto

@@ -3308,6 +3308,9 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
3308 3308
 		var mode_id int64
3309 3309
 		if schedual != nil {
3310 3310
 			dialysisPrescribe, _ = service.MobileGetDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, recordDate.Unix(), schedual.ModeId)
3311
+			if dialysisPrescribe == nil {
3312
+				dialysisPrescribe, _ = service.MobileGetDialysisPrescribe(adminUserInfo.CurrentOrgId, patient, recordDate.Unix())
3313
+			}
3311 3314
 			lastDialysisPrescribe, _ = service.MobileGetLastDialysisPrescribeByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)
3312 3315
 			// 获取透析模版
3313 3316
 			dialysisSolution, _ = service.MobileGetDialysisSolutionByModeId(adminUserInfo.CurrentOrgId, patient, schedual.ModeId)

+ 21 - 15
controllers/inspection_api_controller.go Näytä tiedosto

@@ -124,10 +124,10 @@ func (c *InspectionApiController) CreatePatientInspection() {
124 124
 		return
125 125
 	}
126 126
 
127
-	timeLayout := "2006-01-02 15:04:05"
127
+	timeLayout := "2006-01-02 15:04"
128 128
 	loc, _ := time.LoadLocation("Local")
129 129
 
130
-	theTime, err := time.ParseInLocation(timeLayout, from.InspectDate+" 00:00:00", loc)
130
+	theTime, err := time.ParseInLocation(timeLayout, from.InspectDate, loc)
131 131
 	if err != nil {
132 132
 		utils.ErrorLog(err.Error())
133 133
 		c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "检验日期不正确")
@@ -226,13 +226,11 @@ func (c *InspectionApiController) CreatePatientInspection() {
226 226
 }
227 227
 
228 228
 func (c *InspectionApiController) EditPatientInspection() {
229
-	fmt.Println("触发了没有---------------------------------------")
230 229
 	patient, _ := c.GetInt64("patient", 0)
231 230
 	remind_cycle, _ := c.GetInt64("remind_cycle", 0)
232
-	dates := c.GetString("dates")
233
-	projectid := c.GetString("projectid")
234
-	fmt.Println("日期---", dates)
235
-	fmt.Println("projectid", projectid)
231
+	// dates := c.GetString("dates")
232
+	// projectid := c.GetString("projectid")
233
+
236 234
 	if patient <= 0 {
237 235
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
238 236
 		return
@@ -253,23 +251,31 @@ func (c *InspectionApiController) EditPatientInspection() {
253 251
 		return
254 252
 	}
255 253
 
256
-	timeLayout := "2006-01-02 15:04:05"
254
+	timeLayout := "2006-01-02 15:04"
257 255
 	loc, _ := time.LoadLocation("Local")
258 256
 
259
-	theTime, err := time.ParseInLocation(timeLayout, from.InspectDate+" 00:00:00", loc)
257
+	theTime, err := time.ParseInLocation(timeLayout, from.InspectDate , loc)
260 258
 	if err != nil {
261 259
 		utils.ErrorLog(err.Error())
262 260
 		c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "检验日期不正确")
263 261
 		return
264 262
 	}
265 263
 
264
+	oldTime, olderr := time.ParseInLocation(timeLayout, from.OldInspectDate , loc)
265
+	if olderr != nil {
266
+		utils.ErrorLog(olderr.Error())
267
+		c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "检验日期不正确")
268
+		return
269
+	}
270
+
266 271
 	if len(from.FormItem) == 0 {
267 272
 		c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "未填写项目")
268 273
 		return
269 274
 	}
270 275
 
271 276
 	date := theTime.Unix()
272
-	insp, err := service.GetPatientInspectionByDate(adminUserInfo.CurrentOrgId, patient, date, from.ProjectId)
277
+	oldDate := oldTime.Unix()
278
+	insp, err := service.GetPatientInspectionByDate(adminUserInfo.CurrentOrgId, patient, oldDate, from.ProjectId)
273 279
 	if err != nil {
274 280
 		utils.ErrorLog("%v", err)
275 281
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -306,10 +312,10 @@ func (c *InspectionApiController) EditPatientInspection() {
306 312
 			inspection.CreatedTime = time.Now().Unix()
307 313
 			inspection.UpdatedTime = time.Now().Unix()
308 314
 			addinsp = append(addinsp, inspection)
309
-		} else if _, exi := inspMap[item.ID]; exi {
310
-			fmt.Println("2222222222")
315
+		} else {
311 316
 			inspection := *inspMap[item.ID]
312 317
 			inspection.InspectValue = item.Value
318
+			inspection.InspectDate = date
313 319
 			inspection.UpdatedTime = time.Now().Unix()
314 320
 			editinsp = append(editinsp, inspection)
315 321
 			noMap = append(noMap, item.ID)
@@ -373,15 +379,15 @@ func (c *InspectionApiController) DeletePatientInspection() {
373 379
 	patient, _ := c.GetInt64("patient", 0)
374 380
 	ProjectId, _ := c.GetInt64("project_id", 0)
375 381
 	InspectDate := c.GetString("date")
376
-	if patient <= 0 || ProjectId <= 0 || len(InspectDate) != 10 {
382
+	if patient <= 0 || ProjectId <= 0 || len(InspectDate) < 10 {
377 383
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
378 384
 		return
379 385
 	}
380 386
 
381
-	timeLayout := "2006-01-02 15:04:05"
387
+	timeLayout := "2006-01-02 15:04"
382 388
 	loc, _ := time.LoadLocation("Local")
383 389
 
384
-	theTime, err := time.ParseInLocation(timeLayout, InspectDate+" 00:00:00", loc)
390
+	theTime, err := time.ParseInLocation(timeLayout, InspectDate, loc)
385 391
 	if err != nil {
386 392
 		utils.ErrorLog(err.Error())
387 393
 		c.ServeFailJsonSend(enums.ErrorCodeParamWrong, "检验日期不正确")

+ 2 - 2
controllers/mobile_api_controllers/mobile_api_base_controller.go Näytä tiedosto

@@ -135,8 +135,8 @@ func (this *MobileBaseAPIAuthController) Prepare() {
135 135
 			allPermission, _ := service.GetAllFunctionPurview()
136 136
 
137 137
 			for _, item := range allPermission {
138
-				fmt.Println(strings.Split(item.Urlfor, ",")[0])
139
-				fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
138
+				// fmt.Println(strings.Split(item.Urlfor, ",")[0])
139
+				// fmt.Println(strings.Split(this.Ctx.Request.RequestURI, "?")[0] + "?" + "mode=" + this.GetString("mode"))
140 140
 
141 141
 				//判断当前路由是否在权限路由列表里面
142 142
 				if strings.Split(item.Urlfor, ",")[0] == strings.Split(this.Ctx.Request.RequestURI, "?")[0]+"?"+"mode="+this.GetString("mode") {

+ 20 - 17
controllers/schedule_api_controller.go Näytä tiedosto

@@ -10,6 +10,7 @@ import (
10 10
 	"github.com/jinzhu/gorm"
11 11
 	"reflect"
12 12
 	"strconv"
13
+	"strings"
13 14
 	"time"
14 15
 
15 16
 	"github.com/astaxie/beego"
@@ -621,11 +622,6 @@ func (this *ScheduleApiController) SearchSchedulePatients() {
621 622
 
622 623
 }
623 624
 
624
-type aa struct {
625
-	b int64
626
-	c int64
627
-}
628
-
629 625
 func (this *ScheduleApiController) GetWeekDaySchedule() {
630 626
 	week_type, _ := this.GetInt64("week_type", -1)
631 627
 	fmt.Println(week_type)
@@ -757,7 +753,7 @@ func (this *ScheduleApiController) ExportSchedule() {
757 753
 			} else {
758 754
 				var patient []*models.Patients
759 755
 				for _, item := range patients {
760
-					if item.Name == name {
756
+					if strings.Replace(item.Name, " ", "", -1) == name {
761 757
 						patient = append(patient, item)
762 758
 					}
763 759
 				}
@@ -765,7 +761,7 @@ func (this *ScheduleApiController) ExportSchedule() {
765 761
 					err_log := models.ExportErrLog{
766 762
 						LogType:    2,
767 763
 						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
768
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
764
+						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列,患者姓名为\"" + name + "\"在系统中不存在,请在系统中添加该病人",
769 765
 						Status:     1,
770 766
 						CreateTime: time.Now().Unix(),
771 767
 						UpdateTime: time.Now().Unix(),
@@ -780,9 +776,12 @@ func (this *ScheduleApiController) ExportSchedule() {
780 776
 				} else if len(patient) > 1 { //出现同名的情况
781 777
 
782 778
 					err_log := models.ExportErrLog{
783
-						LogType:    2,
784
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
785
-						ErrMsg:     "存在同名同姓的两个病人",
779
+						LogType:   2,
780
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
781
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
782
+
783
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列,患者姓名为\"" + name + "\"在在当前机构中存在重名,无法确定到具体患者",
784
+
786 785
 						Status:     1,
787 786
 						CreateTime: time.Now().Unix(),
788 787
 						UpdateTime: time.Now().Unix(),
@@ -1311,15 +1310,17 @@ func (this *ScheduleApiController) ExportScheduleTemplate() {
1311 1310
 			} else {
1312 1311
 				var patient []*models.Patients
1313 1312
 				for _, item := range patients {
1314
-					if item.Name == name {
1313
+					if strings.Replace(item.Name, " ", "", -1) == name {
1315 1314
 						patient = append(patient, item)
1316 1315
 					}
1317 1316
 				}
1318 1317
 				if len(patient) == 0 { //错误日志
1319 1318
 					err_log := models.ExportErrLog{
1320
-						LogType:    3,
1321
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
1322
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
1319
+						LogType:   3,
1320
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
1321
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
1322
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列患者姓名为\"" + name + "\"在系统中不存在,请在系统中添加该病人",
1323
+
1323 1324
 						Status:     1,
1324 1325
 						CreateTime: time.Now().Unix(),
1325 1326
 						UpdateTime: time.Now().Unix(),
@@ -1334,9 +1335,11 @@ func (this *ScheduleApiController) ExportScheduleTemplate() {
1334 1335
 				} else if len(patient) > 1 { //出现同名的情况
1335 1336
 
1336 1337
 					err_log := models.ExportErrLog{
1337
-						LogType:    3,
1338
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
1339
-						ErrMsg:     "存在同名同姓的两个病人",
1338
+						LogType:   3,
1339
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
1340
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
1341
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列患者姓名为\"" + name + "\"在当前机构中存在重名,无法确定到具体患者",
1342
+
1340 1343
 						Status:     1,
1341 1344
 						CreateTime: time.Now().Unix(),
1342 1345
 						UpdateTime: time.Now().Unix(),

+ 1 - 0
models/inspection_models.go Näytä tiedosto

@@ -91,6 +91,7 @@ type InepectionForm struct {
91 91
 	Method      string `json:"method"`
92 92
 	ProjectId   int64  `json:"project_id"`
93 93
 	InspectDate string `json:"inspect_date"`
94
+	OldInspectDate string `json:"old_inspect_date"`
94 95
 	FormItem    []struct {
95 96
 		ID          int64  `json:"id"`
96 97
 		ProjectId   int64  `json:"project_id"`

+ 16 - 0
数据变更脚本.sql Näytä tiedosto

@@ -0,0 +1,16 @@
1
+--2020-06-17 author 张保健 --
2
+--透前评估添加体液过多症状字段--
3
+ALTER TABLE `sgj_xt`.`xt_assessment_before_dislysis`     ADD COLUMN `humor_excessive_symptom` SMALLINT(2) DEFAULT '0' NULL COMMENT '体液过多症状' AFTER `dialysis_intakes_unit`;
4
+--数据字典表里添加体液过多症状--
5
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '0','hemodialysis','0','体液过多症状','humor_excessive_symptom','0','2020-06-17 16:56:00','2020-06-17 16:56:00','0','1',NULL,'0',NULL,NULL,'0');
6
+--数据字典表里添加体液过多症状配置项,parent_id为上条语句的id--
7
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','无',NULL,'1','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
8
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿+',NULL,'2','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
9
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿++',NULL,'3','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
10
+INSERT INTO `sgj_xt`.`xt_data_config`(`parent_id`,`module`,`org_id`,`name`,`field_name`,`value`,`create_time`,`update_time`,`create_user_id`,`status`,`remark`,`delete_id_system`,`title`,`content`,`orders`) VALUES ( '1997','hemodialysis','0','下肢水肿+++',NULL,'4','2020-06-17 16:00:00','2020-06-17 16:00:00','0','1',NULL,'0',NULL,NULL,'0');
11
+--显示配置里添加体液过程症状--
12
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '0','3','humor_excessive_symptom','体液过多症状','2',NULL,NULL,'0');
13
+--添加显示体液过程症状的机构 org_id为要显示的机构--
14
+INSERT INTO `sgj_xt`.`xt_filed_config`(`org_id`,`module`,`filed_name`,`filed_name_cn`,`is_show`,`create_time`,`update_time`,`sys_module`) VALUES ( '13','3','humor_excessive_symptom','体液过多症状','1',NULL,NULL,'0');
15
+
16
+