test_user hace 1 mes
padre
commit
bd4475340b

+ 21 - 2
main.go Ver fichero

@@ -5,6 +5,8 @@ import (
5 5
 	"Data_Upload_Api/service"
6 6
 	"Data_Upload_Api/service/city"
7 7
 	"github.com/astaxie/beego"
8
+
9
+
8 10
 )
9 11
 
10 12
 func init() {
@@ -12,7 +14,24 @@ func init() {
12 14
 }
13 15
 
14 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 36
 	beego.Run()
18 37
 }

+ 4 - 0
models/src_data.go Ver fichero

@@ -75,6 +75,8 @@ type UserAdminRole struct {
75 75
 	Status      int64  `gorm:"column:status" json:"status"`
76 76
 	Ctime       int64  `gorm:"column:ctime" json:"ctime"`
77 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 82
 func (UserAdminRole) TableName() string {
@@ -1861,6 +1863,8 @@ type HisOrder struct {
1861 1863
 
1862 1864
 	RequestLog       string `gorm:"column:request_log" json:"request_log" form:"request_log"`
1863 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 1870
 func (HisOrder) TableName() string {

+ 23 - 0
models/sz/target_data.go Ver fichero

@@ -283,6 +283,29 @@ func (TempWdDmDisinfect) TableName() string {
283 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 309
 type TempHdPatient struct {
287 310
 	HospitalId        string    `gorm:"column:hospital_id" json:"hospital_id" form:"hospital_id"`
288 311
 	PatientNk         int64     `gorm:"column:patient_nk" json:"patient_nk" form:"patient_nk"`

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 3116 - 2076
service/city/auto_create_week_schedules_service.go


+ 56 - 1
service/city_data_uoload_service.go Ver fichero

@@ -141,7 +141,7 @@ func FindOrgHisDoctorAdviceInfo(org_id int64, lastUploadTime int64, nowTime int6
141 141
 }
142 142
 
143 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 145
 	err = db.Find(&patient).Error
146 146
 	return
147 147
 }
@@ -1200,6 +1200,35 @@ func CreateSickbed(wms []*sz.TempHdSickbed, rdb *gorm.DB) (err error) {
1200 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 1232
 func CreateDiagnosis(wms []*sz.TempHdDiagnosis, rdb *gorm.DB) (err error) {
1204 1233
 	if len(wms) > 0 {
1205 1234
 		utx := rdb
@@ -1906,3 +1935,29 @@ func BatchCreateTB_STAT_YWL_Report(ps *sz.TB_STAT_YWL_Report, rdb *gorm.DB) (err
1906 1935
 	err = rdb.Create(&ps).Error
1907 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
+}