XMLWAN hace 3 años
padre
commit
6ab7cb7a44

+ 61 - 61
controllers/sg/his_api_controller.go Ver fichero

@@ -45,7 +45,7 @@ func HisManagerApiRegistRouters() {
45 45
 	beego.Router("/api/record/put", &HisApiController{}, "get:PutRecord")
46 46
 	beego.Router("/api/patient/info", &HisApiController{}, "get:GetHisPatientInfo")
47 47
 	beego.Router("/api/org/info", &HisApiController{}, "get:GetOrgInfo")
48
-	beego.Router("/api/testcard", &HisApiController{}, "get:TestGetBasBaseInfo")
48
+	//beego.Router("/api/testcard", &HisApiController{}, "get:TestGetBasBaseInfo")
49 49
 
50 50
 	//beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
51 51
 
@@ -91,56 +91,56 @@ func HisManagerApiRegistRouters() {
91 91
 //
92 92
 //}
93 93
 
94
-func (c *HisApiController) TestGetBasBaseInfo() {
95
-
96
-	//result := C.Init(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
97
-	//fmt.Println(result)
98
-	//cs1 := C.CString("")
99
-	//cs2 := C.CString("")
100
-	//C.ReadCardBas(cs1, IntPtr(1024), cs2, IntPtr(1024))
101
-	//fmt.Println(cs1)
102
-	//fmt.Println(cs2)
103
-	//C.free(unsafe.Pointer(cs1))
104
-	//C.free(unsafe.Pointer(cs2))
105
-
106
-	//
107
-
108
-	DllDef := syscall.MustLoadDLL("SSCard.dll")
109
-	Iinit := DllDef.MustFindProc("Init")
110
-	readCard := DllDef.MustFindProc("ReadCardBas")
111
-	ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
112
-	if ret != 0 {
113
-		fmt.Println("SSCard的报错原因:", err)
114
-		fmt.Println("SSCard的运算结果为:", ret)
115
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
116
-		return
117
-	}
118
-
119
-	result := int(ret)
120
-	fmt.Println("SSCard的运算结果为1:", result)
121
-
122
-	//path := ""
123
-	//bytePath := []byte(  "\x00")
124
-	//bytePath2 := []byte(  "\x00")
125
-	//ssss
126
-
127
-	str := make([]byte, 256)
128
-	str1 := make([]byte, 256)
129
-	s2 := []byte(string(str))
130
-	s3 := []byte(string(str1))
131
-	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&s2[0])), IntPtr(256), (uintptr)(unsafe.Pointer(&s3[0])), IntPtr(256))
132
-	fmt.Println(" Add(4,5)的结果为:", ret2)
133
-	fmt.Println(" str:", s2)
134
-	fmt.Println(" str1:", s3)
135
-	if err2 != nil {
136
-		fmt.Println("SSCard的运算结果为:", ret2)
137
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
138
-		return
139
-	}
140
-
141
-	//DllDef := syscall.MustLoadDLL("SSCard.dll")
142
-
143
-}
94
+//func (c *HisApiController) TestGetBasBaseInfo() {
95
+//
96
+//	//result := C.Init(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
97
+//	//fmt.Println(result)
98
+//	//cs1 := C.CString("")
99
+//	//cs2 := C.CString("")
100
+//	//C.ReadCardBas(cs1, IntPtr(1024), cs2, IntPtr(1024))
101
+//	//fmt.Println(cs1)
102
+//	//fmt.Println(cs2)
103
+//	//C.free(unsafe.Pointer(cs1))
104
+//	//C.free(unsafe.Pointer(cs2))
105
+//
106
+//	//
107
+//
108
+//	DllDef := syscall.MustLoadDLL("SSCard.dll")
109
+//	Iinit := DllDef.MustFindProc("Init")
110
+//	readCard := DllDef.MustFindProc("ReadCardBas")
111
+//	ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
112
+//	if ret != 0 {
113
+//		fmt.Println("SSCard的报错原因:", err)
114
+//		fmt.Println("SSCard的运算结果为:", ret)
115
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
116
+//		return
117
+//	}
118
+//
119
+//	result := int(ret)
120
+//	fmt.Println("SSCard的运算结果为1:", result)
121
+//
122
+//	//path := ""
123
+//	//bytePath := []byte(  "\x00")
124
+//	//bytePath2 := []byte(  "\x00")
125
+//	//ssss
126
+//
127
+//	str := make([]byte, 256)
128
+//	str1 := make([]byte, 256)
129
+//	s2 := []byte(string(str))
130
+//	s3 := []byte(string(str1))
131
+//	ret2, _, err2 := readCard.Call((uintptr)(unsafe.Pointer(&s2[0])), IntPtr(256), (uintptr)(unsafe.Pointer(&s3[0])), IntPtr(256))
132
+//	fmt.Println(" Add(4,5)的结果为:", ret2)
133
+//	fmt.Println(" str:", s2)
134
+//	fmt.Println(" str1:", s3)
135
+//	if err2 != nil {
136
+//		fmt.Println("SSCard的运算结果为:", ret2)
137
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
138
+//		return
139
+//	}
140
+//
141
+//	//DllDef := syscall.MustLoadDLL("SSCard.dll")
142
+//
143
+//}
144 144
 
