瀏覽代碼

历史排班

28169 1 年之前
父節點
當前提交
c7c51711f1

+ 1 - 1
conf/app.conf 查看文件

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9531
3
-runmode = prod
3
+runmode = dev
4 4
 #dev/prod
5 5
 
6 6
 #

+ 1 - 1
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -86,7 +86,7 @@ func (this *DialysisAPIController) Scheduals() {
86 86
 	defer redis.Close()
87 87
 
88 88
 	key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
89
-	redis.Set(key, "", time.Second)
89
+
90 90
 	scheduals_json_str, _ := redis.Get(key).Result()
91 91
 
92 92
 	patients, _ := service.GetAllPatientListSix(orgID)

+ 12 - 0
controllers/patient_api_controller.go 查看文件

@@ -4919,6 +4919,18 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
4919 4919
 		return
4920 4920
 	}
4921 4921
 	patient.PatientSource = patient_source
4922
+
4923
+	if patientBody["patient_start_time"] != nil && reflect.TypeOf(patientBody["patient_start_time"]).String() == "string" {
4924
+		patient_start_time := patientBody["patient_start_time"].(string)
4925
+		var startTime int64
4926
+		if len(patient_start_time) > 0 {
4927
+			theTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", patient_start_time+" 00:00:00", loc)
4928
+
4929
+			startTime = theTime.Unix()
4930
+		}
4931
+		patient.PatientStartTime = startTime
4932
+	}
4933
+
4922 4934
 	return
4923 4935
 }
4924 4936
 

+ 27 - 0
controllers/self_drug_api_congtroller.go 查看文件

@@ -77,6 +77,7 @@ func SelfDrugRouters() {
77 77
 	beego.Router("/api/drug/deletedruginventory", &SelfDrugApiController{}, "Get:DeleteDrugInventory")
78 78
 	beego.Router("/api/drug/getdruginventoryprintlist", &SelfDrugApiController{}, "Get:GetDrugInventoryPrintList")
79 79
 	beego.Router("/api/drug/getinventorydetaillist", &SelfDrugApiController{}, "Get:GetDrugInventoryDetailList")
80
+	beego.Router("/api/drug/getinventorydetailprintlist", &SelfDrugApiController{}, "Get:GetInventoryDetailPrintList")
80 81
 	beego.Router("/api/drug/savedrugproofinventory", &SelfDrugApiController{}, "Get:SaveDrugProofInventory")
81 82
 	beego.Router("/api/drug/getdrugwarehouseinfototal", &StockManagerApiController{}, "Get:GetDrugWarehouseInfoTotal")
82 83
 
@@ -4008,3 +4009,29 @@ func (this *SelfDrugApiController) GetDrugInventoryWarehouseInfoList() {
4008 4009
 		"dealerList":       dealerList,
4009 4010
 	})
4010 4011
 }
4012
+
4013
+func (this *SelfDrugApiController) GetInventoryDetailPrintList() {
4014
+	keyword := this.GetString("keyword")
4015
+	limit, _ := this.GetInt64("limit")
4016
+	page, _ := this.GetInt64("page")
4017
+	storehouse_id, _ := this.GetInt64("storehouse_id")
4018
+	ids := this.GetString("ids")
4019
+	idSplit := strings.Split(ids, ",")
4020
+	orgId := this.GetAdminUserInfo().CurrentOrgId
4021
+	list, total, err := service.GetDrugInventoryDetailMapList(keyword, page, limit, orgId, storehouse_id, idSplit)
4022
+	inventoryList, _, _ := service.GetDrugInventoryDetailListTwo(keyword, page, limit, orgId, storehouse_id)
4023
+	houseList, _ := service.GetAllStoreHouseList(orgId)
4024
+	doctorList, _ := service.GetAllDoctorThree(orgId)
4025
+	if err != nil {
4026
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更新设备失败")
4027
+		return
4028
+	}
4029
+
4030
+	this.ServeSuccessJSON(map[string]interface{}{
4031
+		"total":         total,
4032
+		"list":          list,
4033
+		"doctorList":    doctorList,
4034
+		"houseList":     houseList,
4035
+		"inventoryList": inventoryList,
4036
+	})
4037
+}

+ 3 - 1
controllers/stock_in_api_controller.go 查看文件

