Browse Source

历史排班

28169 1 year ago
parent
commit
f0e0de1f80

+ 270 - 1
controllers/patient_dataconfig_api_controller.go View File

@@ -5,6 +5,7 @@ import (
5 5
 	"XT_New/models"
6 6
 	"XT_New/service"
7 7
 	"XT_New/utils"
8
+	"encoding/json"
8 9
 	"fmt"
9 10
 	"strconv"
10 11
 	"strings"
@@ -42,6 +43,12 @@ func PatientDataConfigAPIControllerRegistRouters() {
42 43
 
43 44
 	beego.Router("/api/patient/getpatientallagic", &PatientDataConfigAPIController{}, "Get:GetPatientAllagicList")
44 45
 
46
+	beego.Router("/api/patient/savesitemap", &PatientDataConfigAPIController{}, "Post:SaveSiteMap")
47
+
48
+	beego.Router("/api/patient/getpatientsitemap", &PatientDataConfigAPIController{}, "Get:GetPatientSitemap")
49
+
50
+	beego.Router("/api/patient/updatesitemap", &PatientDataConfigAPIController{}, "Post:UpdateSiteMap")
51
+
45 52
 }
46 53
 
47 54
 type PatientDataConfigAPIController struct {
@@ -1147,10 +1154,272 @@ func (this *PatientDataConfigAPIController) GetContextScheduleList() {
1147 1154
 func (this *PatientDataConfigAPIController) GetPatientAllagicList() {
1148 1155
 
1149 1156
 	id, _ := this.GetInt64("id")
1150
-	fmt.Println("id2ooooooooooooooooooo", id)
1151 1157
 	orgId := this.GetAdminUserInfo().CurrentOrgId
1152 1158
 	list, _ := service.GetPatientAllagicList(id, orgId)
1153 1159
 	this.ServeSuccessJSON(map[string]interface{}{
1154 1160
 		"list": list,
1155 1161
 	})
1156 1162
 }
1163
+
1164
+func (this *PatientDataConfigAPIController) SaveSiteMap() {
1165
+
1166
+	dataBody := make(map[string]interface{}, 0)
1167
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1168
+	if err != nil {
1169
+		utils.ErrorLog(err.Error())
1170
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1171
+		return
1172
+	}
1173
+
1174
+	is_append := int64(dataBody["is_append"].(float64))
1175
+
1176
+	is_img_v := int64(dataBody["is_img_v"].(float64))
1177
+
1178
+	is_img_a := int64(dataBody["is_img_a"].(float64))
1179
+
1180
+	a_num := dataBody["a_num"].(float64)
1181
+
1182
+	v_num := dataBody["v_num"].(float64)
1183
+
1184
+	text_num := dataBody["text_num"].(float64)
1185
+
1186
+	fangxianga_num := dataBody["fangxianga_num"].(float64)
1187
+
1188
+	fangxianga_left := dataBody["fangxianga_left"].(float64)
1189
+
1190
+	fangxianga_top := dataBody["fangxianga_top"].(float64)
1191
+
1192
+	fangxiangv_left := dataBody["fangxiangv_left"].(float64)
1193
+
1194
+	fangxiangv_top := dataBody["fangxiangv_top"].(float64)
1195
+
1196
+	fuzhua_num := dataBody["fuzhua_num"].(float64)
1197
+
1198
+	fuzhuv_num := dataBody["fuzhuv_num"].(float64)
1199
+
1200
+	xuanzhuan_a := dataBody["xuanzhuan_a"].(float64)
1201
+
1202
+	xuanzhuan_v := dataBody["xuanzhuan_v"].(float64)
1203
+
1204
+	fuzhua_top := dataBody["fuzhua_top"].(float64)
1205
+
1206
+	fuzhua_left := dataBody["fuzhua_left"].(float64)
1207
+
1208
+	fuzhuv_top := dataBody["fuzhuv_top"].(float64)
1209
+
1210
+	fuzhuv_left := dataBody["fuzhuv_left"].(float64)
1211
+
1212
+	a_arr_str := dataBody["a_arr_str"].(string)
1213
+
1214
+	v_arr_str := dataBody["v_arr_str"].(string)
1215
+
1216
+	a_left := dataBody["a_left"].(float64)
1217
+
1218
+	a_top := dataBody["a_top"].(float64)
1219
+
1220
+	v_left := dataBody["v_left"].(float64)
1221
+
1222
+	v_top := dataBody["v_top"].(float64)
1223
+
1224
+	text_arr_str := dataBody["text_arr_str"].(string)
1225
+
1226
+	text_left := dataBody["text_left"].(float64)
1227
+
1228
+	text_top := dataBody["text_top"].(float64)
1229
+
1230
+	scalev_num := dataBody["scalev_num"].(float64)
1231
+
1232
+	scalea_num := dataBody["scalea_num"].(float64)
1233
+
1234
+	value := dataBody["value"].(string)
1235
+
1236
+	patient_id := int64(dataBody["patient_id"].(float64))
1237
+
1238
+	user_org_id := this.GetAdminUserInfo().CurrentOrgId
1239
+
1240
+	deviceValsualMap := models.XtDeviceValsualMap{
1241
+		PatientId:      patient_id,
1242
+		IsAppend:       is_append,
1243
+		IsImgV:         is_img_v,
1244
+		IsImgA:         is_img_a,
1245
+		ANum:           a_num,
1246
+		VNum:           v_num,
1247
+		TextNum:        text_num,
1248
+		FangxiangaNum:  fangxianga_num,
1249
+		FangxiangaLeft: fangxianga_left,
1250
+		FangxiangaTop:  fangxianga_top,
1251
+		FangxiangvLeft: fangxiangv_left,
1252
+		FangxiangvTop:  fangxiangv_top,
1253
+		FuzhuaNum:      fuzhua_num,
1254
+		FuzhuvNum:      fuzhuv_num,
1255
+		XuanzhuanA:     xuanzhuan_a,
1256
+		XuanzhuanV:     xuanzhuan_v,
1257
+		FuzhuaTop:      fuzhua_top,
1258
+		FuzhuaLeft:     fuzhua_left,
1259
+		FuzhuvTop:      fuzhuv_top,
1260
+		FuzhuvLeft:     fuzhuv_left,
1261
+		AArrStr:        a_arr_str,
1262
+		VArrStr:        v_arr_str,
1263
+		ALeft:          a_left,
1264
+		ATop:           a_top,
1265
+		VLeft:          v_left,
1266
+		VTop:           v_top,
1267
+		TextArrStr:     text_arr_str,
1268
+		TextLeft:       text_left,
1269
+		TextTop:        text_top,
1270
+		ScalevNum:      scalev_num,
1271
+		ScaleaNum:      scalea_num,
1272
+		Value:          value,
1273
+		Status:         1,
1274
+		UserOrgId:      user_org_id,
1275
+	}
1276
+
1277
+	err = service.CreateDeviceValsualMap(deviceValsualMap)
1278
+
1279
+	if err != nil {
1280
+		this.ServeSuccessJSON(map[string]interface{}{
1281
+			"deviceValsualMap": deviceValsualMap,
1282
+		})
1283
+	}
1284
+
1285
+}
1286
+
1287
+func (this *PatientDataConfigAPIController) GetPatientSitemap() {
1288
+
1289
+	patient_id, _ := this.GetInt64("patient_id")
1290
+
1291
+	orgId := this.GetAdminUserInfo().CurrentOrgId
1292
+
1293
+	sitemap, err := service.GetPatientSitemap(patient_id, orgId)
1294
+	if err != nil {
1295
+		this.ServeSuccessJSON(map[string]interface{}{
1296
+			"sitemap": sitemap,
1297
+		})
1298
+	}
1299
+}
1300
+
1301
+func (this *PatientDataConfigAPIController) UpdateSiteMap() {
1302
+
1303
+	dataBody := make(map[string]interface{}, 0)
1304
+	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
1305
+	if err != nil {
1306
+		utils.ErrorLog(err.Error())
1307
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
1308
+		return
1309
+	}
1310
+
1311
+	is_append := int64(dataBody["is_append"].(float64))
1312
+
1313
+	is_img_v := int64(dataBody["is_img_v"].(float64))
1314
+
1315
+	is_img_a := int64(dataBody["is_img_a"].(float64))
1316
+
1317
+	a_num := dataBody["a_num"].(float64)
1318
+
1319
+	v_num := dataBody["v_num"].(float64)
1320
+
1321
+	text_num := dataBody["text_num"].(float64)
1322
+
1323
+	fangxianga_num := dataBody["fangxianga_num"].(float64)
1324
+
1325
+	fangxianga_left := dataBody["fangxianga_left"].(float64)
1326
+
1327
+	fangxianga_top := dataBody["fangxianga_top"].(float64)
1328
+
1329
+	fangxiangv_left := dataBody["fangxiangv_left"].(float64)
1330
+
1331
+	fangxiangv_top := dataBody["fangxiangv_top"].(float64)
1332
+
1333
+	fuzhua_num := dataBody["fuzhua_num"].(float64)
1334
+
1335
+	fuzhuv_num := dataBody["fuzhuv_num"].(float64)
1336
+
1337
+	xuanzhuan_a := dataBody["xuanzhuan_a"].(float64)
1338
+
1339
+	xuanzhuan_v := dataBody["xuanzhuan_v"].(float64)
1340
+
1341
+	fuzhua_top := dataBody["fuzhua_top"].(float64)
1342
+
1343
+	fuzhua_left := dataBody["fuzhua_left"].(float64)
1344
+
1345
+	fuzhuv_top := dataBody["fuzhuv_top"].(float64)
1346
+
1347
+	fuzhuv_left := dataBody["fuzhuv_left"].(float64)
1348
+
1349
+	a_arr_str := dataBody["a_arr_str"].(string)
1350
+
1351
+	v_arr_str := dataBody["v_arr_str"].(string)
1352
+
1353
+	a_left := dataBody["a_left"].(float64)
1354
+
1355
+	a_top := dataBody["a_top"].(float64)
1356
+
1357
+	v_left := dataBody["v_left"].(float64)
1358
+
1359
+	v_top := dataBody["v_top"].(float64)
1360
+
1361
+	text_arr_str := dataBody["text_arr_str"].(string)
1362
+
1363
+	text_left := dataBody["text_left"].(float64)
1364
+
1365
+	text_top := dataBody["text_top"].(float64)
1366
+
1367
+	scalev_num := dataBody["scalev_num"].(float64)
1368
+
1369
+	scalea_num := dataBody["scalea_num"].(float64)
1370
+
1371
+	value := dataBody["value"].(string)
1372
+
1373
+	patient_id := int64(dataBody["patient_id"].(float64))
1374
+
1375
+	id := int64(dataBody["id"].(float64))
1376
+
1377
+	user_org_id := this.GetAdminUserInfo().CurrentOrgId
1378
+
1379
+	deviceValsualMap := models.XtDeviceValsualMap{
1380
+		ID:             id,
1381
+		PatientId:      patient_id,
1382
+		IsAppend:       is_append,
1383
+		IsImgV:         is_img_v,
1384
+		IsImgA:         is_img_a,
1385
+		ANum:           a_num,
1386
+		VNum:           v_num,
1387
+		TextNum:        text_num,
1388
+		FangxiangaNum:  fangxianga_num,
1389
+		FangxiangaLeft: fangxianga_left,
1390
+		FangxiangaTop:  fangxianga_top,
1391
+		FangxiangvLeft: fangxiangv_left,
1392
+		FangxiangvTop:  fangxiangv_top,
1393
+		FuzhuaNum:      fuzhua_num,
1394
+		FuzhuvNum:      fuzhuv_num,
1395
+		XuanzhuanA:     xuanzhuan_a,
1396
+		XuanzhuanV:     xuanzhuan_v,
1397
+		FuzhuaTop:      fuzhua_top,
1398
+		FuzhuaLeft:     fuzhua_left,
1399
+		FuzhuvTop:      fuzhuv_top,
1400
+		FuzhuvLeft:     fuzhuv_left,
1401
+		AArrStr:        a_arr_str,
1402
+		VArrStr:        v_arr_str,
1403
+		ALeft:          a_left,
1404
+		ATop:           a_top,
1405
+		VLeft:          v_left,
1406
+		VTop:           v_top,
1407
+		TextArrStr:     text_arr_str,
1408
+		TextLeft:       text_left,
1409
+		TextTop:        text_top,
1410
+		ScalevNum:      scalev_num,
1411
+		ScaleaNum:      scalea_num,
1412
+		Value:          value,
1413
+		Status:         1,
1414
+		UserOrgId:      user_org_id,
1415
+	}
1416
+
1417
+	err = service.UpdateSiteMap(deviceValsualMap)
1418
+
1419
+	if err != nil {
1420
+		this.ServeSuccessJSON(map[string]interface{}{
1421
+			"deviceValsualMap": deviceValsualMap,
1422
+		})
1423
+	}
1424
+
1425
+}

+ 3 - 4
controllers/print_data_api_controller.go View File

@@ -37,7 +37,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
37 37
 	idStrs := strings.Split(schIDStr, ",")
38 38
 	adminUserInfo := this.GetAdminUserInfo()
39 39
 
40
-	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
40
+	if this.GetAdminUserInfo().CurrentOrgId == 10016 || this.GetAdminUserInfo().CurrentOrgId == 9882 || this.GetAdminUserInfo().CurrentOrgId == 10138 || this.GetAdminUserInfo().CurrentOrgId == 10278 || this.GetAdminUserInfo().CurrentOrgId == 9841 || this.GetAdminUserInfo().CurrentOrgId == 9845 || this.GetAdminUserInfo().CurrentOrgId == 10081 || this.GetAdminUserInfo().CurrentOrgId == 10215 || this.GetAdminUserInfo().CurrentOrgId == 10121 || this.GetAdminUserInfo().CurrentOrgId == 10234 || this.GetAdminUserInfo().CurrentOrgId == 10188 || this.GetAdminUserInfo().CurrentOrgId == 10217 || this.GetAdminUserInfo().CurrentOrgId == 10340 || this.GetAdminUserInfo().CurrentOrgId == 9905 || this.GetAdminUserInfo().CurrentOrgId == 10346 || this.GetAdminUserInfo().CurrentOrgId == 10441 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 {
41 41
 
42 42
 		schedules, getScheduleErr := service.GetSchedulesSeven(adminUserInfo.CurrentOrgId, idStrs)
43 43
 		for _, item := range schedules {
@@ -97,10 +97,9 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
97 97
 
98 98
 			item.Schedule = &lastSchedule
99 99
 
100
-			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10495 {
100
+			if this.GetAdminUserInfo().CurrentOrgId == 10101 || this.GetAdminUserInfo().CurrentOrgId == 9671 || this.GetAdminUserInfo().CurrentOrgId == 10345 || this.GetAdminUserInfo().CurrentOrgId == 9970 || this.GetAdminUserInfo().CurrentOrgId == 10495 || this.GetAdminUserInfo().CurrentOrgId == 10013 || this.GetAdminUserInfo().CurrentOrgId == 10014 {
101 101
 
102 102
 				if item.ScheduleDate <= 1672416000 {
103
-
104 103
 					listOne, _ := service.GetDialysisOrderCountEight(adminUserInfo.CurrentOrgId, item.PatientID, item.ScheduleDate)
105 104
 
106 105
 					item.Patient.TotalDialysis = listOne.Count
@@ -145,7 +144,7 @@ func (this *PrintDataAPIController) ScheduleDialysisRecordPrintData() {
145 144
 		})
146 145
 	}
147 146
 
148
-	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 {
147
+	if this.GetAdminUserInfo().CurrentOrgId != 10016 && this.GetAdminUserInfo().CurrentOrgId != 9882 && this.GetAdminUserInfo().CurrentOrgId != 10138 && this.GetAdminUserInfo().CurrentOrgId != 10278 && this.GetAdminUserInfo().CurrentOrgId != 9841 && this.GetAdminUserInfo().CurrentOrgId != 9845 && this.GetAdminUserInfo().CurrentOrgId != 10081 && this.GetAdminUserInfo().CurrentOrgId != 10215 && this.GetAdminUserInfo().CurrentOrgId != 10121 && this.GetAdminUserInfo().CurrentOrgId != 10234 && this.GetAdminUserInfo().CurrentOrgId != 10188 && this.GetAdminUserInfo().CurrentOrgId != 10217 && this.GetAdminUserInfo().CurrentOrgId != 10340 && this.GetAdminUserInfo().CurrentOrgId != 9905 && this.GetAdminUserInfo().CurrentOrgId != 10346 && this.GetAdminUserInfo().CurrentOrgId != 10441 && this.GetAdminUserInfo().CurrentOrgId != 9970 && this.GetAdminUserInfo().CurrentOrgId != 10101 && this.GetAdminUserInfo().CurrentOrgId != 10495 && this.GetAdminUserInfo().CurrentOrgId != 10013 && this.GetAdminUserInfo().CurrentOrgId != 10014 {
149 148
 		schedules, getScheduleErr := service.GetSchedules(adminUserInfo.CurrentOrgId, idStrs)
150 149
 		for _, item := range schedules {
151 150
 			list, _ := service.GetDialysisOrderCountSeven(item.PatientID, item.ScheduleDate)

+ 10 - 10
controllers/self_drug_api_congtroller.go View File

@@ -3684,57 +3684,57 @@ func (this *SelfDrugApiController) GetGoodNewPurchaseStockQuery() {
3684 3684
 	manufacturerList, _ := service.GetNewAllManufacturerList(orgId)
3685 3685
 
3686 3686
 	if orgId == 10265 {
3687
-		storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3687
+		//storeConfig, _ := service.GetAllStoreHouseConfig(orgId)
3688 3688
 
3689 3689
 		list, total, err := service.GetGoodNewPurchaseStockQuery(good_type, keyword, page, limit, orgId, ids, goodIds)
3690 3690
 
3691 3691
 		for _, item := range list {
3692 3692
 
3693 3693
 			//获取期初结余
3694
-			low, _ := service.GetStartLastFLow(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
3694
+			low, _ := service.GetStartLastFLowTwenty(item.ID, orgId, startTime)
3695 3695
 
3696 3696
 			item.GoodStartFlowInfo = low
3697 3697
 
3698 3698
 			//获取期末结余
3699
-			flow, _ := service.GetEndLastFlow(item.ID, orgId, endTime, storeConfig.StorehouseOutInfo)
3699
+			flow, _ := service.GetEndLastFlowTwenty(item.ID, orgId, endTime)
3700 3700
 
3701 3701
 			item.GoodEndFlowInfo = flow
3702 3702
 
3703 3703
 			//获取期间增加
3704
-			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3704
+			goodWarehouseInfoList, _ := service.GetAddGoodWarehouseInfoListTwenty(item.ID, orgId, startTime, endTime)
3705 3705
 			for _, it := range goodWarehouseInfoList {
3706 3706
 				item.WarehousingInfoOne = append(item.WarehousingInfoOne, it)
3707 3707
 			}
3708 3708
 
3709 3709
 			//获取本期增加
3710
-			WarehouseInfoFlowList, _ := service.GetAddStartFlow(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3710
+			WarehouseInfoFlowList, _ := service.GetAddStartFlowTwenty(item.ID, orgId, startTime, endTime)
3711 3711
 			for _, it := range WarehouseInfoFlowList {
3712 3712
 				item.StartFlowWarehouseInfo = append(item.StartFlowWarehouseInfo, it)
3713 3713
 			}
3714 3714
 			//获取本期减少
3715
-			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoList(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3715
+			reduceWarehouseInfoList, _ := service.GetReduceWarehouseInfoListTwenty(item.ID, orgId, startTime, endTime)
3716 3716
 			for _, it := range reduceWarehouseInfoList {
3717 3717
 				item.WarehouseOutInfoStart = append(item.WarehouseOutInfoStart, it)
3718 3718
 			}
3719 3719
 
3720 3720
 			//获取期中减少退库
3721
-			lowInfo, _ := service.GetStartEndCancelFLowInfo(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3721
+			lowInfo, _ := service.GetStartEndCancelFLowInfoTwenty(item.ID, orgId, startTime, endTime)
3722 3722
 			for _, it := range lowInfo {
3723 3723
 				item.StartEndCancelFLowInfo = append(item.StartEndCancelFLowInfo, it)
3724 3724
 			}
3725 3725
 			//
3726
-			outInfo, _ := service.FindeWarehouseOutInfo(item.ID, orgId, startTime, storeConfig.StorehouseOutInfo)
3726
+			outInfo, _ := service.FindeWarehouseOutInfoTwenty(item.ID, orgId, startTime)
3727 3727
 			for _, it := range outInfo {
3728 3728
 				item.WarehouseOutInfoEnd = append(item.WarehouseOutInfoEnd, it)
3729 3729
 			}
3730 3730
 
3731 3731
 			//期中盘盈
3732
-			profit, _ := service.FindeEndStokInventoryProfit(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3732
+			profit, _ := service.FindeEndStokInventoryProfitTwenty(item.ID, orgId, startTime, endTime)
3733 3733
 			for _, it := range profit {
3734 3734
 				item.WareStartEndStockInventoryProfit = append(item.WareStartEndStockInventoryProfit, it)
3735 3735
 			}
3736 3736
 			//期中盘亏
3737
-			losses, _ := service.FindeEndStockInventoryLosses(item.ID, orgId, startTime, endTime, storeConfig.StorehouseOutInfo)
3737
+			losses, _ := service.FindeEndStockInventoryLossesTwenty(item.ID, orgId, startTime, endTime)
3738 3738
 			for _, it := range losses {
3739 3739
 				item.WareStartEndStockInventoryLosses = append(item.WareStartEndStockInventoryLosses, it)
3740 3740
 			}

+ 42 - 0
models/patient_models.go View File

@@ -2125,3 +2125,45 @@ type XtScheduleLog struct {
2125 2125
 func (XtScheduleLog) TableName() string {
2126 2126
 	return "xt_schedule_log"
2127 2127
 }
2128
+
2129
+type XtDeviceValsualMap struct {
2130
+	ID             int64   `gorm:"column:id" json:"id" form:"id"`
2131
+	PatientId      int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
2132
+	IsAppend       int64   `gorm:"column:is_append" json:"is_append" form:"is_append"`
2133
+	IsImgV         int64   `gorm:"column:is_img_v" json:"is_img_v" form:"is_img_v"`
2134
+	IsImgA         int64   `gorm:"column:is_img_a" json:"is_img_a" form:"is_img_a"`
2135
+	ANum           float64 `gorm:"column:a_num" json:"a_num" form:"a_num"`
2136
+	VNum           float64 `gorm:"column:v_num" json:"v_num" form:"v_num"`
2137
+	TextNum        float64 `gorm:"column:text_num" json:"text_num" form:"text_num"`
2138
+	FangxiangaNum  float64 `gorm:"column:fangxianga_num" json:"fangxianga_num" form:"fangxianga_num"`
2139
+	FangxiangaLeft float64 `gorm:"column:fangxianga_left" json:"fangxianga_left" form:"fangxianga_left"`
2140
+	FangxiangaTop  float64 `gorm:"column:fangxianga_top" json:"fangxianga_top" form:"fangxianga_top"`
2141
+	FangxiangvLeft float64 `gorm:"column:fangxiangv_left" json:"fangxiangv_left" form:"fangxiangv_left"`
2142
+	FangxiangvTop  float64 `gorm:"column:fangxiangv_top" json:"fangxiangv_top" form:"fangxiangv_top"`
2143
+	FuzhuaNum      float64 `gorm:"column:fuzhua_num" json:"fuzhua_num" form:"fuzhua_num"`
2144
+	FuzhuvNum      float64 `gorm:"column:fuzhuv_num" json:"fuzhuv_num" form:"fuzhuv_num"`
2145
+	XuanzhuanA     float64 `gorm:"column:xuanzhuan_a" json:"xuanzhuan_a" form:"xuanzhuan_a"`
2146
+	XuanzhuanV     float64 `gorm:"column:xuanzhuan_v" json:"xuanzhuan_v" form:"xuanzhuan_v"`
2147
+	FuzhuaTop      float64 `gorm:"column:fuzhua_top" json:"fuzhua_top" form:"fuzhua_top"`
2148
+	FuzhuaLeft     float64 `gorm:"column:fuzhua_left" json:"fuzhua_left" form:"fuzhua_left"`
2149
+	FuzhuvTop      float64 `gorm:"column:fuzhuv_top" json:"fuzhuv_top" form:"fuzhuv_top"`
2150
+	FuzhuvLeft     float64 `gorm:"column:fuzhuv_left" json:"fuzhuv_left" form:"fuzhuv_left"`
2151
+	AArrStr        string  `gorm:"column:a_arr_str" json:"a_arr_str" form:"a_arr_str"`
2152
+	VArrStr        string  `gorm:"column:v_arr_str" json:"v_arr_str" form:"v_arr_str"`
2153
+	ALeft          float64 `gorm:"column:a_left" json:"a_left" form:"a_left"`
2154
+	ATop           float64 `gorm:"column:a_top" json:"a_top" form:"a_top"`
2155
+	VLeft          float64 `gorm:"column:v_left" json:"v_left" form:"v_left"`
2156
+	VTop           float64 `gorm:"column:v_top" json:"v_top" form:"v_top"`
2157
+	TextArrStr     string  `gorm:"column:text_arr_str" json:"text_arr_str" form:"text_arr_str"`
2158
+	TextLeft       float64 `gorm:"column:text_left" json:"text_left" form:"text_left"`
2159
+	TextTop        float64 `gorm:"column:text_top" json:"text_top" form:"text_top"`
2160
+	ScalevNum      float64 `gorm:"column:scalev_num" json:"scalev_num" form:"scalev_num"`
2161
+	ScaleaNum      float64 `gorm:"column:scalea_num" json:"scalea_num" form:"scalea_num"`
2162
+	Value          string  `gorm:"column:value" json:"value" form:"value"`
2163
+	Status         int64   `gorm:"column:status" json:"status" form:"status"`
2164
+	UserOrgId      int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
2165
+}
2166
+
2167
+func (XtDeviceValsualMap) TableName() string {
2168
+	return "xt_device_valsual_map"
2169
+}

+ 20 - 0
service/patient_service.go View File

@@ -3074,3 +3074,23 @@ func GetBaseDrugByName(drug_name string, org_id int64) (models.BaseDrugLibSeven,
3074 3074
 
3075 3075
 	return libSeven, err
3076 3076
 }
3077
+
3078
+func CreateDeviceValsualMap(valsualMap models.XtDeviceValsualMap) error {
3079
+
3080
+	err := XTWriteDB().Create(&valsualMap).Error
3081
+
3082
+	return err
3083
+}
3084
+
3085
+func GetPatientSitemap(patient_id int64, user_org_id int64) (models.XtDeviceValsualMap, error) {
3086
+
3087
+	valsualMap := models.XtDeviceValsualMap{}
3088
+	err := XTReadDB().Where("patient_id = ? and status =1 and user_org_id = ?", patient_id, user_org_id).Find(&valsualMap).Error
3089
+	return valsualMap, err
3090
+}
3091
+
3092
+func UpdateSiteMap(valsualMap models.XtDeviceValsualMap) error {
3093
+
3094
+	err := XTWriteDB().Save(&valsualMap).Error
3095
+	return err
3096
+}

+ 142 - 0
service/self_drug_service.go View File

@@ -2033,6 +2033,24 @@ func GetAddGoodWarehouseInfoList(good_id int64, orgid int64, startime int64, end
2033 2033
 	return info, err
2034 2034
 }
2035 2035
 
2036
+func GetAddGoodWarehouseInfoListTwenty(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.StartWarehousingInfo, err error) {
2037
+	db := XTReadDB().Model(&info).Where("status = 1 and is_check =1")
2038
+	if good_id > 0 {
2039
+		db = db.Where("good_id = ?", good_id)
2040
+	}
2041
+	if orgid > 0 {
2042
+		db = db.Where("org_id = ?", orgid)
2043
+	}
2044
+	if startime > 0 {
2045
+		db = db.Where("ctime >=?", startime)
2046
+	}
2047
+	if endtime > 0 {
2048
+		db = db.Where("ctime <=?", endtime)
2049
+	}
2050
+	err = db.Find(&info).Error
2051
+	return info, err
2052
+}
2053
+
2036 2054
 func GetAddStartFlow(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (info []*models.VmStockFlowTwenty, err error) {
2037 2055
 	db := XTReadDB().Model(&info).Where("status = 1 and (consumable_type =1 or consumable_type = 13)")
2038 2056
 	if good_id > 0 {
@@ -2054,6 +2072,25 @@ func GetAddStartFlow(good_id int64, orgid int64, startime int64, endtime int64,
2054 2072
 	return info, err
2055 2073
 }
2056 2074
 
2075
+func GetAddStartFlowTwenty(good_id int64, orgid int64, startime int64, endtime int64) (info []*models.VmStockFlowTwenty, err error) {
2076
+	db := XTReadDB().Model(&info).Where("status = 1 and (consumable_type =1)")
2077
+	if good_id > 0 {
2078
+		db = db.Where("good_id = ?", good_id)
2079
+	}
2080
+	if orgid > 0 {
2081
+		db = db.Where("user_org_id = ?", orgid)
2082
+	}
2083
+	if startime > 0 {
2084
+		db = db.Where("ctime >=?", startime)
2085
+	}
2086
+	if endtime > 0 {
2087
+		db = db.Where("ctime <=?", endtime)
2088
+	}
2089
+
2090
+	err = db.Find(&info).Error
2091
+	return info, err
2092
+}
2093
+
2057 2094
 func GetReduceWarehouseInfoList(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2058 2095
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type= 15)")
2059 2096
 	if good_id > 0 {
@@ -2075,6 +2112,24 @@ func GetReduceWarehouseInfoList(good_id int64, orgid int64, startime int64, endt
2075 2112
 	return outinfo, err
2076 2113
 }
2077 2114
 
2115
+func GetReduceWarehouseInfoListTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2116
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type= 15)")
2117
+	if good_id > 0 {
2118
+		db = db.Where("good_id = ?", good_id)
2119
+	}
2120
+	if orgid > 0 {
2121
+		db = db.Where("user_org_id = ?", orgid)
2122
+	}
2123
+	if startime > 0 {
2124
+		db = db.Where("ctime >=?", startime)
2125
+	}
2126
+	if endtime > 0 {
2127
+		db = db.Where("ctime <=?", endtime)
2128
+	}
2129
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2130
+	return outinfo, err
2131
+}
2132
+
2078 2133
 func GetStartEndCancelFLowInfo(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2079 2134
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 7)")
2080 2135
 	if good_id > 0 {
@@ -2096,6 +2151,24 @@ func GetStartEndCancelFLowInfo(good_id int64, orgid int64, startime int64, endti
2096 2151
 	return outinfo, err
2097 2152
 }
2098 2153
 
2154
+func GetStartEndCancelFLowInfoTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2155
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 7)")
2156
+	if good_id > 0 {
2157
+		db = db.Where("good_id = ?", good_id)
2158
+	}
2159
+	if orgid > 0 {
2160
+		db = db.Where("user_org_id = ?", orgid)
2161
+	}
2162
+	if startime > 0 {
2163
+		db = db.Where("ctime >=?", startime)
2164
+	}
2165
+	if endtime > 0 {
2166
+		db = db.Where("ctime <=?", endtime)
2167
+	}
2168
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2169
+	return outinfo, err
2170
+}
2171
+
2099 2172
 func FindeStartFlowInfo(good_id int64, orgid int64, startime int64) (info []*models.VmStockFlowTwenty, err error) {
2100 2173
 
2101 2174
 	db := XTReadDB().Model(&info).Where("status = 1 and consumable_type = 1")
@@ -2210,6 +2283,23 @@ func FindeWarehouseOutInfo(good_id int64, orgid int64, startime int64, storehous
2210 2283
 	return outinfo, err
2211 2284
 }
2212 2285
 
2286
+func FindeWarehouseOutInfoTwenty(good_id int64, orgid int64, startime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2287
+
2288
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 2 or consumable_type = 3 or consumable_type = 15)")
2289
+	if good_id > 0 {
2290
+		db = db.Where("good_id = ?", good_id)
2291
+	}
2292
+	if orgid > 0 {
2293
+		db = db.Where("user_org_id = ?", orgid)
2294
+	}
2295
+	if startime > 0 {
2296
+		db = db.Where("ctime <?", startime)
2297
+	}
2298
+
2299
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2300
+	return outinfo, err
2301
+}
2302
+
2213 2303
 func FindeStartStockInventoryProfit(good_id int64, orgid int64, startime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2214 2304
 
2215 2305
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 10)")
@@ -2248,6 +2338,26 @@ func FindeEndStokInventoryProfit(good_id int64, orgid int64, startime int64, end
2248 2338
 	return outinfo, err
2249 2339
 }
2250 2340
 
2341
+func FindeEndStokInventoryProfitTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2342
+
2343
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 10)")
2344
+	if good_id > 0 {
2345
+		db = db.Where("good_id = ?", good_id)
2346
+	}
2347
+	if orgid > 0 {
2348
+		db = db.Where("user_org_id = ?", orgid)
2349
+	}
2350
+	if startime > 0 {
2351
+		db = db.Where("ctime >=?", startime)
2352
+	}
2353
+	if endtime < 0 {
2354
+		db = db.Where("ctime <=?", endtime)
2355
+	}
2356
+
2357
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2358
+	return outinfo, err
2359
+}
2360
+
2251 2361
 func FindeEndStockInventoryLosses(good_id int64, orgid int64, startime int64, endtime int64, storehouse_id int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2252 2362
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 11)")
2253 2363
 	if good_id > 0 {
@@ -2269,6 +2379,25 @@ func FindeEndStockInventoryLosses(good_id int64, orgid int64, startime int64, en
2269 2379
 	return outinfo, err
2270 2380
 }
2271 2381
 
2382
+func FindeEndStockInventoryLossesTwenty(good_id int64, orgid int64, startime int64, endtime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2383
+	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 11)")
2384
+	if good_id > 0 {
2385
+		db = db.Where("good_id = ?", good_id)
2386
+	}
2387
+	if orgid > 0 {
2388
+		db = db.Where("user_org_id = ?", orgid)
2389
+	}
2390
+	if startime > 0 {
2391
+		db = db.Where("ctime >=?", startime)
2392
+	}
2393
+	if endtime < 0 {
2394
+		db = db.Where("ctime <=?", endtime)
2395
+	}
2396
+
2397
+	err = db.Preload("WarehousingInfo", "org_id = ? and status = 1", orgid).Find(&outinfo).Error
2398
+	return outinfo, err
2399
+}
2400
+
2272 2401
 func FindStartStockInventoryLosses(good_id int64, orgid int64, startime int64) (outinfo []*models.VmStockFlowTwenty, err error) {
2273 2402
 
2274 2403
 	db := XTReadDB().Model(&outinfo).Where("status = 1 and (consumable_type = 11)")
@@ -2673,12 +2802,25 @@ func GetStartLastFLow(goodid int64, orgid int64, startime int64, storehouse_id i
2673 2802
 	return flwo, err
2674 2803
 }
2675 2804
 
2805
+func GetStartLastFLowTwenty(goodid int64, orgid int64, startime int64) (models.VmStockFlowTwenty, error) {
2806
+
2807
+	flwo := models.VmStockFlowTwenty{}
2808
+	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime < ?", goodid, orgid, startime).Last(&flwo).Error
2809
+	return flwo, err
2810
+}
2811
+
2676 2812
 func GetEndLastFlow(goodid int64, orgid int64, endtime int64, storehouse_id int64) (models.VmStockFlowTwenty, error) {
2677 2813
 	flwo := models.VmStockFlowTwenty{}
2678 2814
 	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime <= ? and storehouse_id= ?", goodid, orgid, endtime, storehouse_id).Last(&flwo).Error
2679 2815
 	return flwo, err
2680 2816
 }
2681 2817
 
2818
+func GetEndLastFlowTwenty(goodid int64, orgid int64, endtime int64) (models.VmStockFlowTwenty, error) {
2819
+	flwo := models.VmStockFlowTwenty{}
2820
+	err := XTReadDB().Where("good_id = ? and user_org_id = ? and status = 1 and ctime <= ?", goodid, orgid, endtime).Last(&flwo).Error
2821
+	return flwo, err
2822
+}
2823
+
2682 2824
 func GetDrugNewPurchaseStockQuery(good_type int64, keyword string, page int64, limit int64, orgid int64, startime int64, endtime int64, ids []int64, infos []int64) (druginfo []*models.VmBaseDrugTwenty, total int64, err error) {
2683 2825
 
2684 2826
 	db := XTReadDB().Model(&druginfo).Where("status = 1")

+ 11 - 11
service/sign_service.go View File

@@ -481,7 +481,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
481 481
 	signFiles := make(map[string]interface{})
482 482
 
483 483
 	//创建合同返回
484
-	signFiles["docId"] = "157595002862567873"
484
+	signFiles["docId"] = "158027977441935904"
485 485
 
486 486
 	inputDataArr := make([]map[string]interface{}, 0)
487 487
 
@@ -503,7 +503,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
503 503
 		keywordSignControls["key"] = "2"
504 504
 		keywordSignControls["type"] = "date"
505 505
 		keywordSignControls["pageNum"] = 1
506
-		keywordSignControls["keyword"] = "医生签名"
506
+		keywordSignControls["keyword"] = "护士"
507 507
 		keywordSignControls["offsetX"] = "100F"
508 508
 		keywordSignControls["offsetY"] = "100F"
509 509
 		inputDataArrTwo = append(inputDataArrTwo, keywordSignControls)
@@ -528,7 +528,7 @@ func AddContractSignatory(contractId string, signers string, contract models.New
528 528
 	inputDataArrFour = append(inputDataArrFour, signersFiles)
529 529
 
530 530
 	maprequest := make(map[string]interface{})
531
-	maprequest["contractId"] = "157595002862567872"
531
+	maprequest["contractId"] = "158027977441935903"
532 532
 	maprequest["signers"] = inputDataArrFour
533 533
 
534 534
 	byterequest, _ := json.Marshal(maprequest)
@@ -605,21 +605,21 @@ func CreateBackStageSign(contractId string, signers string) string {
605 605
 
606 606
 	fmt.Println("signContorlwqowowo", signControl)
607 607
 	signFiles["signControl"] = signControl
608
-	signFiles["docId"] = "157595002862567873"
608
+	signFiles["docId"] = "158027977441935904"
609 609
 	inputDataArrThree := make([]map[string]interface{}, 0)
610 610
 	inputDataArrThree = append(inputDataArrThree, signFiles)
611 611
 
612 612
 	signer := make(map[string]interface{})
613 613
 
614 614
 	//添加合同签署人接口返回
615
-	signer["signerId"] = "157595142449004996"
615
+	signer["signerId"] = "158028978169315875"
616 616
 	signer["isUserWishes"] = true
617 617
 	signer["userWishesWay"] = 1
618
-	signer["codeNumber"] = "msg202308261800395745892"
619
-	signer["verifyCode"] = "452399"
618
+	signer["codeNumber"] = "msg202308311013481137884"
619
+	signer["verifyCode"] = "488164"
620 620
 	signer["signFiles"] = inputDataArrThree
621 621
 	maprequest := make(map[string]interface{})
622
-	maprequest["contractId"] = "157595002862567872"
622
+	maprequest["contractId"] = "158027977441935903"
623 623
 	maprequest["signer"] = signer
624 624
 
625 625
 	byterequest, _ := json.Marshal(maprequest)
@@ -665,7 +665,7 @@ func GetVerificationCode() string {
665 665
 	serviceCode := beego.AppConfig.String("serviceCode")
666 666
 
667 667
 	maprequest := make(map[string]interface{})
668
-	maprequest["contractId"] = "157595002862567872"
668
+	maprequest["contractId"] = "158027977441935903"
669 669
 	maprequest["userId"] = "PBRLMBFVIRR3BV8JGGOX9C7N"
670 670
 
671 671
 	byterequest, _ := json.Marshal(maprequest)
@@ -1165,7 +1165,7 @@ func GetContractId() string {
1165 1165
 	serviceCode := beego.AppConfig.String("serviceCode")
1166 1166
 
1167 1167
 	maprequest := make(map[string]interface{})
1168
-	maprequest["contractId"] = "157475501840007476"
1168
+	maprequest["contractId"] = "158027977441935903"
1169 1169
 	maprequest["responseContractFile"] = true
1170 1170
 
1171 1171
 	fmt.Println("request23222222222222222", maprequest)
@@ -1261,7 +1261,7 @@ func GetEnterPriseDetail() (string, string) {
1261 1261
 	serviceCode := beego.AppConfig.String("serviceCode")
1262 1262
 
1263 1263
 	maprequest := make(map[string]interface{})
1264
-	maprequest["contractId"] = "157594023610024377"
1264
+	maprequest["contractId"] = "158027977441935903"
1265 1265
 
1266 1266
 	byterequest, _ := json.Marshal(maprequest)
1267 1267
 	reader := bytes.NewReader(byterequest)