145 145
 func (c *HisApiController) GetOrgInfo() {
146 146
 	miConfig, _ := service.FindMedicalInsuranceInfo(9919)
@@ -509,16 +509,16 @@ func (c *HisApiController) GetHisPatientInfo() {
509 509
 //	return string(str), nil
510 510
 //}
511 511
 
512
-func CardInit() int {
513
-	DllTestDef := syscall.MustLoadDLL("SSCard.dll")
514
-	add := DllTestDef.MustFindProc("Init")
515
-	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
516
-	if err != nil {
517
-		fmt.Println("SSCard的运算结果为:", ret)
518
-	}
519
-	result := int(ret)
520
-	return result
521
-}
512
+//func CardInit() int {
513
+//	DllTestDef := syscall.MustLoadDLL("SSCard.dll")
514
+//	add := DllTestDef.MustFindProc("Init")
515
+//	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
516
+//	if err != nil {
517
+//		fmt.Println("SSCard的运算结果为:", ret)
518
+//	}
519
+//	result := int(ret)
520
+//	return result
521
+//}
522 522
 
523 523
 //func CardInit() int {
524 524
 //	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))

+ 527 - 243
controllers/sz/sz_his_api_controller.go Ver fichero

@@ -1882,9 +1882,19 @@ func (c *SZHisApiController) GetTreatmentProject() {
1882 1882
 	adminUserInfo := c.GetAdminUserInfo()
1883 1883
 	orgId := adminUserInfo.CurrentOrgId
1884 1884
 
1885
-	//获取药品库数据
1886
-	list, _ := service.GetMyPorjecgList(orgId)
1887
-
1885
+	ids := c.GetString("ids")
1886
+	stringarr := strings.Split(ids, ",")
1887
+	idss := make([]int64, 0)
1888
+	for _, item := range stringarr {
1889
+		itemsss, _ := strconv.ParseInt(item, 10, 64)
1890
+		id := int64(itemsss)
1891
+		idss = append(idss, id)
1892
+	}
1893
+	fmt.Println("idsss", idss)
1894
+	//获取项目库数据
1895
+	//list, _ := service.GetMyPorjecgList(orgId)
1896
+	list, _ := service.GetBathchMyPorjecgList(idss)
1897
+	fmt.Println("list2222222222", list)
1888 1898
 	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
1889 1899
 	var doctor_name string
1890 1900
 	var doctor_code string
@@ -2021,7 +2031,6 @@ func (c *SZHisApiController) GetRevocation() {
2021 2031
 	id, _ := c.GetInt64("id")
2022 2032
 	//用来区分是药品的撤销还是耗材的撤销  1.药品  2.诊疗项目 3.材料 5.辅助器具项目
2023 2033
 	is_mark, _ := c.GetInt64("is_mark")
2024
-
2025 2034
 	type_id, _ := c.GetInt64("type_id")
2026 2035
 	fmt.Println("type_id2222222", type_id)
2027 2036
 	if type_id == 1 {
@@ -2179,135 +2188,139 @@ func (c *SZHisApiController) GetRevocation() {
2179 2188
 			}
2180 2189
 
2181 2190
 		}
2182
-		if type_id == 2 {
2183
-			//撤销
2184
-			if is_mark == 1 {
2185
-				//获取药品库数据
2186
-				list, _ := service.GetMyPorjecgListDetail(orgId, id)
2187
-
2188
-				miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2189
-				var doctor_name string
2190
-				var doctor_code string
2191
-
2192
-				doctor_name = "黄亦轩"
2193
-				doctor_code = "1001"
2194
-
2195
-				var pagesize int = 50
2196
-				var start int = 1
2197
-				var stop int
2198
-				var pagecount int
2199
-				var curpage int
2200
-				var isSuccess bool = true
2201
-				//总页数,向上取整,注意除之前要先转换类型为float64
2202
-				pagecount = int(math.Ceil(float64(len(list)) / float64(pagesize)))
2203
-
2204
-				for curpage = 1; curpage <= pagecount; curpage++ {
2205
-					if curpage == 1 {
2206
-						start = 1
2207
-					} else {
2208
-						start = (curpage-1)*pagesize + 1
2209
-					}
2210
-					stop = curpage * pagesize
2211
-					if stop > len(list) {
2212
-						stop = len(list)
2213
-					}
2214
-					//这里就可以查看开始和结束了
2215
-					fmt.Println(list[start-1 : stop])
2216
-					var customs []*models.DrugDetail
2217
-					for _, item := range list {
2218
-						detail := &models.DrugDetail{
2219
-							SocialSecurityDirectoryCode: item.MedicalCode,
2220
-						}
2221
-						customs = append(customs, detail)
2222
-					}
2223
-					result := service.SzybML010(doctor_name, doctor_code, miConfig.Code, customs, type_id)
2224
-					fmt.Println("reuslt", result)
2225
-					var dat map[string]interface{}
2226
-					if err := json.Unmarshal([]byte(result), &dat); err == nil {
2227
-						fmt.Println(dat)
2228
-					} else {
2229
-						fmt.Println(err)
2230
-					}
2191
+	}
2231 2192
 
2232
-					userJSONBytes, _ := json.Marshal(dat)
2193
+	if type_id == 2 {
2194
+		fmt.Println("222222222222222q2")
2195
+		//撤销
2196
+		if is_mark == 1 {
2197
+			//获取药品库数据
2198
+			list, _ := service.GetMyPorjecgListDetail(orgId, id)
2233 2199
 
2234
-					var res Result
2235
-					if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2236
-						utils.ErrorLog("解析失败:%v", err)
2237
-						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2238
-						return
2239
-					}
2240
-					if res.Transreturncode == "00000000" {
2241
-						//核销成功返回状态码
2242
-						_, err := service.UpdateMyProjectById(id)
2243
-						fmt.Println("err", err)
2244
-					} else {
2245
-						isSuccess = false
2246
-						//失败
2247
-
2248
-						c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugReturnFaildParamWrong)
2249
-						return
2250
-					}
2251
-					fmt.Println(isSuccess)
2200
+			miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2201
+			var doctor_name string
2202
+			var doctor_code string
2203
+
2204
+			doctor_name = "黄亦轩"
2205
+			doctor_code = "1001"
2206
+
2207
+			var pagesize int = 50
2208
+			var start int = 1
2209
+			var stop int
2210
+			var pagecount int
2211
+			var curpage int
2212
+			var isSuccess bool = true
2213
+			//总页数,向上取整,注意除之前要先转换类型为float64
2214
+			pagecount = int(math.Ceil(float64(len(list)) / float64(pagesize)))
2215
+
2216
+			for curpage = 1; curpage <= pagecount; curpage++ {
2217
+				if curpage == 1 {
2218
+					start = 1
2219
+				} else {
2220
+					start = (curpage-1)*pagesize + 1
2252 2221
 				}
2253
-			}
2254
-			//备案
2255
-			if is_mark == 0 {
2256
-				adminUserInfo := c.GetAdminUserInfo()
2257
-				orgId := adminUserInfo.CurrentOrgId
2258
-
2259
-				//获取药品库数据
2260
-				list, _ := service.GetMyPorjecgListDetail(orgId, id)
2261
-
2262
-				miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2263
-				var doctor_name string
2264
-				var doctor_code string
2265
-				doctor_name = "黄亦轩"
2266
-				doctor_code = "1001"
2267
-				var isSuccess bool = true
2222
+				stop = curpage * pagesize
2223
+				if stop > len(list) {
2224
+					stop = len(list)
2225
+				}
2226
+				//这里就可以查看开始和结束了
2227
+				fmt.Println(list[start-1 : stop])
2228
+				var customs []*models.DrugDetail
2268 2229
 				for _, item := range list {
2269
-					detail := &models.MyHisProject{
2270
-						MedicalCode: item.MedicalCode, //社保目录
2271
-						ProjectName: item.ProjectName,
2272
-						Price:       item.Price,
2273
-						Category:    item.Category,
2274
-						Remark:      item.Remark,
2230
+					detail := &models.DrugDetail{
2231
+						SocialSecurityDirectoryCode: item.MedicalCode,
2275 2232
 					}
2233
+					customs = append(customs, detail)
2234
+				}
2235
+				result := service.SzybML010(doctor_name, doctor_code, miConfig.Code, customs, type_id)
2236
+				fmt.Println("reuslt", result)
2237
+				var dat map[string]interface{}
2238
+				if err := json.Unmarshal([]byte(result), &dat); err == nil {
2239
+					fmt.Println(dat)
2240
+				} else {
2241
+					fmt.Println(err)
2242
+				}
2276 2243
 
2277
-					result := service.SzybML009(doctor_name, doctor_code, miConfig.Code, detail)
2278
-					fmt.Println("reuslt9999999999999999", result)
2279
-					var dat map[string]interface{}
2280
-					if err := json.Unmarshal([]byte(result), &dat); err == nil {
2281
-						fmt.Println(dat)
2282
-					} else {
2283
-						fmt.Println(err)
2284
-					}
2244
+				userJSONBytes, _ := json.Marshal(dat)
2285 2245
 
2286
-					userJSONBytes, _ := json.Marshal(dat)
2246
+				var res Result
2247
+				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2248
+					utils.ErrorLog("解析失败:%v", err)
2249
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2250
+					return
2251
+				}
2252
+				if res.Transreturncode == "00000000" {
2253
+					//核销成功返回状态码
2254
+					_, err := service.UpdateMyProjectById(id)
2255
+					fmt.Println("err", err)
2256
+				} else {
2257
+					isSuccess = false
2258
+					//失败
2287 2259
 
2288
-					var res Result
2289
-					if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2290
-						utils.ErrorLog("解析失败:%v", err)
2291
-						c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2292
-						return
2293
-					}
2294
-					if res.Transreturncode == "00000000" {
2295
-						//备案成功返回状态值
2296
-						_, err := service.UpdateProjectById(item.ID)
2297
-						fmt.Println("err22222", err)
2298
-					} else {
2299
-						isSuccess = false
2300
-						//失败
2301
-
2302
-						c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
2303
-						return
2304
-					}
2305
-					fmt.Println(isSuccess)
2260
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugReturnFaildParamWrong)
2261
+					return
2306 2262
 				}
2263
+				fmt.Println(isSuccess)
2307 2264
 			}
2308 2265
 		}
2266
+		fmt.Println("is_marke", is_mark)
2267
+		//备案
2268
+		if is_mark == 0 {
2269
+			fmt.Println("进来饿了吗32222222")
2270
+			adminUserInfo := c.GetAdminUserInfo()
2271
+			orgId := adminUserInfo.CurrentOrgId
2272
+
2273
+			//获取药品库数据
2274
+			list, _ := service.GetMyPorjecgListDetail(orgId, id)
2275
+
2276
+			miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2277
+			var doctor_name string
2278
+			var doctor_code string
2279
+			doctor_name = "黄亦轩"
2280
+			doctor_code = "1001"
2281
+			var isSuccess bool = true
2282
+			for _, item := range list {
2283
+				detail := &models.MyHisProject{
2284
+					MedicalCode: item.MedicalCode, //社保目录
2285
+					ProjectName: item.ProjectName,
2286
+					Price:       item.Price,
2287
+					Category:    item.Category,
2288
+					Remark:      item.Remark,
2289
+				}
2290
+
2291
+				result := service.SzybML009(doctor_name, doctor_code, miConfig.Code, detail)
2292
+				fmt.Println("reuslt9999999999999999", result)
2293
+				var dat map[string]interface{}
2294
+				if err := json.Unmarshal([]byte(result), &dat); err == nil {
2295
+					fmt.Println(dat)
2296
+				} else {
2297
+					fmt.Println(err)
2298
+				}
2309 2299
 
2300
+				userJSONBytes, _ := json.Marshal(dat)
2301
+
2302
+				var res Result
2303
+				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2304
+					utils.ErrorLog("解析失败:%v", err)
2305
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2306
+					return
2307
+				}
2308
+				if res.Transreturncode == "00000000" {
2309
+					//备案成功返回状态值
2310
+					_, err := service.UpdateProjectById(item.ID)
2311
+					fmt.Println("err22222", err)
2312
+				} else {
2313
+					isSuccess = false
2314
+					//失败
2315
+
2316
+					c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
2317
+					return
2318
+				}
2319
+				fmt.Println(isSuccess)
2320
+			}
2321
+		}
2310 2322
 	}
2323
+
2311 2324
 	if type_id == 3 {
2312 2325
 
2313 2326
 		//撤销
@@ -2345,7 +2358,7 @@ func (c *SZHisApiController) GetRevocation() {
2345 2358
 				fmt.Println(list[start-1 : stop])
2346 2359
 				var customs []*models.DrugDetail
2347 2360
 				for _, item := range list {
2348
-					fmt.Println("医疗机构编码", item.MedicalInsuranceNumber)
2361
+					fmt.Println("医疗机构编码", item.SocialSecurityDirectoryCode)
2349 2362
 					detail := &models.DrugDetail{
2350 2363
 						SocialSecurityDirectoryCode: item.SocialSecurityDirectoryCode,
2351 2364
 						ManufacturerName:            item.ManufacturerName,
@@ -2412,6 +2425,7 @@ func (c *SZHisApiController) GetRevocation() {
2412 2425
 					BuyPrice:                    item.BuyPrice,
2413 2426
 					SellPrice:                   item.SellPrice,
2414 2427
 					Remark:                      item.Remark,
2428
+					SpecificationName:           item.SpecificationName,
2415 2429
 				}
2416 2430
 
2417 2431
 				result := service.SzybYML007(doctor_name, doctor_code, miConfig.Code, detail)
@@ -2494,8 +2508,20 @@ func (c *SZHisApiController) GetDoctorList() {
2494 2508
 	adminUserInfo := c.GetAdminUserInfo()
2495 2509
 	orgid := adminUserInfo.CurrentOrgId
2496 2510
 	fmt.Println("or3gi", orgid)
2511
+	ids := c.GetString("ids")
2512
+	fmt.Println("ids2222222222", ids)
2513
+	stringarr := strings.Split(ids, ",")
2514
+	idss := make([]int64, 0)
2515
+	for _, item := range stringarr {
2516
+		itemsss, _ := strconv.ParseInt(item, 10, 64)
2517
+		id := int64(itemsss)
2518
+		idss = append(idss, id)
2519
+	}
2497 2520
 	//获取所有医生护士信息
2498
-	list, _ := service.GetDoctorList(orgid)
2521
+	//list, _ := service.GetDoctorList(orgid)
2522
+	//批量查询
2523
+	list, _ := service.GetBatchDoctorList(idss)
2524
+	fmt.Println("list22222222222", list)
2499 2525
 	//获取所有角色名称
2500 2526
 	roleList, _ := service.GetRoleList(orgid)
2501 2527
 
@@ -2513,31 +2539,246 @@ func (c *SZHisApiController) GetDoctorList() {
2513 2539
 	doctor_name = "黄亦轩"
2514 2540
 	doctor_code = "1001"
2515 2541
 
2516
-	var pagesize int = 50
2517
-	var start int = 1
2518
-	var stop int
2519
-	var pagecount int
2520
-	var curpage int
2521 2542
 	var isSuccess bool = true
2522
-	//总页数,向上取整,注意除之前要先转换类型为float64
2523
-	pagecount = int(math.Ceil(float64(len(list)) / float64(pagesize)))
2524 2543
 
2525
-	var ress []*Result
2526
-	for curpage = 1; curpage <= pagecount; curpage++ {
2527
-		if curpage == 1 {
2528
-			start = 1
2544
+	for _, item := range list {
2545
+		fmt.Println("医护类别", item.StudyMajorName)
2546
+		detail := &models.DocDetail{
2547
+			UserName:                                item.UserName,                                                       //医护姓名
2548
+			RoleId:                                  item.Name,                                                           //医护人员类别
2549
+			Sex:                                     strconv.FormatInt(item.Sex, 10),                                     //性别
2550
+			CardType:                                strconv.FormatInt(item.CardType, 10),                                //证件类型
2551
+			IdCard:                                  item.IdCard,                                                         //证件号码
2552
+			Phone:                                   item.Mobile,                                                         //联系电话
2553
+			WorkMajorName:                           item.WorkMajorName,                                                  // 现从事专业名称
2554
+			Nation:                                  item.Nation,                                                         //民族
2555
+			BirthDay:                                20201022,                                                            // 出生日期
2556
+			WorkTime:                                20201022,                                                            //参加工作日期
2557
+			Education:                               strconv.FormatInt(item.Education, 10),                               //学历
2558
+			StudyMajorName:                          item.StudyMajorName,                                                 //所学的专业名称
2559
+			CertificateCode:                         item.MedicalCode,                                                    //医(药)师执业证书编码
2560
+			MedicalCode:                             item.DoctorCode,                                                     //医(药)师资格证编码
2561
+			MedicalRangeCode:                        strconv.FormatInt(item.DoctorRangeCode, 10),                         //医师执业范围代码
2562
+			MedicalLevel:                            strconv.FormatInt(item.DoctorLevel, 10),                             //医生执业资格证中的医师级别
2563
+			TypeJob:                                 strconv.FormatInt(item.DoctorTypeJob, 10),                           //医生执业资格证中的执业类别
2564
+			DoctorNumber:                            item.DoctorNumber,                                                   //医保医师编号
2565
+			Licensing:                               strconv.FormatInt(item.Licensing, 10),                               //多点执业标志
2566
+			DoctorServiceStatus:                     "",                                                                  //医师医保服务资格状态
2567
+			MonitoringLevel:                         "",                                                                  //监控等级
2568
+			DrugPsychotropicSubstances:              "",                                                                  //毒麻精神药品资格
2569
+			HealthCareCode:                          "",                                                                  // 母婴保健技术考核合格证书编号
2570
+			PlanningTechnicalServiceCode:            "",                                                                  //计划生育技术服务人员合格证编号
2571
+			PharmacistType:                          "",                                                                  //药师类别
2572
+			PharmacistPracticeCategory:              "",                                                                  //药师执业类别
2573
+			PharmacistsLicensing:                    "",                                                                  //药师执业范围
2574
+			PharmacistRegistrationNumber:            "",                                                                  //执业药师注册证编号
2575
+			OfficeCode:                              "",                                                                  //科室编码
2576
+			JobNumber:                               item.JobNumber,                                                      //工号
2577
+			PostName:                                "",                                                                  //职位名称
2578
+			TechnicalJobLevelCode:                   "",                                                                  //专业技术职务级别编码
2579
+			IsActive:                                strconv.FormatInt(item.IsActive, 10),                                //在职与否
2580
+			PrescriptionQualificationIdentification: strconv.FormatInt(item.PrescriptionQualificationIdentification, 10), //处方资格标识
2581
+			IdentificationOutpatients:               strconv.FormatInt(item.IdentificationOutpatients, 10),               //门诊大病医师标识
2582
+			OutpatientIllnessCategory:               item.OutpatientIllnessCategory,                                      //门诊大病类别
2583
+			StartTime:                               20201010,                                                            //开始日期
2584
+			StaffCode:                               "",                                                                  //医护人员编码
2585
+			EndTime:                                 0,                                                                   // 结束日期
2586
+		}
2587
+
2588
+		result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, detail)
2589
+		fmt.Println("reuslt9999999999999999", result)
2590
+		var dat map[string]interface{}
2591
+		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2592
+			fmt.Println(dat)
2529 2593
 		} else {
2530
-			start = (curpage-1)*pagesize + 1
2594
+			fmt.Println(err)
2531 2595
 		}
2532
-		stop = curpage * pagesize
2533
-		if stop > len(list) {
2534
-			stop = len(list)
2596
+
2597
+		userJSONBytes, _ := json.Marshal(dat)
2598
+
2599
+		var res Result
2600
+		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2601
+			utils.ErrorLog("解析失败:%v", err)
2602
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2603
+			return
2535 2604
 		}
2536
-		//这里就可以查看开始和结束了
2537
-		fmt.Println(list[start-1 : stop])
2538
-		var customs []*models.DocDetail
2605
+		if res.Transreturncode == "00000000" {
2606
+			//批量插入数据
2607
+			_, err := service.UpdateAdminUserRoleById(item.AdminUserId)
2608
+			fmt.Println("err2222", err)
2609
+		} else {
2610
+			isSuccess = false
2611
+			//失败
2612
+
2613
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDoctorLoginFaildParamWrong)
2614
+			return
2615
+		}
2616
+		fmt.Println(isSuccess)
2617
+	}
2618
+
2619
+}
2620
+
2621
+//func (c *SZHisApiController) GetDoctorList() {
2622
+//
2623
+//	adminUserInfo := c.GetAdminUserInfo()
2624
+//	orgid := adminUserInfo.CurrentOrgId
2625
+//	fmt.Println("or3gi", orgid)
2626
+//	//获取所有医生护士信息
2627
+//	list, _ := service.GetDoctorList(orgid)
2628
+//	//获取所有角色名称
2629
+//	roleList, _ := service.GetRoleList(orgid)
2630
+//
2631
+//	miConfig, _ := service.FindMedicalInsuranceInfo(orgid)
2632
+//	for _, item := range list {
2633
+//		for _, it := range roleList {
2634
+//			if item.RoleId == it.ID {
2635
+//				item.Name = it.RoleName
2636
+//			}
2637
+//		}
2638
+//	}
2639
+//	var doctor_name string
2640
+//	var doctor_code string
2641
+//
2642
+//	doctor_name = "黄亦轩"
2643
+//	doctor_code = "1001"
2644
+//
2645
+//	var pagesize int = 50
2646
+//	var start int = 1
2647
+//	var stop int
2648
+//	var pagecount int
2649
+//	var curpage int
2650
+//	var isSuccess bool = true
2651
+//	//总页数,向上取整,注意除之前要先转换类型为float64
2652
+//	pagecount = int(math.Ceil(float64(len(list)) / float64(pagesize)))
2653
+//
2654
+//	var ress []*Result
2655
+//	for curpage = 1; curpage <= pagecount; curpage++ {
2656
+//		if curpage == 1 {
2657
+//			start = 1
2658
+//		} else {
2659
+//			start = (curpage-1)*pagesize + 1
2660
+//		}
2661
+//		stop = curpage * pagesize
2662
+//		if stop > len(list) {
2663
+//			stop = len(list)
2664
+//		}
2665
+//		//这里就可以查看开始和结束了
2666
+//		fmt.Println(list[start-1 : stop])
2667
+//		var customs []*models.DocDetail
2668
+//		for _, item := range list {
2669
+//			fmt.Println("医护类别", item.Name)
2670
+//			sex := strconv.FormatInt(item.Sex, 10)
2671
+//			card_type := strconv.FormatInt(item.CardType, 10)
2672
+//			is_active := strconv.FormatInt(item.IsActive, 10)
2673
+//
2674
+//			detail := &models.DocDetail{
2675
+//				UserName:                                item.UserName,
2676
+//				RoleId:                                  item.Name,
2677
+//				Sex:                                     sex,
2678
+//				CardType:                                card_type,
2679
+//				IdCard:                                  item.IdCard,
2680
+//				Phone:                                   item.Mobile,
2681
+//				WorkMajorName:                           item.WorkMajorName,
2682
+//				Nation:                                  item.Nation,
2683
+//				BirthDay:                                20201022,
2684
+//				WorkTime:                                12,
2685
+//				Education:                               strconv.FormatInt(item.Education, 10),
2686
+//				StudyMajorName:                          item.StudyMajorName,
2687
+//				CertificateCode:                         "",                                           //证书编码
2688
+//				MedicalCode:                             item.MedicalCode,                             //医师资格编码
2689
+//				MedicalRangeCode:                        strconv.FormatInt(item.MedicalRangeCode, 10), //医师执业范围代码
2690
+//				MedicalLevel:                            strconv.FormatInt(item.MedicalLevel, 10),     //医生级别
2691
+//				TypeJob:                                 strconv.FormatInt(item.DoctorTypeJob, 10),    //职业类别
2692
+//				DoctorNumber:                            item.DoctorNumber,                            //医师编号
2693
+//				Licensing:                               strconv.FormatInt(item.Licensing, 10),        //职业标志
2694
+//				DoctorServiceStatus:                     "",                                           //医师医保服务资格状态
2695
+//				MonitoringLevel:                         "",                                           //监控等级
2696
+//				DrugPsychotropicSubstances:              "",                                           //毒麻精神药品资格
2697
+//				HealthCareCode:                          "",                                           // 母婴保健技术考核合格证书编号
2698
+//				PlanningTechnicalServiceCode:            "",                                           //计划生育技术服务人员合格证编号
2699
+//				PharmacistType:                          "",                                           //药师类别
2700
+//				PharmacistPracticeCategory:              "",                                           //药师执业类别
2701
+//				PharmacistsLicensing:                    "",                                           //药师执业范围
2702
+//				PharmacistRegistrationNumber:            item.PharmacistRegistrationNumber,            //执业药师注册证编号
2703
+//				OfficeCode:                              "",                                           //科室编码
2704
+//				JobNumber:                               item.JobNumber,                               //工号
2705
+//				PostName:                                "",                                           //职位名称
2706
+//				TechnicalJobLevelCode:                   "",                                           //专业技术职务级别编码
2707
+//				IsActive:                                is_active,                                    //在职与否
2708
+//				PrescriptionQualificationIdentification: item.PharmacistRegistrationNumber,            //处方资格标识
2709
+//				IdentificationOutpatients:               "",                                           //门诊大病医师标识
2710
+//				OutpatientIllnessCategory:               item.OutpatientIllnessCategory,               //门诊大病类别
2711
+//				StartTime:                               1233,                                         //开始日期
2712
+//
2713
+//			}
2714
+//			customs = append(customs, detail)
2715
+//		}
2716
+//
2717
+//		result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, customs)
2718
+//		fmt.Println("reuslt9999999999999999", result)
2719
+//		var dat map[string]interface{}
2720
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2721
+//			fmt.Println(dat)
2722
+//		} else {
2723
+//			fmt.Println(err)
2724
+//		}
2725
+//
2726
+//		userJSONBytes, _ := json.Marshal(dat)
2727
+//
2728
+//		var res Result
2729
+//		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2730
+//			utils.ErrorLog("解析失败:%v", err)
2731
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2732
+//			return
2733
+//		}
2734
+//		if res.Transreturncode == "00000000" {
2735
+//			ress = append(ress, &res)
2736
+//		} else {
2737
+//			isSuccess = false
2738
+//			//失败
2739
+//
2740
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDoctorLoginFaildParamWrong)
2741
+//			return
2742
+//		}
2743
+//		fmt.Println(isSuccess)
2744
+//	}
2745
+//
2746
+//}
2747
+
2748
+func (c *SZHisApiController) GetMedicalList() {
2749
+
2750
+	adminUserInfo := c.GetAdminUserInfo()
2751
+	orgId := adminUserInfo.CurrentOrgId
2752
+
2753
+	id, _ := c.GetInt64("id")
2754
+	fmt.Println("id22222222", id)
2755
+	is_mark, _ := c.GetInt64("is_mark")
2756
+
2757
+	//去登记
2758
+	if is_mark == 0 {
2759
+		list, _ := service.GetDoctorListByDetail(orgId, id)
2760
+		fmt.Println("list22222222222", list)
2761
+		//获取所有角色名称
2762
+		roleList, _ := service.GetRoleList(orgId)
2763
+
2764
+		miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2539 2765
 		for _, item := range list {
2540
-			fmt.Println("医护类别", item.Name)
2766
+			for _, it := range roleList {
2767
+				if item.RoleId == it.ID {
2768
+					item.Name = it.RoleName
2769
+				}
2770
+			}
2771
+		}
2772
+		var doctor_name string
2773
+		var doctor_code string
2774
+
2775
+		doctor_name = "黄亦轩"
2776
+		doctor_code = "1001"
2777
+
2778
+		var isSuccess bool = true
2779
+
2780
+		for _, item := range list {
2781
+			fmt.Println("医护类别", item.Mobile)
2541 2782
 			sex := strconv.FormatInt(item.Sex, 10)
2542 2783
 			card_type := strconv.FormatInt(item.CardType, 10)
2543 2784
 			is_active := strconv.FormatInt(item.IsActive, 10)
@@ -2579,92 +2820,63 @@ func (c *SZHisApiController) GetDoctorList() {
2579 2820
 				PrescriptionQualificationIdentification: item.PharmacistRegistrationNumber,            //处方资格标识
2580 2821
 				IdentificationOutpatients:               "",                                           //门诊大病医师标识
2581 2822
 				OutpatientIllnessCategory:               item.OutpatientIllnessCategory,               //门诊大病类别
2582
-				StartTime:                               1233,                                         //开始日期
2823
+				StartTime:                               20201012,                                     //开始日期
2583 2824
 
2584 2825
 			}
2585
-			customs = append(customs, detail)
2586
-		}
2826
+			result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, detail)
2827
+			fmt.Println("reuslt9999999999999999", result)
2828
+			var dat map[string]interface{}
2829
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
2830
+				fmt.Println(dat)
2831
+			} else {
2832
+				fmt.Println(err)
2833
+			}
2587 2834
 
2588
-		result := service.SzybYS001(doctor_name, doctor_code, miConfig.Code, customs)
2589
-		fmt.Println("reuslt9999999999999999", result)
2590
-		var dat map[string]interface{}
2591
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2592
-			fmt.Println(dat)
2593
-		} else {
2594
-			fmt.Println(err)
2595
-		}
2835
+			userJSONBytes, _ := json.Marshal(dat)
2596 2836
 
2597
-		userJSONBytes, _ := json.Marshal(dat)
2837
+			var res Result
2838
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2839
+				utils.ErrorLog("解析失败:%v", err)
2840
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2841
+				return
2842
+			}
2843
+			if res.Transreturncode == "00000000" {
2844
+				//登记成功
2845
+				service.UpdateAdminUserRoleById(item.ID)
2598 2846
 
2599
-		var res Result
2600
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2601
-			utils.ErrorLog("解析失败:%v", err)
2602
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2603
-			return
2604
-		}
2605
-		if res.Transreturncode == "00000000" {
2606
-			ress = append(ress, &res)
2607
-		} else {
2608
-			isSuccess = false
2609
-			//失败
2847
+			} else {
2848
+				isSuccess = false
2849
+				//失败
2610 2850
 
2611
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDoctorLoginFaildParamWrong)
2612
-			return
2851
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorDoctorLoginFaildParamWrong)
2852
+				return
2853
+			}
2854
+			fmt.Println(isSuccess)
2613 2855
 		}
