浏览代码

提交代码

陈少旭 4 个月前
父节点
当前提交
1c89a7d99f
共有 1 个文件被更改,包括 22 次插入20 次删除
  1. 22 20
      controllers/his_api_controller.go

+ 22 - 20
controllers/his_api_controller.go 查看文件

26
 }
26
 }
27
 
27
 
28
 func HisManagerApiRegistRouters() {
28
 func HisManagerApiRegistRouters() {
29
+	beego.Router("/test/net", &HisApiController{}, "get:TestNet")
29
 
30
 
30
 	beego.Router("/api/hispatient/list", &HisApiController{}, "get:GetHisPatientList")
31
 	beego.Router("/api/hispatient/list", &HisApiController{}, "get:GetHisPatientList")
31
 	beego.Router("/api/hispatient/get", &HisApiController{}, "get:GetHisPatientInfo")
32
 	beego.Router("/api/hispatient/get", &HisApiController{}, "get:GetHisPatientInfo")
122
 
123
 
123
 }
124
 }
124
 
125
 
126
+func (c *HisApiController) TestNet() {
127
+	c.ServeSuccessJSON(map[string]interface{}{
128
+		"msg": "成功",
129
+	})
130
+}
131
+
125
 func (c *HisApiController) CheckHisPatient() {
132
 func (c *HisApiController) CheckHisPatient() {
126
 	record_date := c.GetString("record_date")
133
 	record_date := c.GetString("record_date")
127
 	patient_id, _ := c.GetInt64("patient_id")
134
 	patient_id, _ := c.GetInt64("patient_id")
4264
 								keySeven := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
4271
 								keySeven := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
4265
 								redis.Set(keySeven, "", time.Second)
4272
 								redis.Set(keySeven, "", time.Second)
4266
 								var randNum int
4273
 								var randNum int
4267
-								randNum = rand.Intn(10000) + 1000
4268
-								timestamp := time.Now().Unix()
4269
-								tempTime := time.Unix(timestamp, 0)
4270
-								timeFormat := tempTime.Format("20060102150405")
4271
-								s.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
4274
+								randNum = rand.Intn(1000) + 1000
4275
+								//timestamp := time.Now().Unix()
4276
+								//tempTime := time.Unix(timestamp, 0)
4277
+								//timeFormat := tempTime.Format("20060102150405")
4278
+								s.FeedetlSn = strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
4272
 
4279
 
4273
 								//赤峰
4280
 								//赤峰
4274
 								if adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10489 {
4281
 								if adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10489 {
5432
 
5439
 
5433
 								service.CreateNewHisProjectTwo(&p, tx)
5440
 								service.CreateNewHisProjectTwo(&p, tx)
5434
 								var randNum int
5441
 								var randNum int
5435
-								randNum = rand.Intn(10000) + 1000
5436
-								timestamp := time.Now().Unix()
5437
-								tempTime := time.Unix(timestamp, 0)
5438
-								timeFormat := tempTime.Format("20060102150405")
5439
-								p.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "2" + "-" + strconv.FormatInt(p.ID, 10)
5442
+								randNum = rand.Intn(1000) + 1000
5443
+								p.FeedetlSn = strconv.FormatInt(int64(randNum), 10) + "-" + "2" + "-" + strconv.FormatInt(p.ID, 10)
5440
 
5444
 
5441
 								goodBase, _ := service.GetBaseGoodById(p.ProjectId, p.UserOrgId)
5445
 								goodBase, _ := service.GetBaseGoodById(p.ProjectId, p.UserOrgId)
5442
 
5446
 
5789
 								keySeven := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
5793
 								keySeven := "scheduals_" + record_date + "_" + strconv.FormatInt(adminInfo.CurrentOrgId, 10)
5790
 								redis.Set(keySeven, "", time.Second)
5794
 								redis.Set(keySeven, "", time.Second)
5791
 								var randNum int
5795
 								var randNum int
5792
-								randNum = rand.Intn(10000) + 1000
5793
-								timestamp := time.Now().Unix()
5794
-								tempTime := time.Unix(timestamp, 0)
5795
-								timeFormat := tempTime.Format("20060102150405")
5796
-								s.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
5796
+								randNum = rand.Intn(1000) + 1000
5797
+								//timestamp := time.Now().Unix()
5798
+								//tempTime := time.Unix(timestamp, 0)
5799
+								//timeFormat := tempTime.Format("20060102150405")
5800
+								s.FeedetlSn = strconv.FormatInt(int64(randNum), 10) + "-" + "1" + "-" + strconv.FormatInt(s.ID, 10)
5797
 								service.CreateHisDoctorAdvice(&s)
5801
 								service.CreateHisDoctorAdvice(&s)
5798
 								keySix := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(theTime.Unix(), 10) + ":his_advices_list_all"
5802
 								keySix := strconv.FormatInt(adminInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(theTime.Unix(), 10) + ":his_advices_list_all"
5799
 								redis.Set(keySix, "", time.Second)
5803
 								redis.Set(keySix, "", time.Second)
5897
 
5901
 
5898
 								projectList = append(projectList, p)
5902
 								projectList = append(projectList, p)
5899
 								var randNum int
5903
 								var randNum int
5900
-								randNum = rand.Intn(10000) + 1000
5901
-								timestamp := time.Now().Unix()
5902
-								tempTime := time.Unix(timestamp, 0)
5903
-								timeFormat := tempTime.Format("20060102150405")
5904
-								p.FeedetlSn = timeFormat + strconv.FormatInt(int64(randNum), 10) + "-" + "2" + "-" + strconv.FormatInt(p.ID, 10)
5904
+								randNum = rand.Intn(1000) + 1000
5905
+
5906
+								p.FeedetlSn = strconv.FormatInt(int64(randNum), 10) + "-" + "2" + "-" + strconv.FormatInt(p.ID, 10)
5905
 
5907
 
5906
 								if p.Type == 2 { //因为项目和耗材的基础库存在id相同的情况,所以需要根据该字段来判断,type为2的话为从项目开出来的
5908
 								if p.Type == 2 { //因为项目和耗材的基础库存在id相同的情况,所以需要根据该字段来判断,type为2的话为从项目开出来的
5907
 									//新增或者编辑项目,修改对应的标签数据
5909
 									//新增或者编辑项目,修改对应的标签数据