@@ -7792,10 +7792,12 @@ func (this *StockManagerApiController) GetPrintList() {
7792 7792
 	limit, _ := this.GetInt64("limit")
7793 7793
 	page, _ := this.GetInt64("page")
7794 7794
 	good_name := this.GetString("good_name")
7795
+	ids := this.GetString("ids")
7796
+	idSplit := strings.Split(ids, ",")
7795 7797
 	fmt.Println(storehouse_id, good_name)
7796 7798
 	orgId := this.GetAdminUserInfo().CurrentOrgId
7797 7799
 	houseList, _ := service.GetAllStoreHouseList(orgId)
7798
-	list, total, _ := service.GetInventoryDetailList(good_name, limit, page, orgId, storehouse_id)
7800
+	list, total, _ := service.GetInventoryDetailPrintMapList(good_name, limit, page, orgId, storehouse_id, idSplit)
7799 7801
 	this.ServeSuccessJSON(map[string]interface{}{
7800 7802
 		"list":      list,
7801 7803
 		"total":     total,

+ 2 - 0
models/patient_models.go 查看文件

@@ -223,6 +223,7 @@ type Patients struct {
223 223
 	Doctor                   int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
224 224
 	RecordNumber             string  `gorm:"column:record_number" json:"record_number" form:"record_number"`
225 225
 	PatientSource            int64   `gorm:"column:patient_source" json:"patient_source" form:"patient_source"`
226
+	PatientStartTime         int64   `gorm:"column:patient_start_time" json:"patient_start_time" form:"patient_start_time"`
226 227
 }
227 228
 
228 229
 func (Patients) TableName() string {
@@ -816,6 +817,7 @@ type XtPatientsNew struct {
816 817
 	ScheduleRemark               string  `gorm:"column:schedule_remark" json:"schedule_remark" form:"schedule_remark"`
817 818
 	RecordNumber                 string  `gorm:"column:record_number" json:"record_number" form:"record_number"`
818 819
 	PatientSource                int64   `gorm:"column:patient_source" json:"patient_source" form:"patient_source"`
820
+	PatientStartTime             int64   `gorm:"column:patient_start_time" json:"patient_start_time" form:"patient_start_time"`
819 821
 }
820 822
 
821 823
 func (XtPatientsNew) TableName() string {

+ 2 - 2
service/patient_service.go 查看文件

@@ -874,7 +874,7 @@ func UpdatePatientLapseto(patientid int64, lapseto models.PatientLapseto) error
874 874
 func UpdatepatientTwo(patientsNew *models.XtPatientsNew, id int64) error {
875 875
 
876 876
 	err := XTWriteDB().Model(&patientsNew).Where("blood_id = ?", id).Update(map[string]interface{}{"user_org_id": patientsNew.UserOrgId, "user_id": patientsNew.UserId, "avatar": patientsNew.Avatar, "patient_type": patientsNew.Avatar, "dialysis_no": patientsNew.DialysisNo, "admission_number": patientsNew.AdmissionNumber, "source": patientsNew.Source, "lapseto": patientsNew.Lapseto, "partition_id": patientsNew.PartitionId, "bed_id": patientsNew.BedId, "name": patientsNew.Name, "alias": patientsNew.Alias, "gender": patientsNew.Gender, "marital_status": patientsNew.MaritalStatus, "id_card_no": patientsNew.IdCardNo, "birthday": patientsNew.Birthday, "reimbursement_way_id": patientsNew.ReimbursementWayId, "health_care_type": patientsNew.HealthCareType, "health_care_no": patientsNew.HealthCareType, "health_care_due_date": patientsNew.HealthCareType, "height": patientsNew.Height, "blood_type": patientsNew.BloodType, "rh": patientsNew.Rh, "health_care_due_alert_date": patientsNew.HealthCareDueAlertDate, "education_level": patientsNew.EducationLevel, "profession": patientsNew.Profession, "phone": patientsNew.Phone, "home_telephone": patientsNew.HomeTelephone, "relative_phone": patientsNew.RelativePhone, "relative_relations": patientsNew.RelativeRelations, "home_address": patientsNew.HomeAddress, "work_unit": patientsNew.WorkUnit, "unit_address": patientsNew.UnitAddress, "children": patientsNew.Children, "receiving_date": patientsNew.ReceivingDate, "is_hospital_first_dialysis": patientsNew.IsHospitalFirstDialysis, "first_dialysis_date": patientsNew.FirstDialysisDate, "first_dialysis_hospital": patientsNew.FirstDialysisHospital, "predialysis_condition": patientsNew.PredialysisCondition, "pre_hospital_dialysis_frequency": patientsNew.PreHospitalDialysisFrequency, "pre_hospital_dialysis_times": patientsNew.PreHospitalDialysisFrequency, "hospital_first_dialysis_date": patientsNew.HospitalFirstDialysisDate, "induction_period": patientsNew.InductionPeriod, "initial_dialysis": patientsNew.InitialDialysis, "total_dialysis": patientsNew.TotalDialysis, "attending_doctor_id": patientsNew.AttendingDoctorId, "head_nurse_id": patientsNew.HeadNurseId, "evaluate": patientsNew.Evaluate, "diagnose": patientsNew.Diagnose, "remark": patientsNew.Remark, "registrars_id": patientsNew.RegistrarsId, "registrars": patientsNew.Registrars, "qr_code": patientsNew.QrCode, "binding_state": patientsNew.BindingState, "patient_complains": patientsNew.PatientComplains, "present_history": patientsNew.PresentHistory, "past_history": patientsNew.PastHistory, "temperature": patientsNew.Temperature,
877
-		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber}).Error
877
+		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber, "patient_start_time": patientsNew.PatientStartTime}).Error
878 878
 	return err
879 879
 }
880 880
 
@@ -2670,7 +2670,7 @@ func GetAllPatientListByListOne(orgID int64) (patients []*models.VMMonitorPatien
2670 2670
 	defer redis.Close()
2671 2671
 	key := strconv.FormatInt(orgID, 10) + ":" + ":patient_list_all"
2672 2672
 	patient_info_str, _ := redis.Get(key).Result()
2673
-
2673
+	redis.Set(key, "", time.Second)
2674 2674
 	if len(patient_info_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
2675 2675
 		err = readDb.Model(&models.VMMonitorPatients{}).Where("user_org_id=? and status=1", orgID).Find(&patients).Error
2676 2676
 		if err != nil {

+ 24 - 1
service/self_drug_service.go 查看文件

@@ -1119,6 +1119,29 @@ func GetDrugInventoryDetailList(keyword string, page int64, limit int64, orgid i
1119 1119
 	return list, total, err
1120 1120
 }
1121 1121
 
1122
+func GetDrugInventoryDetailMapList(keyword string, page int64, limit int64, orgid int64, storehouse_id int64, ids []string) (list []*models.VmDrugInventory, total int64, err error) {
1123
+	likeKey := "%" + keyword + "%"
1124
+	offset := (page - 1) * limit
1125
+	db := XTReadDB().Table("xt_drug_inventory as x").Where("x.status = 1")
1126
+	table := XTReadDB().Table("xt_base_drug as t").Where("t.status = 1")
1127
+	tab := UserReadDB().Table("sgj_user_admin_role as r").Where("r.status = 1")
1128
+	fmt.Println(table, tab)
1129
+	if len(keyword) > 0 {
1130
+		db = db.Where("x.warehousing_order = ? or r.user_name like ? or t.drug_name like ?", keyword, likeKey, likeKey)
1131
+	}
1132
+	if orgid > 0 {
1133
+		db = db.Where("x.user_org_id = ?", orgid)
1134
+	}
1135
+	if storehouse_id > 0 {
1136
+		db = db.Where("x.storehouse_id = ?", storehouse_id)
1137
+	}
1138
+	if len(ids) > 0 {
1139
+		db = db.Where("x.id in(?)", ids)
1140
+	}
1141
+	err = db.Select("x.id,x.drug_name,x.specification_name,x.warehousing_unit,x.count,x.last_price,x.retail_price,x.manufacturer,x.dealer,x.remark,x.drug_id,x.warehousing_order,x.number,x.batch_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.drug_origin_place,x.expiry_date,x.product_date,x.min_count,x.storehouse_id,x.warehouse_info_id,t.dose,t.dose_unit,t.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.last_stock_max_number,x.last_stock_min_number,x.inventory_type,t.min_number,t.retail_price").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_base_drug as t on t.id =x.drug_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
1142
+	return list, total, err
1143
+}
1144
+
1122 1145
 func GetDrugInventoryDetailListTwo(keyword string, page int64, limit int64, orgid int64, storehouse_id int64) (list []*models.XtDrugInventory, total int64, err error) {
1123 1146
 
1124 1147
 	db := XTReadDB().Model(&list).Where("status = 1")
@@ -2715,6 +2738,6 @@ func ModifyDrugFlowById(id int64, over_count int64) error {
2715 2738
 
2716 2739
 func GetDrugInventoryWarehouseInfoList(org_id int64, storehouse_id int64) (info []*models.XtDrugWarehouseInfo, err error) {
2717 2740
 
2718
-	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ?", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2741
+	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id = ? and is_check = 1 and org_id = ? and (stock_max_number >0 or stock_min_number >0)", storehouse_id, org_id).Preload("XtBaseDrug", "status= 1").Order("drug_id").Find(&info).Error
2719 2742
 	return info, err
2720 2743
 }

+ 25 - 1
service/stock_service.go 查看文件

@@ -6113,6 +6113,30 @@ func GetInventoryDetailList(keyword string, limit int64, page int64, orgid int64
6113 6113
 	return list, total, err
6114 6114
 }
6115 6115
 
6116
+func GetInventoryDetailPrintMapList(keyword string, limit int64, page int64, orgid int64, storehouse_id int64, ids []string) (list []*models.VmStockInventory, total int64, err error) {
6117
+
6118
+	likeKey := "%" + keyword + "%"
6119
+	offset := (page - 1) * limit
6120
+	db := XTReadDB().Table("xt_stock_inventory as x").Where("x.status = 1 and x.type = 10")
6121
+	table := XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
6122
+	tab := UserReadDB().Table("sgj_user_admin_role as r").Where("r.status = 1")
6123
+	fmt.Println(table, tab)
6124
+	if len(keyword) > 0 {
6125
+		db = db.Where("x.good_name like ?", likeKey)
6126
+	}
6127
+	if orgid > 0 {
6128
+		db = db.Where("x.user_org_id = ?", orgid)
6129
+	}
6130
+	if storehouse_id > 0 {
6131
+		db = db.Where("x.storehouse_id = ?", storehouse_id)
6132
+	}
6133
+	if len(ids) > 0 {
6134
+		db = db.Where("x.id in(?)", ids)
6135
+	}
6136
+	err = db.Select("x.id,x.good_name,x.specification_name,x.warehousing_unit,x.count,x.buy_price,x.packing_price,x.new_price,x.manufacturer,x.dealer,x.remark,x.good_id,x.warehousing_order,x.license_number,x.start_time,x.creater,x.checker,x.checker_status,x.checker_time,x.total,x.number,x.expire_date,x.product_date,t.packing_unit,x.last_stock_count,x.type,x.inventory_type,x.stock_count,x.storehouse_id").Joins("left join sgj_users.sgj_user_admin_role as r on r.id = x.creater").Joins("left join xt_good_information as t on t.id =x.good_id").Count(&total).Offset(offset).Limit(limit).Scan(&list).Error
6137
+	return list, total, err
6138
+}
6139
+
6116 6140
 func GetInventoryPrintList(ids []string) (list []*models.XtStockInventory, err error) {
6117 6141
 
6118 6142
 	err = XTReadDB().Where("id in(?) and status = 1", ids).Find(&list).Error
@@ -8212,7 +8236,7 @@ func ReduceGoodSumOutCount(storehouse_id int64, good_id int64, user_org_id int64
8212 8236
 
8213 8237
 func GetInvetoryWarehouseInfoList(orgid int64, storehouse_id int64) (info []*models.WarehousingInfo, err error) {
8214 8238
 
8215
-	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id=? and is_check= 1 and org_id = ?", storehouse_id, orgid).Preload("GoodInfo", "status = 1").Order("good_id").Find(&info).Error
8239
+	err = XTReadDB().Model(&info).Where("status = 1 and storehouse_id=? and is_check= 1 and org_id = ? and stock_count >0", storehouse_id, orgid).Preload("GoodInfo", "status = 1").Order("good_id").Find(&info).Error
8216 8240
 	return info, err
8217 8241
 }
8218 8242