2614
-		fmt.Println(isSuccess)
2615 2856
 	}
2616 2857
 
2617
-}
2858
+	//去撤销
2859
+	if is_mark == 1 {
2860
+		//获取所有医生护士信息
2861
+		list, _ := service.GetDoctorListByDetail(orgId, id)
2862
+		//获取所有角色名称
2863
+		roleList, _ := service.GetRoleList(orgId)
2618 2864
 
2619
-func (c *SZHisApiController) GetMedicalList() {
2620
-
2621
-	adminUserInfo := c.GetAdminUserInfo()
2622
-	orgId := adminUserInfo.CurrentOrgId
2623
-
2624
-	id, _ := c.GetInt64("id")
2625
-	fmt.Println("id22222222", id)
2626
-	//获取所有医生护士信息
2627
-	list, _ := service.GetDoctorListByDetail(orgId, id)
2628
-	//获取所有角色名称
2629
-	roleList, _ := service.GetRoleList(orgId)
2630
-
2631
-	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2632
-	for _, item := range list {
2633
-		for _, it := range roleList {
2634
-			if item.RoleId == it.ID {
2635
-				item.Name = it.RoleName
2865
+		miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
2866
+		for _, item := range list {
2867
+			for _, it := range roleList {
2868
+				if item.RoleId == it.ID {
2869
+					item.Name = it.RoleName
2870
+				}
2636 2871
 			}
2637 2872
 		}
2638
-	}
2639
-	var doctor_name string
2640
-	var doctor_code string
2641
-
2642
-	doctor_name = "黄亦轩"
2643
-	doctor_code = "1001"
2873
+		var doctor_name string
2874
+		var doctor_code string
2644 2875
 
2645
-	var pagesize int = 50
2646
-	var start int = 1
2647
-	var stop int
2648
-	var pagecount int
2649
-	var curpage int
2650
-	var isSuccess bool = true
2651
-	//总页数,向上取整,注意除之前要先转换类型为float64
2652
-	pagecount = int(math.Ceil(float64(len(list)) / float64(pagesize)))
2876
+		doctor_name = "黄亦轩"
2877
+		doctor_code = "1001"
2653 2878
 
2654
-	var ress []*Result
2655
-	for curpage = 1; curpage <= pagecount; curpage++ {
2656
-		if curpage == 1 {
2657
-			start = 1
2658
-		} else {
2659
-			start = (curpage-1)*pagesize + 1
2660
-		}
2661
-		stop = curpage * pagesize
2662
-		if stop > len(list) {
2663
-			stop = len(list)
2664
-		}
2665
-		//这里就可以查看开始和结束了
2666
-		fmt.Println(list[start-1 : stop])
2667
-		var customs []*models.DocDetail
2879
+		var isSuccess bool = true
2668 2880
 		for _, item := range list {
2669 2881
 			fmt.Println("医护类别", item.Name)
2670 2882
 			detail := &models.DocDetail{
@@ -2708,37 +2920,36 @@ func (c *SZHisApiController) GetMedicalList() {
2708 2920
 				StartTime:                               20210311,   //开始日期
2709 2921
 
2710 2922
 			}
2711
-			customs = append(customs, detail)
2712
-		}
2713
-
2714
-		result := service.SzybYS002(doctor_name, doctor_code, miConfig.Code, customs)
2715
-		fmt.Println("reuslt9999999999999999", result)
2716
-		var dat map[string]interface{}
2717
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
2718
-			fmt.Println(dat)
2719
-		} else {
2720
-			fmt.Println(err)
2721
-		}
2923
+			result := service.SzybYS002(doctor_name, doctor_code, miConfig.Code, detail)
2924
+			fmt.Println("reuslt9999999999999999", result)
2925
+			var dat map[string]interface{}
2926
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
2927
+				fmt.Println(dat)
2928
+			} else {
2929
+				fmt.Println(err)
2930
+			}
2722 2931
 
2723
-		userJSONBytes, _ := json.Marshal(dat)
2932
+			userJSONBytes, _ := json.Marshal(dat)
2724 2933
 
2725
-		var res Result
2726
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2727
-			utils.ErrorLog("解析失败:%v", err)
2728
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2729
-			return
2730
-		}
2731
-		if res.Transreturncode == "00000000" {
2732
-			ress = append(ress, &res)
2733
-		} else {
2734
-			isSuccess = false
2735
-			//失败
2934
+			var res Result
2935
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
2936
+				utils.ErrorLog("解析失败:%v", err)
2937
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2938
+				return
2939
+			}
2940
+			if res.Transreturncode == "00000000" {
2941
+				//去撤销
2942
+				service.UpdateAdminUserRoleById(item.ID)
2943
+			} else {
2944
+				isSuccess = false
2945
+				//失败
2946
+
2947
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugReturnFaildParamWrong)
2948
+				return
2949
+			}
2950
+			fmt.Println(isSuccess)
2736 2951
 
2737
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugReturnFaildParamWrong)
2738
-			return
2739 2952
 		}
