test_user 1 month ago
parent
commit
bd4475340b

+ 21 - 2
main.go View File

5
 	"Data_Upload_Api/service"
5
 	"Data_Upload_Api/service"
6
 	"Data_Upload_Api/service/city"
6
 	"Data_Upload_Api/service/city"
7
 	"github.com/astaxie/beego"
7
 	"github.com/astaxie/beego"
8
+
9
+
8
 )
10
 )
9
 
11
 
10
 func init() {
12
 func init() {
12
 }
14
 }
13
 
15
 
14
 func main() {
16
 func main() {
15
-	city.BeginAutoJob()
16
-	city.SyncToLhblYxxxzx()
17
+	//city.BeginAutoJob()
18
+	//var ids []int64
19
+	//ids = append(ids,8420)
20
+	//ids = append(ids,28202)
21
+	//ids = append(ids,28310)
22
+	//city.SyncToSzblgpYxxxzx()
23
+	//city.SyncToSzbltmp()
24
+	//city.SyncToSzblgpYxxxzx()
25
+	//city.SyncToSzzxtmp()
26
+	//city.SyncToSzblbrYxxxzxtmpp()
27
+	//city.SyncToSzblpg()
28
+	//city.SyncToSzblgpYxxxzx()
29
+	// 创建一个新的调度器
30
+
31
+
32
+
33
+	city.SyncToSzblpg()
34
+
35
+
17
 	beego.Run()
36
 	beego.Run()
18
 }
37
 }

+ 4 - 0
models/src_data.go View File

75
 	Status      int64  `gorm:"column:status" json:"status"`
75
 	Status      int64  `gorm:"column:status" json:"status"`
76
 	Ctime       int64  `gorm:"column:ctime" json:"ctime"`
76
 	Ctime       int64  `gorm:"column:ctime" json:"ctime"`
77
 	Mtime       int64  `gorm:"column:mtime" json:"mtime"`
77
 	Mtime       int64  `gorm:"column:mtime" json:"mtime"`
78
+	DoctorNumber string `gorm:"column:doctor_number" json:"doctor_number"`
79
+	DoctorCode   string `gorm:"column:doctor_code" json:"doctor_code"`
78
 }
80
 }
79
 
81
 
80
 func (UserAdminRole) TableName() string {
82
 func (UserAdminRole) TableName() string {
1861
 
1863
 
1862
 	RequestLog       string `gorm:"column:request_log" json:"request_log" form:"request_log"`
1864
 	RequestLog       string `gorm:"column:request_log" json:"request_log" form:"request_log"`
1863
 	RefundRequestLog string `gorm:"column:refund_request_log" json:"refund_request_log" form:"refund_request_log"`
1865
 	RefundRequestLog string `gorm:"column:refund_request_log" json:"refund_request_log" form:"refund_request_log"`
1866
+	HisPatient HisPatient `gorm:"ForeignKey:MdtrtId;AssociationForeignKey:Number" json:"his_patient"`
1867
+
1864
 }
1868
 }
1865
 
1869
 
1866
 func (HisOrder) TableName() string {
1870
 func (HisOrder) TableName() string {

+ 23 - 0
models/sz/target_data.go View File

283
 	return "t_hd_wm_disinfect"
283
 	return "t_hd_wm_disinfect"
284
 }
284
 }
285
 
285
 
