|
@@ -1496,6 +1496,26 @@ func (this *NewDialysisApiController) GetAllDoctor() {
|
1496
|
1496
|
})
|
1497
|
1497
|
}
|
1498
|
1498
|
|
|
1499
|
+func (this *NewDialysisApiController) GetAllProjectName() {
|
|
1500
|
+ id := this.GetString("date")
|
|
1501
|
+ fmt.Println("id是", id)
|
|
1502
|
+ ids, _ := strconv.ParseInt(id, 10, 64)
|
|
1503
|
+ patientid := this.GetString("patientid")
|
|
1504
|
+ fmt.Println("patient", patientid)
|
|
1505
|
+ paientids, _ := strconv.ParseInt(patientid, 10, 64)
|
|
1506
|
+ patient, _ := service.GetNewPatient(paientids)
|
|
1507
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1508
|
+ projectName, err := service.GetAllProjectName(ids, orgid, patient.BloodId)
|
|
1509
|
+ fmt.Println("projectname----------------------------------", err)
|
|
1510
|
+ if err != nil {
|
|
1511
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1512
|
+ return
|
|
1513
|
+ }
|
|
1514
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1515
|
+ "projectName": projectName,
|
|
1516
|
+ })
|
|
1517
|
+}
|
|
1518
|
+
|
1499
|
1519
|
func (this *NewDialysisApiController) GetAllInspection() {
|
1500
|
1520
|
|
1501
|
1521
|
//查询该机构是否存在检验检测项目
|
|
@@ -1701,10 +1721,11 @@ func (this *NewDialysisApiController) SaveMessage() {
|
1701
|
1721
|
fmt.Println("id", id)
|
1702
|
1722
|
message := this.GetString("message")
|
1703
|
1723
|
fmt.Println("message", message)
|
|
1724
|
+ orgid, _ := this.GetInt64("orgid")
|
1704
|
1725
|
role := models.SgjUserAdminRole{
|
1705
|
1726
|
Message: message,
|
1706
|
1727
|
}
|
1707
|
|
- err := service.SaveMessage(id, &role)
|
|
1728
|
+ err := service.SaveMessage(id, orgid, &role)
|
1708
|
1729
|
if err != nil {
|
1709
|
1730
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
1710
|
1731
|
return
|
|
@@ -1719,8 +1740,10 @@ func (this *NewDialysisApiController) SaveSex() {
|
1719
|
1740
|
fmt.Println("sex", sex)
|
1720
|
1741
|
id, _ := this.GetInt64("id")
|
1721
|
1742
|
fmt.Println("id", id)
|
|
1743
|
+ orgid, _ := this.GetInt64("orgid")
|
1722
|
1744
|
role := models.SgjUserAdminRole{
|
1723
|
|
- Sex: sex,
|
|
1745
|
+ Sex: sex,
|
|
1746
|
+ OrgId: orgid,
|
1724
|
1747
|
}
|
1725
|
1748
|
err := service.SaveSex(id, &role)
|
1726
|
1749
|
if err != nil {
|
|
@@ -1743,8 +1766,11 @@ func (this *NewDialysisApiController) SaveBirthday() {
|
1743
|
1766
|
timeLayout := "2006-01-02 15:04:05"
|
1744
|
1767
|
theTime, err := utils.ParseTimeStringToTime(timeLayout, birthday+" 00:00:00")
|
1745
|
1768
|
birth := theTime.Unix()
|
|
1769
|
+ orgid := dataBody["orgid"].(string)
|
|
1770
|
+ orgids, err := strconv.ParseInt(orgid, 10, 64)
|
1746
|
1771
|
role := models.SgjUserAdminRole{
|
1747
|
1772
|
Birthday: birth,
|
|
1773
|
+ OrgId: orgids,
|
1748
|
1774
|
}
|
1749
|
1775
|
err = service.SaveBirthday(ids, &role)
|
1750
|
1776
|
if err != nil {
|
|
@@ -2205,7 +2231,8 @@ func (this *NewDialysisApiController) EditOrg() {
|
2205
|
2231
|
|
2206
|
2232
|
func (this *NewDialysisApiController) GetMyInforName() {
|
2207
|
2233
|
id, _ := this.GetInt64("id")
|
2208
|
|
- Username, err := service.GetAdminName(id)
|
|
2234
|
+ orgid, _ := this.GetInt64("orgid")
|
|
2235
|
+ Username, err := service.GetAdminName(id, orgid)
|
2209
|
2236
|
if err != nil {
|
2210
|
2237
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
2211
|
2238
|
return
|
|
@@ -2217,10 +2244,16 @@ func (this *NewDialysisApiController) GetMyInforName() {
|
2217
|
2244
|
|
2218
|
2245
|
func (this *NewDialysisApiController) GetMyInformationFour() {
|
2219
|
2246
|
adminUserInfo := this.GetMobileAdminUserInfo()
|
2220
|
|
- creatId := adminUserInfo.AdminUser.Id
|
2221
|
|
- fmt.Println("创建者ID", creatId)
|
|
2247
|
+ //creatId := adminUserInfo.AdminUser.Id
|
|
2248
|
+ //fmt.Println("创建者ID", creatId)
|
2222
|
2249
|
orgid := adminUserInfo.Org.Id
|
|
2250
|
+ //跟剧机构ID获取创建者ID
|
2223
|
2251
|
fmt.Println("orgid", orgid)
|
|
2252
|
+ //OrgId, _ := service.GetCreatByOrgId(orgid)
|
|
2253
|
+ //fmt.Println("创建者ID", OrgId.Creator)
|
|
2254
|
+ creatId := adminUserInfo.AdminUser.Id
|
|
2255
|
+ fmt.Println("creatid", creatId)
|
|
2256
|
+ fmt.Println("当前机构ID信息", orgid)
|
2224
|
2257
|
Username, err := service.GetMyOrgInformationFour(creatId, orgid)
|
2225
|
2258
|
if err != nil {
|
2226
|
2259
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
@@ -2336,7 +2369,6 @@ func (this *NewDialysisApiController) GetMyOrgInformation() {
|
2336
|
2369
|
fmt.Println("cretor", creator)
|
2337
|
2370
|
adminInfo := this.GetMobileAdminUserInfo()
|
2338
|
2371
|
appId := adminInfo.App.Id
|
2339
|
|
- //fmt.Println("appid------------------------------------",appId)
|
2340
|
2372
|
information, err := service.GetMyOrgInformation(creator, appId)
|
2341
|
2373
|
if err != nil {
|
2342
|
2374
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
@@ -2350,11 +2382,12 @@ func (this *NewDialysisApiController) GetMyOrgInformation() {
|
2350
|
2382
|
func (this *NewDialysisApiController) SaveNameTwo() {
|
2351
|
2383
|
id, _ := this.GetInt64("id")
|
2352
|
2384
|
name := this.GetString("name")
|
2353
|
|
- fmt.Println("name------------------", name)
|
|
2385
|
+ orgid, _ := this.GetInt64("orgid")
|
2354
|
2386
|
role := models.SgjUserAdminRole{
|
2355
|
2387
|
UserName: name,
|
2356
|
2388
|
}
|
2357
|
|
- err := service.SaveNameTwo(id, &role)
|
|
2389
|
+ err := service.SaveNameTwo(id, orgid, &role)
|
|
2390
|
+ fmt.Println("err", err)
|
2358
|
2391
|
if err != nil {
|
2359
|
2392
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
2360
|
2393
|
return
|
|
@@ -2403,3 +2436,68 @@ func (this *NewDialysisApiController) GetMyMobile() {
|
2403
|
2436
|
"mobile": mobile,
|
2404
|
2437
|
})
|
2405
|
2438
|
}
|
|
2439
|
+
|
|
2440
|
+func (this *NewDialysisApiController) SumitForm() {
|
|
2441
|
+
|
|
2442
|
+ name := this.GetString("name")
|
|
2443
|
+ fmt.Println("姓名", name)
|
|
2444
|
+ mobile := this.GetString("mobile")
|
|
2445
|
+ fmt.Println("mobile", mobile)
|
|
2446
|
+ address := this.GetString("address")
|
|
2447
|
+ fmt.Println("address", address)
|
|
2448
|
+ positon := this.GetString("position")
|
|
2449
|
+ fmt.Println("职位", positon)
|
|
2450
|
+ hospitalName := this.GetString("hospitalName")
|
|
2451
|
+ fmt.Println("医院名称", hospitalName)
|
|
2452
|
+ systemName := this.GetString("systemName")
|
|
2453
|
+ fmt.Println("系统名称", systemName)
|
|
2454
|
+ isUser, _ := this.GetInt64("isUser")
|
|
2455
|
+ fmt.Println("是否使用", isUser)
|
|
2456
|
+ isThink, _ := this.GetInt64("isThink")
|
|
2457
|
+ fmt.Println("是否考虑", isThink)
|
|
2458
|
+ result := this.GetString("result")
|
|
2459
|
+ fmt.Println("result", result)
|
|
2460
|
+ otherRemark := this.GetString("otherRemark")
|
|
2461
|
+ fmt.Println("result", otherRemark)
|
|
2462
|
+ otherMessage := this.GetString("otherMessage")
|
|
2463
|
+ fmt.Println("otherMessage", otherMessage)
|
|
2464
|
+ gift, _ := this.GetInt64("gift")
|
|
2465
|
+ fmt.Println("gift", gift)
|
|
2466
|
+ admininfo := this.GetMobileAdminUserInfo()
|
|
2467
|
+ creator := admininfo.AdminUser.Id
|
|
2468
|
+ fmt.Println("创建者", creator)
|
|
2469
|
+ _, errcode := service.GetActivtyCreator(creator)
|
|
2470
|
+ if errcode == gorm.ErrRecordNotFound {
|
|
2471
|
+ table := models.KyActivityTable{
|
|
2472
|
+ Name: name,
|
|
2473
|
+ Phone: mobile,
|
|
2474
|
+ Address: address,
|
|
2475
|
+ Position: positon,
|
|
2476
|
+ HospitalName: hospitalName,
|
|
2477
|
+ SystemName: systemName,
|
|
2478
|
+ IsUser: isUser,
|
|
2479
|
+ IsThink: isThink,
|
|
2480
|
+ OtherMode: result,
|
|
2481
|
+ OtherRemark: otherRemark,
|
|
2482
|
+ OtherMessage: otherMessage,
|
|
2483
|
+ Gift: gift,
|
|
2484
|
+ AdminUserId: creator,
|
|
2485
|
+ Status: 1,
|
|
2486
|
+ Ctime: time.Now().Unix(),
|
|
2487
|
+ }
|
|
2488
|
+ err := service.CreateTable(&table)
|
|
2489
|
+ if err != nil {
|
|
2490
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2491
|
+ return
|
|
2492
|
+ }
|
|
2493
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2494
|
+ "table": table,
|
|
2495
|
+ })
|
|
2496
|
+ } else if errcode == nil {
|
|
2497
|
+ this.Data["json"] = enums.MakeFailResponseJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2498
|
+ this.ServeJSON()
|
|
2499
|
+ return
|
|
2500
|
+ } else {
|
|
2501
|
+ return
|
|
2502
|
+ }
|
|
2503
|
+}
|