2740
-		fmt.Println(isSuccess)
2741
-
2742 2953
 	}
2743 2954
 }
2744 2955
 
@@ -2869,9 +3080,18 @@ func (c *SZHisApiController) GetGoodsList() {
2869 3080
 
2870 3081
 	adminUserInfo := c.GetAdminUserInfo()
2871 3082
 	orgId := adminUserInfo.CurrentOrgId
2872
-	fmt.Println("3344555555555", orgId)
2873
-	//获取所有耗材信息
2874
-	list, _ := service.GetGoodInformationList(orgId)
3083
+
3084
+	ids := c.GetString("ids")
3085
+	fmt.Println("ids2222222222", ids)
3086
+	stringarr := strings.Split(ids, ",")
3087
+	idss := make([]int64, 0)
3088
+	for _, item := range stringarr {
3089
+		itemsss, _ := strconv.ParseInt(item, 10, 64)
3090
+		id := int64(itemsss)
3091
+		idss = append(idss, id)
3092
+	}
3093
+	//批量获取所有耗材信息
3094
+	list, _ := service.GetBatchGoodInformationList(idss)
2875 3095
 	fmt.Println("list22222", list)
2876 3096
 	//获取单位
2877 3097
 	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
@@ -2893,6 +3113,7 @@ func (c *SZHisApiController) GetGoodsList() {
2893 3113
 			BuyPrice:                    item.BuyPrice,
2894 3114
 			SellPrice:                   item.SellPrice,
2895 3115
 			Remark:                      item.Remark,
3116
+			SpecificationName:           item.SpecificationName,
2896 3117
 		}
2897 3118
 
2898 3119
 		result := service.SzybYML007(doctor_name, doctor_code, miConfig.Code, detail)
@@ -2928,6 +3149,69 @@ func (c *SZHisApiController) GetGoodsList() {
2928 3149
 	}
2929 3150
 }