286
+type TB_HIS_MZ_BL_Detail struct {
287
+	YLJGDM string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
288
+	BLLSH  string    `gorm:"column:BLLSH" json:"BLLSH" form:"BLLSH"`
289
+	JZLSH  string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
290
+	KH     string    `gorm:"column:KH" json:"KH" form:"KH"`
291
+	KLX    string    `gorm:"column:KLX" json:"KLX" form:"KLX"`
292
+	HZXM   string    `gorm:"column:HZXM" json:"HZXM" form:"HZXM"`
293
+	JZLX   string    `gorm:"column:JZLX" json:"JZLX" form:"JZLX"`
294
+	JZRQSJ string    `gorm:"column:JZRQSJ" json:"JZRQSJ" form:"JZRQSJ"`
295
+	MJZH   string    `gorm:"column:MJZH" json:"MJZH" form:"MJZH"`
296
+	CZBZ   string    `gorm:"column:CZBZ" json:"CZBZ" form:"CZBZ"`
297
+	YSGH   string    `gorm:"column:YSGH" json:"YSGH" form:"YSGH"`
298
+	YSXM   string    `gorm:"column:YSXM" json:"YSXM" form:"YSXM"`
299
+	JLRQSJ string    `gorm:"column:JLRQSJ" json:"JLRQSJ" form:"JLRQSJ"`
300
+	SJSCSJ time.Time `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
301
+	XGBZ   int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
302
+}
303
+
304
+func (TB_HIS_MZ_BL_Detail) TableName() string {
305
+	return "TB_EMR_MJGBL"
306
+}
307
+
308
+
286
 type TempHdPatient struct {
309
 type TempHdPatient struct {
287
 	HospitalId        string    `gorm:"column:hospital_id" json:"hospital_id" form:"hospital_id"`
310
 	HospitalId        string    `gorm:"column:hospital_id" json:"hospital_id" form:"hospital_id"`
288
 	PatientNk         int64     `gorm:"column:patient_nk" json:"patient_nk" form:"patient_nk"`
311
 	PatientNk         int64     `gorm:"column:patient_nk" json:"patient_nk" form:"patient_nk"`

File diff suppressed because it is too large
+ 3116 - 2076
service/city/auto_create_week_schedules_service.go


+ 56 - 1
service/city_data_uoload_service.go View File

141
 }
141
 }
142
 
142
 
143
 func FindOrgHisDoctorAdviceInfoByPid(org_id int64, pid int64) (patient []*models.HisDoctorAdviceInfo, err error) {
143
 func FindOrgHisDoctorAdviceInfoByPid(org_id int64, pid int64) (patient []*models.HisDoctorAdviceInfo, err error) {
144
-	db := readDb.Model(&models.HisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? and prescription_id = ?", org_id)
144
+	db := readDb.Model(&models.HisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? and prescription_id = ?", org_id,pid)
145
 	err = db.Find(&patient).Error
145
 	err = db.Find(&patient).Error
146
 	return
146
 	return
147
 }
147
 }
1200
 	return
1200
 	return
1201
 }
1201
 }
1202
 
1202
 
1203
+
1204
+func CreateSickbed2(wms []*sz.TempHdSickbed, rdb *gorm.DB) (err error) {
1205
+	if len(wms) > 0 {
1206
+		utx := rdb
1207
+		if len(wms) > 0 {
1208
+			for _, wm := range wms {
1209
+				thisSQL := "INSERT INTO t_hd_sickbed (sickbed_no,hospital_id,division_id,sickbed_code,sickbed_type,xgbz,create_time,update_time,sjscsj,ylyl1) VALUES "
1210
+				insertParams := make([]string, 0)
1211
+				insertData := make([]interface{}, 0)
1212
+				insertParams = append(insertParams, "(?,?,?,?,?,?,?,?,?)")
1213
+				insertData = append(insertData, wm.SickbedNo)
1214
+				insertData = append(insertData, wm.HospitalId)
1215
+				insertData = append(insertData, wm.DivisionId)
1216
+				insertData = append(insertData, wm.SickbedCode)
1217
+				insertData = append(insertData, wm.SickbedType)
1218
+				insertData = append(insertData, wm.Xgbz)
1219
+				insertData = append(insertData, wm.CreateTime)
1220
+				insertData = append(insertData, wm.UpdateTime)
1221
+				insertData = append(insertData, wm.Sjscsj)
1222
+				insertData = append(insertData, wm.Ylyl1)
1223
+
1224
+				thisSQL += strings.Join(insertParams, ", ")
1225
+				utx.Exec(thisSQL, insertData...)
1226
+			}
1227
+		}
1228
+	}
1229
+	return
1230
+}
1231
+
1203
 func CreateDiagnosis(wms []*sz.TempHdDiagnosis, rdb *gorm.DB) (err error) {
1232
 func CreateDiagnosis(wms []*sz.TempHdDiagnosis, rdb *gorm.DB) (err error) {
1204
 	if len(wms) > 0 {
1233
 	if len(wms) > 0 {
1205
 		utx := rdb
1234
 		utx := rdb
1906
 	err = rdb.Create(&ps).Error
1935
 	err = rdb.Create(&ps).Error
1907
 	return err
1936
 	return err
1908
 }
1937
 }
1938
+
1939
+func FindOrgPatientDataTwo(org_id int64,ids []int64) (patient []*models.Patients, err error) {
1940
+	db := readDb.Model(&models.Patients{}).Where("status = 1 AND user_org_id = ? and id in (?)", org_id,ids)
1941
+	err = db.Find(&patient).Error
1942
+	return
1943
+}
1944
+
1945
+func FindNewOrgHisOrder(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisOrder, err error) {
1946
+	db := readDb.Model(&models.HisOrder{}).Preload("HisPatient", "status = 1").Where("status = 1 AND user_org_id = ? AND med_type = 14", org_id)
1947
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
1948
+	err = db.Find(&patient).Error
1949
+	return
1950
+}
1951
+
1952
+func FindUserRoleData(org_id int64, admin_user_id int64) (role models.UserAdminRole, err error) {
1953
+	db := readUserDb.Model(&models.UserAdminRole{}).Where("status = 1 AND org_id = ? and admin_user_id = ?  ", org_id, admin_user_id)
1954
+	//db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
1955
+	err = db.Find(&role).Error
1956
+	return
1957
+}
1958
+
1959
+
1960
+func BatchCreateTB_HIS_MZ_BL_Detail(ps *sz.TB_HIS_MZ_BL_Detail, rdb *gorm.DB) (err error) {
1961
+	err = rdb.Create(&ps).Error
1962
+	return err
1963
+}