2930 3151
 
3152
+//func (c *SZHisApiController) GetGoodsList() {
3153
+//
3154
+//	adminUserInfo := c.GetAdminUserInfo()
3155
+//	orgId := adminUserInfo.CurrentOrgId
3156
+//	fmt.Println("3344555555555", orgId)
3157
+//	//获取所有耗材信息
3158
+//	list, _ := service.GetGoodInformationList(orgId)
3159
+//	fmt.Println("list22222", list)
3160
+//	//获取单位
3161
+//	miConfig, _ := service.FindMedicalInsuranceInfo(orgId)
3162
+//	var doctor_name string
3163
+//	var doctor_code string
3164
+//
3165
+//	doctor_name = "黄亦轩"
3166
+//	doctor_code = "1001"
3167
+//
3168
+//	var isSuccess bool = true
3169
+//	for _, item := range list {
3170
+//		fmt.Println("生产厂商", item.ManufacturerName)
3171
+//		detail := &models.XtGoodInformation{
3172
+//			GoodName:                    item.GoodName,
3173
+//			SocialSecurityDirectoryCode: item.SocialSecurityDirectoryCode,
3174
+//			ManufacturerName:            item.ManufacturerName,
3175
+//			ProductionType:              item.ProductionType,
3176
+//			SpecialMedical:              item.SpecialMedical,
3177
+//			BuyPrice:                    item.BuyPrice,
3178
+//			SellPrice:                   item.SellPrice,
3179
+//			Remark:                      item.Remark,
3180
+//		}
3181
+//
3182
+//		result := service.SzybYML007(doctor_name, doctor_code, miConfig.Code, detail)
3183
+//		fmt.Println("reuslt8888", result)
3184
+//		var dat map[string]interface{}
3185
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
3186
+//			fmt.Println(dat)
3187
+//		} else {
3188
+//			fmt.Println(err)
3189
+//		}
3190
+//
3191
+//		userJSONBytes, _ := json.Marshal(dat)
3192
+//
3193
+//		var res Result
3194
+//		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3195
+//			utils.ErrorLog("解析失败:%v", err)
3196
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3197
+//			return
3198
+//		}
3199
+//		if res.Transreturncode == "00000000" {
3200
+//
3201
+//			//备案成功返回状态
3202
+//			_, err := service.UpdateGoodInformaitonByDetail(item.ID)
3203
+//			fmt.Println("err2222222", err)
3204
+//		} else {
3205
+//			isSuccess = false
3206
+//			//失败
3207
+//
3208
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
3209
+//			return
3210
+//		}
3211
+//		fmt.Println(isSuccess)
3212
+//	}
3213
+//}
3214
+
2931 3215
 //func (c *SZHisApiController) GetGoodsList() {
2932 3216
 //
2933 3217
 //	adminUserInfo := c.GetAdminUserInfo()

BIN
gdyb Ver fichero


+ 22 - 23
models/dialysis.go Ver fichero

@@ -869,29 +869,27 @@ func (GobalTemplate) TableName() string {
869 869
 }
870 870
 
871 871
 type SgjUserAdminRole struct {
872
-	ID            int64  `gorm:"column:id" json:"id" form:"id"`
873
-	AdminUserId   int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
874
-	OrgId         int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
875
-	AppId         int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
876
-	RoleId        int64  `gorm:"column:role_id" json:"role_id" form:"role_id"`
877
-	UserName      string `gorm:"column:user_name" json:"user_name" form:"user_name"`
878
-	Avatar        string `gorm:"column:avatar" json:"avatar" form:"avatar"`
879
-	UserType      int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
880
-	UserTitle     int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
881
-	Intro         string `gorm:"column:intro" json:"intro" form:"intro"`
882
-	Status        int64  `gorm:"column:status" json:"status" form:"status"`
883
-	Ctime         int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
884
-	Mtime         int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
885
-	Message       string `gorm:"column:message" json:"message" form:"message"`
886
-	Sex           int64  `gorm:"column:sex" json:"sex" form:"sex"`
887
-	Birthday      int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
888
-	UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
889
-	RoleIds       string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
890
-	OrgName       string `gorm:"column:org_name" json:"org_name" form:"org_name"`
891
-	OrgLogo       string `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
892
-	Creator       int64  `gorm:"column:creator" json:"creator" form:"creator"`
893
-	Name          string
894
-
872
+	ID                                      int64  `gorm:"column:id" json:"id" form:"id"`
873
+	AdminUserId                             int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
874
+	OrgId                                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
875
+	AppId                                   int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
876
+	RoleId                                  int64  `gorm:"column:role_id" json:"role_id" form:"role_id"`
877
+	UserName                                string `gorm:"column:user_name" json:"user_name" form:"user_name"`
878
+	Avatar                                  string `gorm:"column:avatar" json:"avatar" form:"avatar"`
879
+	UserType                                int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
880
+	UserTitle                               int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
881
+	Intro                                   string `gorm:"column:intro" json:"intro" form:"intro"`
882
+	Status                                  int64  `gorm:"column:status" json:"status" form:"status"`
883
+	Ctime                                   int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
884
+	Mtime                                   int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
885
+	Message                                 string `gorm:"column:message" json:"message" form:"message"`
886
+	Sex                                     int64  `gorm:"column:sex" json:"sex" form:"sex"`
887
+	Birthday                                int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
888
+	UserTitleName                           string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
889
+	RoleIds                                 string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
890
+	OrgName                                 string `gorm:"column:org_name" json:"org_name" form:"org_name"`
891
+	OrgLogo                                 string `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
892
+	Creator                                 int64  `gorm:"column:creator" json:"creator" form:"creator"`
895 893
 	Age                                     int64  `gorm:"column:age" json:"age" form:"age"`
896 894
 	Nation                                  string `gorm:"column:nation" json:"nation" form:"nation"`
897 895
 	CardType                                int64  `gorm:"column:card_type" json:"card_type" form:"card_type"`
@@ -919,6 +917,7 @@ type SgjUserAdminRole struct {
919 917
 	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
920 918
 	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
921 919
 	Mobile                                  string
920
+	Name                                    string
922 921
 }
923 922
 
924 923
 //func (SgjUserAdminRole) TableName() string {

+ 112 - 0
models/his_models.go Ver fichero

@@ -1085,8 +1085,120 @@ type MyHisProject struct {
1085 1085
 	NumberDays                string  `gorm:"column:number_days" json:"number_days" form:"number_days"`
1086 1086
 	Total                     string  `gorm:"column:total" json:"total" form:"total"`
1087 1087
 	Category                  int64   `gorm:"column:category" json:"category" form:"category"`
1088
+	IsMark                    int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1088 1089
 }
1089 1090
 
1090 1091
 func (MyHisProject) TableName() string {
1091 1092
 	return "xt_his_project"
1092 1093
 }
1094
+
1095
+type MyGoodInformation struct {
1096
+	ID                          int64   `gorm:"column:id" json:"id" form:"id"`
1097
+	GoodCode                    string  `gorm:"column:good_code" json:"good_code" form:"good_code"`
1098
+	SpecificationName           string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
1099
+	GoodTypeId                  int64   `gorm:"column:good_type_id" json:"good_type_id" form:"good_type_id"`
1100
+	GoodUnit                    int64   `gorm:"column:good_unit" json:"good_unit" form:"good_unit"`
1101
+	BuyPrice                    float64 `gorm:"column:buy_price" json:"buy_price" form:"buy_price"`
1102
+	SellPrice                   float64 `gorm:"column:sell_price" json:"sell_price" form:"sell_price"`
1103
+	Remark                      string  `gorm:"column:remark" json:"remark" form:"remark"`
1104
+	Ctime                       int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1105
+	Mtime                       int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1106
+	Manufacturer                int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1107
+	Dealer                      int64   `gorm:"column:dealer" json:"dealer" form:"dealer"`
1108
+	ExpiryDateWarnDayCount      int64   `gorm:"column:expiry_date_warn_day_count" json:"expiry_date_warn_day_count" form:"expiry_date_warn_day_count"`
1109
+	StockWarnCount              int64   `gorm:"column:stock_warn_count" json:"stock_warn_count" form:"stock_warn_count"`
1110
+	IsReuse                     int64   `gorm:"column:is_reuse" json:"is_reuse" form:"is_reuse"`
1111
+	Status                      int64   `gorm:"column:status" json:"status" form:"status"`
1112
+	FilmArea                    string  `gorm:"column:film_area" json:"film_area" form:"film_area"`
1113
+	IsUse                       int64   `gorm:"column:is_use" json:"is_use" form:"is_use"`
1114
+	FilmMaterialQuality         string  `gorm:"column:film_material_quality" json:"film_material_quality" form:"film_material_quality"`
1115
+	OrgId                       int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
1116
+	Modifier                    int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
1117
+	Creater                     int64   `gorm:"column:creater" json:"creater" form:"creater"`
1118
+	GoodName                    string  `gorm:"column:good_name" json:"good_name" form:"good_name"`
1119
+	Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1120
+	Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
1121
+	GoodKind                    int64   `gorm:"column:good_kind" json:"good_kind" form:"good_kind"`
1122
+	MedicalInsuranceLevel       int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
1123
+	RetailPrice                 float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
1124
+	MedicalInsuranceNumber      string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
1125
+	IsSpecialDiseases           int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
1126
+	IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
1127
+	StatisticsCategory          int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
1128
+	GoodStatus                  string  `gorm:"column:good_status" json:"good_status" form:"good_status"`
1129
+	DefaultCount                int64   `gorm:"column:default_count" json:"default_count" form:"default_count"`
1130
+	Sign                        int64   `gorm:"column:sign" json:"sign" form:"sign"`
1131
+	IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
1132
+	IsChargeUse                 int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
1133
+	IsChargePredict             int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
1134
+	IsStatisticsWork            int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
1135
+	Sort                        int64   `gorm:"column:sort" json:"sort" form:"sort"`
1136
+	IsDoctorUse                 int64   `gorm:"column:is_doctor_use" json:"is_doctor_use" form:"is_doctor_use"`
1137
+	Agent                       string  `gorm:"column:agent" json:"agent" form:"agent"`
1138
+	GoodNumber                  string  `gorm:"column:good_number" json:"good_number" form:"good_number"`
1139
+	CommdityCode                string  `gorm:"column:commdity_code" json:"commdity_code" form:"commdity_code"`
1140
+	SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
1141
+	ProductionType              string  `gorm:"column:production_type" json:"production_type" form:"production_type"`
1142
+	SpecialMedical              string  `gorm:"column:special_medical" json:"special_medical" form:"special_medical"`
1143
+	IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1144
+}
1145
+
1146
+func (MyGoodInformation) TableName() string {
1147
+	return "xt_good_information"
1148
+}
1149
+
1150
+type MySgjUserAdminRole struct {
1151
+	ID                                      int64  `gorm:"column:id" json:"id" form:"id"`
1152
+	AdminUserId                             int64  `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
1153
+	OrgId                                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
1154
+	AppId                                   int64  `gorm:"column:app_id" json:"app_id" form:"app_id"`
1155
+	RoleId                                  int64  `gorm:"column:role_id" json:"role_id" form:"role_id"`
1156
+	UserName                                string `gorm:"column:user_name" json:"user_name" form:"user_name"`
1157
+	Avatar                                  string `gorm:"column:avatar" json:"avatar" form:"avatar"`
1158
+	UserType                                int64  `gorm:"column:user_type" json:"user_type" form:"user_type"`
1159
+	UserTitle                               int64  `gorm:"column:user_title" json:"user_title" form:"user_title"`
1160
+	Intro                                   string `gorm:"column:intro" json:"intro" form:"intro"`
1161
+	Status                                  int64  `gorm:"column:status" json:"status" form:"status"`
1162
+	Ctime                                   int64  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1163
+	Mtime                                   int64  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1164
+	UserTitleName                           string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
1165
+	RoleIds                                 string `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
1166
+	Message                                 string `gorm:"column:message" json:"message" form:"message"`
1167
+	Sex                                     int64  `gorm:"column:sex" json:"sex" form:"sex"`
1168
+	Birthday                                int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
1169
+	Sort                                    int64  `gorm:"column:sort" json:"sort" form:"sort"`
1170
+	IsSort                                  int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
1171
+	Department                              string `gorm:"column:department" json:"department" form:"department"`
1172
+	DepartmentId                            int64  `gorm:"column:department_id" json:"department_id" form:"department_id"`
1173
+	Age                                     int64  `gorm:"column:age" json:"age" form:"age"`
1174
+	Nation                                  string `gorm:"column:nation" json:"nation" form:"nation"`
1175
+	CardType                                int64  `gorm:"column:card_type" json:"card_type" form:"card_type"`
1176
+	IdCard                                  string `gorm:"column:id_card" json:"id_card" form:"id_card"`
1177
+	Education                               int64  `gorm:"column:education" json:"education" form:"education"`
1178
+	StudyMajorName                          string `gorm:"column:study_major_name" json:"study_major_name" form:"study_major_name"`
1179
+	WorkMajorName                           string `gorm:"column:work_major_name" json:"work_major_name" form:"work_major_name"`
1180
+	RoleType                                int64  `gorm:"column:role_type" json:"role_type" form:"role_type"`
1181
+	MedicalCode                             string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
1182
+	DoctorCode                              string `gorm:"column:doctor_code" json:"doctor_code" form:"doctor_code"`
1183
+	Licensing                               int64  `gorm:"column:licensing" json:"licensing" form:"licensing"`
1184
+	JobNumber                               string `gorm:"column:job_number" json:"job_number" form:"job_number"`
1185
+	PrescriptionQualificationIdentification int64  `gorm:"column:prescription_qualification_identification" json:"prescription_qualification_identification" form:"prescription_qualification_identification"`
1186
+	IdentificationOutpatients               int64  `gorm:"column:identification_outpatients" json:"identification_outpatients" form:"identification_outpatients"`
1187
+	StartTime                               int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
1188
+	MedicalRangeCode                        int64  `gorm:"column:medical_range_code" json:"medical_range_code" form:"medical_range_code"`
1189
+	MedicalLevel                            int64  `gorm:"column:medical_level" json:"medical_level" form:"medical_level"`
1190
+	MedicalTypeJob                          int64  `gorm:"column:medical_type_job" json:"medical_type_job" form:"medical_type_job"`
1191
+	PharmacistRegistrationNumber            string `gorm:"column:pharmacist_registration_number" json:"pharmacist_registration_number" form:"pharmacist_registration_number"`
1192
+	DoctorRangeCode                         int64  `gorm:"column:doctor_range_code" json:"doctor_range_code" form:"doctor_range_code"`
1193
+	DoctorLevel                             int64  `gorm:"column:doctor_level" json:"doctor_level" form:"doctor_level"`
1194
+	DoctorTypeJob                           int64  `gorm:"column:doctor_type_job" json:"doctor_type_job" form:"doctor_type_job"`
1195
+	DoctorNumber                            string `gorm:"column:doctor_number" json:"doctor_number" form:"doctor_number"`
1196
+	OutpatientIllnessCategory               string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
1197
+	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
1198
+	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
1199
+	IsMark                                  int64  `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1200
+}
1201
+
1202
+func (MySgjUserAdminRole) TableName() string {
1203
+	return "sgj_user_admin_role"
1204
+}

+ 8 - 8
models/sz_his_models.go Ver fichero

@@ -40,19 +40,19 @@ type DocDetail struct {
40 40
 	CardType                                string //证件类型
41 41
 	IdCard                                  string //证件号码
42 42
 	Phone                                   string //联系电话
43
-	WorkMajorName                           string // 从事专业名称
43
+	WorkMajorName                           string // 从事专业名称
44 44
 	Nation                                  string //民族
45 45
 	BirthDay                                int64  // 出生日期
46 46
 	WorkTime                                int64  //参加工作日期
47 47
 	Education                               string //学历
48
-	StudyMajorName                          string //所学专业名称
49
-	CertificateCode                         string //证书编码
50
-	MedicalCode                             string //医师资格编码
48
+	StudyMajorName                          string //所学专业名称
49
+	CertificateCode                         string //bkc323	医(药)师执业证书编码
50
+	MedicalCode                             string //医(药)师资格编码
51 51
 	MedicalRangeCode                        string //医师执业范围代码
52
-	MedicalLevel                            string //医生级别
53
-	TypeJob                                 string //业类别
54
-	DoctorNumber                            string //医师编号
55
-	Licensing                               string //业标志
52
+	MedicalLevel                            string //医生执业资格证中的医师级别
53
+	TypeJob                                 string //医生执业资格证中的执业类别
54
+	DoctorNumber                            string //医保医师编号
55
+	Licensing                               string //多点执业标志
56 56
 	DoctorServiceStatus                     string //医师医保服务资格状态
57 57
 	MonitoringLevel                         string //监控等级
58 58
 	DrugPsychotropicSubstances              string //毒麻精神药品资格

+ 5 - 4
routers/router.go Ver fichero

@@ -1,7 +1,8 @@
1 1
 package routers
2 2
 
3 3
 import (
4
-	"gdyb/controllers/sg"
4
+	"gdyb/controllers/sz"
5
+
5 6
 	//"gdyb/controllers/sz"
6 7
 	//"gdyb/controllers/sz"
7 8
 	//admin_api "XT_New/controllers/admin_api_controllers"
@@ -20,8 +21,8 @@ func init() {
20 21
 		AllowCredentials: true,
21 22
 	}))
22 23
 
23
-	sg.HisManagerApiRegistRouters()
24
-	sg.GdybRegistRouters()
25
-	//sz.SZHisManagerApiRegistRouters()
24
+	//sg.HisManagerApiRegistRouters()
25
+	//sg.GdybRegistRouters()
26
+	sz.SZHisManagerApiRegistRouters()
26 27
 
27 28
 }

+ 14 - 0
service/his_project_service.go Ver fichero

@@ -716,3 +716,17 @@ func GetBatchDrugList(idss []int64) (drug []*models.BaseDrugList, err error) {
716 716
 
717 717
 	return drug, err
718 718
 }
719
+
720
+func GetBatchGoodInformationList(idss []int64) (good []*models.GoodInformation, err error) {
721
+
722
+	db := XTReadDB().Table("xt_good_information as x").Where("x.status=1")
723
+	table := XTReadDB().Table("xt_manufacturer as m")
724
+	fmt.Println(table)
725
+	if len(idss) == 1 {
726
+		db = db.Where("x.id = ?", idss[0])
727
+	} else {
728
+		db = db.Where("x.id IN(?)", idss)
729
+	}
730
+	err = db.Select("x.id,x.social_security_directory_code,x.good_name,x.specification_name,x.production_type,x.special_medical,x.good_unit,x.buy_price,x.sell_price,x.remark,m.manufacturer_name").Joins("left join xt_manufacturer as m on m.id = x.manufacturer").Scan(&good).Error
731
+	return good, err
732
+}

+ 27 - 1
service/his_service.go Ver fichero

@@ -1045,7 +1045,7 @@ func GetGoodListByDetail(orgid int64, id int64) (good []*models.GoodInformation,
1045 1045
 
1046 1046
 func GetDoctorListByDetail(orgid int64, id int64) (role []*models.SgjUserAdminRole, err error) {
1047 1047
 
1048
-	err = UserReadDB().Model(&role).Where("org_id = ? and status = 1 and id = ? and user_type = 2", orgid, id).Find(&role).Error
1048
+	err = UserReadDB().Model(&role).Where("org_id = ? and status = 1 and admin_user_id = ? and user_type = 2", orgid, id).Scan(&role).Error
1049 1049
 	return role, err
1050 1050
 }
1051 1051
 
@@ -1059,3 +1059,29 @@ func GetMyPorjecgListDetail(orgid int64, id int64) (project []*models.MyHisProje
1059 1059
 	err = XTReadDB().Model(&project).Where("user_org_id = ? and status = 1 and id = ?", orgid, id).Find(&project).Error
1060 1060
 	return project, err
1061 1061
 }
1062
+
1063
+func GetBathchMyPorjecgList(idss []int64) (project []*models.MyHisProject, err error) {
1064
+	db := XTReadDB().Table("xt_his_project")
1065
+	if len(idss) == 1 {
1066
+		err = db.Where("status = 1 and id = ?", idss[0]).Find(&project).Error
1067
+	} else {
1068
+		err = db.Where("status = 1 and id IN(?)", idss).Find(&project).Error
1069
+	}
1070
+
1071
+	return project, err
1072
+}
1073
+
1074
+func GetBatchDoctorList(idss []int64) (role []*models.SgjUserAdminRole, err error) {
1075
+
1076
+	db := UserReadDB().Table("sgj_user_admin_role as x").Where("x.status =1")
1077
+	table := UserReadDB().Table("sgj_user_admin as a")
1078
+	fmt.Println(table)
1079
+	if len(idss) == 1 {
1080
+		db = db.Where("x.status = 1 and x.admin_user_id = ?", idss[0])
1081
+	} else {
1082
+		db = db.Where("x.status = 1 and x.admin_user_id IN(?)", idss)
1083
+	}
1084
+	err = db.Select("x.age,x.id,x.admin_user_id,x.org_id,x.app_id,x.role_id,x.user_name,x.avatar,x.user_type,x.user_title,x.intro,x.user_title_name,x.role_ids,x.message,x.sex,x.birthday,x.sort,x.is_sort,x.department,x.department_id,x.nation,x.card_type,x.id_card,x.education,x.study_major_name,x.work_major_name,x.role_type,x.medical_code,x.doctor_code,x.licensing,x.job_number,x.prescription_qualification_identification,x.identification_outpatients,x.start_time,x.medical_range_code,x.medical_level,x.medical_type_job,x.pharmacist_registration_number,x.doctor_range_code,x.doctor_level,x.doctor_type_job,x.doctor_number,x.outpatient_illness_category,x.is_active,x.active_status,a.mobile").Joins("left join sgj_user_admin as a on a.id = x.admin_user_id").Scan(&role).Error
1085
+	return role, err
1086
+
1087
+}

+ 164 - 72
service/sz_his_service.go Ver fichero

@@ -607,6 +607,7 @@ func SzybML008(doctor string, doctor_code string, fixmedins_code string, basedru
607 607
 	inputData := make(map[string]interface{})
608 608
 	inputMessage["transType"] = "JY003" // 交易编码
609 609
 
610
+	inputData["listsize"] = 1
610 611
 	inputMessage["transType"] = "ML008" // 交易编码S
611 612
 	feedetail := make([]map[string]interface{}, 0)
612 613
 	feedetailInfo := make(map[string]interface{})
@@ -707,7 +708,7 @@ func SzybML009(doctor string, doctor_code string, fixmedins_code string, pro *mo
707 708
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
708 709
 
709 710
 	inputData := make(map[string]interface{})
710
-
711
+	inputData["listsize"] = 1
711 712
 	inputMessage["transType"] = "ML009" // 交易编码
712 713
 	feedetail := make([]map[string]interface{}, 0)
713 714
 
@@ -835,8 +836,8 @@ func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas [
835 836
 	for _, item := range datas {
836 837
 		feedetailInfo := make(map[string]interface{})
837 838
 		feedetailInfo["ake003"] = strconv.FormatInt(typeId, 10)
838
-		feedetailInfo["ake001"] = item.MedicalInsuranceNumber //社保目录编码
839
-		feedetailInfo["ake005"] = item.MedicalInsuranceNumber //协议机构内部目录编码
839
+		feedetailInfo["ake001"] = item.SocialSecurityDirectoryCode //社保目录编码
840
+		feedetailInfo["ake005"] = item.SocialSecurityDirectoryCode //协议机构内部目录编码
840 841
 		feedetail = append(feedetail, feedetailInfo)
841 842
 	}
842 843
 
@@ -878,58 +879,55 @@ func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas [
878 879
 
879 880
 }
880 881
 
881
-func SzybYS001(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
882
+func SzybYS001(doctor string, doctor_code string, fixmedins_code string, doc *models.DocDetail) string {
882 883
 	//生成输入报文
883 884
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
884 885
 
885 886
 	inputData := make(map[string]interface{})
886 887
 
887
-	inputData["listsize"] = len(datas)
888
+	inputData["listsize"] = 1
888 889
 	inputMessage["transType"] = "YS001" // 交易编码
889 890
 	feedetail := make([]map[string]interface{}, 0)
890 891
 
891
-	for _, item := range datas {
892
-		fmt.Println("item222222", item.RoleId)
893
-		feedetailInfo := make(map[string]interface{})
894
-		feedetailInfo["aac003"] = item.UserName
895
-		feedetailInfo["bka633"] = "1"
896
-		feedetailInfo["aac004"] = item.Sex
897
-		feedetailInfo["aac058"] = item.CardType
898
-		feedetailInfo["aac147"] = item.IdCard
899
-		feedetailInfo["aae005"] = item.Phone
900
-		feedetailInfo["bkc322"] = item.WorkMajorName
901
-		feedetailInfo["aac005"] = item.Nation
902
-		feedetailInfo["aac006"] = item.BirthDay
903
-		feedetailInfo["aac007"] = item.WorkTime
904
-		feedetailInfo["aac011"] = item.Education
905
-		feedetailInfo["aac183"] = item.StudyMajorName
906
-		feedetailInfo["bkc323"] = item.CertificateCode
907
-		feedetailInfo["bke955"] = item.MedicalCode
908
-		feedetailInfo["akc055"] = item.MedicalRangeCode
909
-		feedetailInfo["bcc950"] = item.MedicalLevel
910
-		feedetailInfo["bcc955"] = item.TypeJob
911
-		feedetailInfo["bka503"] = item.DoctorNumber
912
-		feedetailInfo["bkc324"] = item.Licensing
913
-		feedetailInfo["bkc326"] = item.DoctorServiceStatus
914
-		feedetailInfo["bkc328"] = item.MonitoringLevel
915
-		feedetailInfo["bkc329"] = item.DrugPsychotropicSubstances
916
-		feedetailInfo["bke801"] = item.HealthCareCode
917
-		feedetailInfo["bkc330"] = item.PlanningTechnicalServiceCode
918
-		feedetailInfo["bkc332"] = item.PharmacistType
919
-		feedetailInfo["bkc333"] = item.PharmacistPracticeCategory
920
-		feedetailInfo["bkc334"] = item.PharmacistsLicensing
921
-		feedetailInfo["bkc335"] = item.PharmacistRegistrationNumber
922
-		feedetailInfo["akf001"] = item.OfficeCode
923
-		feedetailInfo["acc501"] = item.JobNumber
924
-		feedetailInfo["ahc451"] = item.PostName
925
-		feedetailInfo["aaf009"] = item.TechnicalJobLevelCode
926
-		feedetailInfo["bkc321"] = item.IsActive
927
-		feedetailInfo["ckc302"] = item.PrescriptionQualificationIdentification
928
-		feedetailInfo["bkc325"] = item.IdentificationOutpatients
929
-		feedetailInfo["ckc304"] = item.OutpatientIllnessCategory
930
-		feedetailInfo["aae030"] = item.StartTime
931
-		feedetail = append(feedetail, feedetailInfo)
932
-	}
892
+	feedetailInfo := make(map[string]interface{})
893
+	feedetailInfo["aac003"] = doc.UserName                                //医护人员姓名
894
+	feedetailInfo["bka633"] = "1"                                         //医护人员类别
895
+	feedetailInfo["aac004"] = doc.Sex                                     //性别
896
+	feedetailInfo["aac058"] = doc.CardType                                //证件类型
897
+	feedetailInfo["aac147"] = doc.IdCard                                  //证件号码
898
+	feedetailInfo["aae005"] = doc.Phone                                   //联系电话
899
+	feedetailInfo["bkc322"] = doc.WorkMajorName                           //现从事专业名称
900
+	feedetailInfo["aac005"] = doc.Nation                                  //民族
901
+	feedetailInfo["aac006"] = doc.BirthDay                                //出生日期
902
+	feedetailInfo["aac007"] = doc.WorkTime                                //参加工作日期
903
+	feedetailInfo["aac011"] = doc.Education                               //学历
904
+	feedetailInfo["aac183"] = doc.StudyMajorName                          //所学的专业名称
905
+	feedetailInfo["bkc323"] = doc.CertificateCode                         //医(药)师执业证书编码
906
+	feedetailInfo["bke955"] = doc.MedicalCode                             //医(药)师资格证编码
907
+	feedetailInfo["akc055"] = doc.MedicalRangeCode                        //	医师执业范围代码
908
+	feedetailInfo["bcc950"] = doc.MedicalLevel                            //医生执业资格证中的医师级别
909
+	feedetailInfo["bcc955"] = doc.TypeJob                                 //医生执业资格证中的执业类别
910
+	feedetailInfo["bka503"] = doc.DoctorNumber                            //医保医师编号
911
+	feedetailInfo["bkc324"] = doc.Licensing                               //多点执业标志
912
+	feedetailInfo["bkc326"] = doc.DoctorServiceStatus                     //医师医保服务资格状态
913
+	feedetailInfo["bkc328"] = doc.MonitoringLevel                         //监控等级
914
+	feedetailInfo["bkc329"] = doc.DrugPsychotropicSubstances              //毒麻精神药品资格
915
+	feedetailInfo["bke801"] = doc.HealthCareCode                          //母婴保健技术考核合格证书编号
916
+	feedetailInfo["bkc330"] = doc.PlanningTechnicalServiceCode            //bkc330	计划生育技术服务人员合格证编号
917
+	feedetailInfo["bkc332"] = doc.PharmacistType                          //药师类别
918
+	feedetailInfo["bkc333"] = doc.PharmacistPracticeCategory              //药师执业类别
919
+	feedetailInfo["bkc334"] = doc.PharmacistsLicensing                    //药师执业范围
920
+	feedetailInfo["bkc335"] = doc.PharmacistRegistrationNumber            //执业药师注册证编号
921
+	feedetailInfo["akf001"] = doc.OfficeCode                              //所属科室编码
922
+	feedetailInfo["acc501"] = doc.JobNumber                               //工号
923
+	feedetailInfo["ahc451"] = doc.PostName                                //职务名称
924
+	feedetailInfo["aaf009"] = doc.TechnicalJobLevelCode                   //专业技术职务级别编码
925
+	feedetailInfo["bkc321"] = doc.IsActive                                //在职与否
926
+	feedetailInfo["ckc302"] = doc.PrescriptionQualificationIdentification //处方资格标识
927
+	feedetailInfo["bkc325"] = doc.IdentificationOutpatients               //门诊大病医师 标识
928
+	feedetailInfo["ckc304"] = doc.OutpatientIllnessCategory               //门诊大病类别
929
+	feedetailInfo["aae030"] = doc.StartTime                               //开始日期
930
+	feedetail = append(feedetail, feedetailInfo)
933 931
 
934 932
 	inputData["inputlist"] = feedetail
935 933
 	inputMessage["transBody"] = inputData
@@ -969,24 +967,112 @@ func SzybYS001(doctor string, doctor_code string, fixmedins_code string, datas [
969 967
 
970 968
 }
971 969
 
972
-func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
970
+//func SzybYS001(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
971
+//	//生成输入报文
972
+//	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
973
+//
974
+//	inputData := make(map[string]interface{})
975
+//
976
+//	inputData["listsize"] = len(datas)
977
+//	inputMessage["transType"] = "YS001" // 交易编码
978
+//	feedetail := make([]map[string]interface{}, 0)
979
+//
980
+//	for _, item := range datas {
981
+//		fmt.Println("item222222", item.RoleId)
982
+//		feedetailInfo := make(map[string]interface{})
983
+//		feedetailInfo["aac003"] = item.UserName
984
+//		feedetailInfo["bka633"] = "1"
985
+//		feedetailInfo["aac004"] = item.Sex
986
+//		feedetailInfo["aac058"] = item.CardType
987
+//		feedetailInfo["aac147"] = item.IdCard
988
+//		feedetailInfo["aae005"] = item.Phone
989
+//		feedetailInfo["bkc322"] = item.WorkMajorName
990
+//		feedetailInfo["aac005"] = item.Nation
991
+//		feedetailInfo["aac006"] = item.BirthDay
992
+//		feedetailInfo["aac007"] = item.WorkTime
993
+//		feedetailInfo["aac011"] = item.Education
994
+//		feedetailInfo["aac183"] = item.StudyMajorName
995
+//		feedetailInfo["bkc323"] = item.CertificateCode
996
+//		feedetailInfo["bke955"] = item.MedicalCode
997
+//		feedetailInfo["akc055"] = item.MedicalRangeCode
998
+//		feedetailInfo["bcc950"] = item.MedicalLevel
999
+//		feedetailInfo["bcc955"] = item.TypeJob
1000
+//		feedetailInfo["bka503"] = item.DoctorNumber
1001
+//		feedetailInfo["bkc324"] = item.Licensing
1002
+//		feedetailInfo["bkc326"] = item.DoctorServiceStatus
1003
+//		feedetailInfo["bkc328"] = item.MonitoringLevel
1004
+//		feedetailInfo["bkc329"] = item.DrugPsychotropicSubstances
1005
+//		feedetailInfo["bke801"] = item.HealthCareCode
1006
+//		feedetailInfo["bkc330"] = item.PlanningTechnicalServiceCode
1007
+//		feedetailInfo["bkc332"] = item.PharmacistType
1008
+//		feedetailInfo["bkc333"] = item.PharmacistPracticeCategory
1009
+//		feedetailInfo["bkc334"] = item.PharmacistsLicensing
1010
+//		feedetailInfo["bkc335"] = item.PharmacistRegistrationNumber
1011
+//		feedetailInfo["akf001"] = item.OfficeCode
1012
+//		feedetailInfo["acc501"] = item.JobNumber
1013
+//		feedetailInfo["ahc451"] = item.PostName
1014
+//		feedetailInfo["aaf009"] = item.TechnicalJobLevelCode
1015
+//		feedetailInfo["bkc321"] = item.IsActive
1016
+//		feedetailInfo["ckc302"] = item.PrescriptionQualificationIdentification
1017
+//		feedetailInfo["bkc325"] = item.IdentificationOutpatients
1018
+//		feedetailInfo["ckc304"] = item.OutpatientIllnessCategory
1019
+//		feedetailInfo["aae030"] = item.StartTime
1020
+//		feedetail = append(feedetail, feedetailInfo)
1021
+//	}
1022
+//
1023
+//	inputData["inputlist"] = feedetail
1024
+//	inputMessage["transBody"] = inputData
1025
+//
1026
+//	bytesData, err := json.Marshal(inputMessage)
1027
+//	fmt.Println(string(bytesData))
1028
+//	if err != nil {
1029
+//		fmt.Println(err.Error())
1030
+//		return err.Error()
1031
+//	}
1032
+//	reader := bytes.NewReader(bytesData)
1033
+//	//url := "http://192.168.1.99:10000"
1034
+//	url := "http://192.168.1.228:17001/szsi-portal/transData"
1035
+//
1036
+//	request, err := http.NewRequest("POST", url, reader)
1037
+//	if err != nil {
1038
+//		fmt.Println(err.Error())
1039
+//		return err.Error()
1040
+//	}
1041
+//
1042
+//	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1043
+//
1044
+//	client := http.Client{}
1045
+//	resp, err := client.Do(request)
1046
+//	if err != nil {
1047
+//		fmt.Println(err.Error())
1048
+//		return err.Error()
1049
+//	}
1050
+//	respBytes, err := ioutil.ReadAll(resp.Body)
1051
+//	if err != nil {
1052
+//		fmt.Println(err.Error())
1053
+//		return err.Error()
1054
+//	}
1055
+//	fmt.Println(string(respBytes))
1056
+//	str := string(respBytes)
1057
+//	return str
1058
+//
1059
+//}
1060
+
1061
+func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas *models.DocDetail) string {
973 1062
 
974 1063
 	//生成输入报文
975 1064
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
976 1065
 
977 1066
 	inputData := make(map[string]interface{})
978 1067
 
979
-	inputData["listsize"] = len(datas)
1068
+	inputData["listsize"] = 1
980 1069
 	inputMessage["transType"] = "YS002" // 交易编码
981 1070
 	feedetail := make([]map[string]interface{}, 0)
982 1071
 
983
-	for _, item := range datas {
984
-		fmt.Println("item2222", item)
985
-		feedetailInfo := make(map[string]interface{})
986
-		feedetailInfo["bkc320"] = "H27224269"
987
-		feedetailInfo["bke155"] = "4"
988
-		feedetail = append(feedetail, feedetailInfo)
989
-	}
1072
+	feedetailInfo := make(map[string]interface{})
1073
+	feedetailInfo["bkc320"] = datas.DoctorNumber
1074
+	feedetailInfo["bke155"] = "4"
1075
+	feedetail = append(feedetail, feedetailInfo)
990 1076
 
991 1077
 	inputData["inputlist"] = feedetail
992 1078
 	inputMessage["transBody"] = inputData
@@ -1123,24 +1209,23 @@ func SzybYML007(doctor string, doctor_code string, fixmedins_code string, infor
1123 1209
 	inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
1124 1210
 
1125 1211
 	inputData := make(map[string]interface{})
1126
-
1212
+	inputData["listsize"] = 1
1127 1213
 	inputMessage["transType"] = "ML007" // 交易编码
1128 1214
 	feedetail := make([]map[string]interface{}, 0)
1129 1215
 
1130 1216
 	feedetailInfo := make(map[string]interface{})
1131 1217
 	feedetailInfo["ake001"] = infor.SocialSecurityDirectoryCode // 社保目录编码
1132
-	//feedetailInfo["ake001"] = "3333333333" // 社保目录编码
1218
+
1133 1219
 	feedetailInfo["ake005"] = infor.SocialSecurityDirectoryCode //协议机构内部目录编码
1134
-	//feedetailInfo["ake006"] = item.GoodName                    //医药机构内部目录名称
1135
-	feedetailInfo["ake006"] = "222222"                //医药机构内部目录名称
1136
-	feedetailInfo["bka053"] = infor.ManufacturerName  //生产厂家
1137
-	feedetailInfo["ake004"] = infor.ProductionType    //生产地类别
1138
-	feedetailInfo["ckf261"] = infor.SpecialMedical    //特殊医用材料标识
1139
-	feedetailInfo["aka067"] = "支"                     //计价单位
1140
-	feedetailInfo["aka074"] = infor.SpecificationName //规格
1141
-	feedetailInfo["bka505"] = infor.BuyPrice          //进货价
1142
-	feedetailInfo["bka506"] = infor.SellPrice         // 收获价
1143
-	feedetailInfo["aae013"] = infor.Remark            //备注
1220
+	feedetailInfo["ake006"] = infor.GoodName                    //医药机构内部目录名称
1221
+	feedetailInfo["bka053"] = infor.ManufacturerName            //生产厂家
1222
+	feedetailInfo["ake004"] = infor.ProductionType              //生产地类别
1223
+	feedetailInfo["ckf261"] = infor.SpecialMedical              //特殊医用材料标识
1224
+	feedetailInfo["aka067"] = "支"                               //计价单位
1225
+	feedetailInfo["aka074"] = infor.SpecificationName           //规格
1226
+	feedetailInfo["bka505"] = infor.BuyPrice                    //进货价
1227
+	feedetailInfo["bka506"] = infor.SellPrice                   // 收获价
1228
+	feedetailInfo["aae013"] = infor.Remark                      //备注
1144 1229
 	feedetail = append(feedetail, feedetailInfo)
1145 1230
 
1146 1231
 	inputData["inputlist"] = feedetail
@@ -1285,14 +1370,14 @@ func UpdateDrugByIdDetail(id int64) (models.XtBaseDrug, error) {
1285 1370
 	return drug, err
1286 1371
 }
1287 1372
 
1288
-func UpdateGoodInformaitonByDetail(id int64) (models.XtGoodInformation, error) {
1289
-	information := models.XtGoodInformation{}
1373
+func UpdateGoodInformaitonByDetail(id int64) (models.MyGoodInformation, error) {
1374
+	information := models.MyGoodInformation{}
1290 1375
 	err := XTWriteDB().Model(&information).Where("id=?", id).Updates(map[string]interface{}{"is_mark": 1}).Error
1291 1376
 	return information, err
1292 1377
 }
1293 1378
 
1294
-func UpdateGoodInfoById(id int64) (models.XtGoodInformation, error) {
1295
-	information := models.XtGoodInformation{}
1379
+func UpdateGoodInfoById(id int64) (models.MyGoodInformation, error) {
1380
+	information := models.MyGoodInformation{}
1296 1381
 	err := XTWriteDB().Model(&information).Where("id=?", id).Updates(map[string]interface{}{"is_mark": 0}).Error
1297 1382
 	return information, err
1298 1383
 }
@@ -1308,3 +1393,10 @@ func UpdateMyProjectById(id int64) (models.MyHisProject, error) {
1308 1393
 	err := XTWriteDB().Model(&project).Where("id = ?", id).Updates(map[string]interface{}{"is_mark": 0}).Error
1309 1394
 	return project, err
1310 1395
 }
1396
+
1397
+func UpdateAdminUserRoleById(id int64) (models.MySgjUserAdminRole, error) {
1398
+
1399
+	role := models.MySgjUserAdminRole{}
1400
+	err = UserWriteDB().Model(&role).Where("admin_user_id = ?", id).Updates(map[string]interface{}{"is_mark = ?": 1}).Error
1401
+	return role, err
1402
+}