|
@@ -1549,7 +1549,6 @@ func (this *NewDialysisApiController) GetMyInformation() {
|
1549
|
1549
|
adminUserInfo := this.GetMobileAdminUserInfo()
|
1550
|
1550
|
|
1551
|
1551
|
roleInfo := adminUserInfo.AppRole
|
1552
|
|
- fmt.Print("aa")
|
1553
|
1552
|
es, _ := service.GetAdminUserElectronicSignature(adminUserInfo.Org.Id, adminUserInfo.App.Id, adminUserInfo.AdminUser.Id)
|
1554
|
1553
|
|
1555
|
1554
|
this.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -1606,8 +1605,11 @@ func (this *NewDialysisApiController) SaveFeed() {
|
1606
|
1605
|
fmt.Print("phone", phone)
|
1607
|
1606
|
times, _ := this.GetInt64("time")
|
1608
|
1607
|
fmt.Print("time", times)
|
|
1608
|
+ adminuserid, _ := this.GetInt64("admin_user_id")
|
|
1609
|
+ fmt.Println("admin", adminuserid)
|
1609
|
1610
|
adminUser := this.GetMobileAdminUserInfo()
|
1610
|
1611
|
orgid := adminUser.Org.Id
|
|
1612
|
+ appid := adminUser.App.Id
|
1611
|
1613
|
feedback := models.XtPatientFeedback{
|
1612
|
1614
|
ProblemType: question,
|
1613
|
1615
|
Title: title,
|
|
@@ -1617,6 +1619,8 @@ func (this *NewDialysisApiController) SaveFeed() {
|
1617
|
1619
|
UserOrgId: orgid,
|
1618
|
1620
|
Ctime: time.Now().Unix(),
|
1619
|
1621
|
Status: 1,
|
|
1622
|
+ AdminUserId: adminuserid,
|
|
1623
|
+ AppId: appid,
|
1620
|
1624
|
}
|
1621
|
1625
|
err := service.CreateFeedBack(&feedback)
|
1622
|
1626
|
if err != nil {
|
|
@@ -1640,3 +1644,293 @@ func (this *NewDialysisApiController) DeleteInspection() {
|
1640
|
1644
|
this.ServeSuccessJSON(returnData)
|
1641
|
1645
|
return
|
1642
|
1646
|
}
|
|
1647
|
+
|
|
1648
|
+func (this *NewDialysisApiController) DeleteChildInspection() {
|
|
1649
|
+ admininfo := this.GetMobileAdminUserInfo()
|
|
1650
|
+ orgid := admininfo.Org.Id
|
|
1651
|
+ name := this.GetString("name")
|
|
1652
|
+ fmt.Println("name", name)
|
|
1653
|
+ date, _ := this.GetInt64("date")
|
|
1654
|
+ fmt.Println("date", date)
|
|
1655
|
+ err := service.DeleteChildInspection(name, date, orgid)
|
|
1656
|
+ fmt.Println("删除失败", err)
|
|
1657
|
+ returnData := make(map[string]interface{}, 0)
|
|
1658
|
+ returnData["msg"] = "手机号码已存在"
|
|
1659
|
+ this.ServeSuccessJSON(returnData)
|
|
1660
|
+ return
|
|
1661
|
+}
|
|
1662
|
+
|
|
1663
|
+func (this *NewDialysisApiController) SaveMessage() {
|
|
1664
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1665
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1666
|
+ id, _ := this.GetInt64("id")
|
|
1667
|
+ fmt.Println("id", id)
|
|
1668
|
+ message := this.GetString("message")
|
|
1669
|
+ fmt.Println("message", message)
|
|
1670
|
+ role := models.App_Role{
|
|
1671
|
+ Message: message,
|
|
1672
|
+ }
|
|
1673
|
+ err := service.SaveMessage(orgid, appid, id, &role)
|
|
1674
|
+ if err != nil {
|
|
1675
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1676
|
+ return
|
|
1677
|
+ }
|
|
1678
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1679
|
+ "role": role,
|
|
1680
|
+ })
|
|
1681
|
+}
|
|
1682
|
+
|
|
1683
|
+func (this *NewDialysisApiController) SaveSex() {
|
|
1684
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1685
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1686
|
+ sex, _ := this.GetInt64("sex")
|
|
1687
|
+ fmt.Println("sex", sex)
|
|
1688
|
+ id, _ := this.GetInt64("id")
|
|
1689
|
+ fmt.Println("id", id)
|
|
1690
|
+ role := models.App_Role{
|
|
1691
|
+ Sex: sex,
|
|
1692
|
+ }
|
|
1693
|
+ err := service.SaveSex(id, orgid, appid, &role)
|
|
1694
|
+ if err != nil {
|
|
1695
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1696
|
+ return
|
|
1697
|
+ }
|
|
1698
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1699
|
+ "role": role,
|
|
1700
|
+ })
|
|
1701
|
+}
|
|
1702
|
+
|
|
1703
|
+func (this *NewDialysisApiController) SaveBirthday() {
|
|
1704
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1705
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1706
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1707
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
1708
|
+ fmt.Println(err)
|
|
1709
|
+ id := dataBody["id"].(string)
|
|
1710
|
+ ids, err := strconv.ParseInt(id, 10, 64)
|
|
1711
|
+ fmt.Print("id", id)
|
|
1712
|
+ birthday := dataBody["birth"].(string)
|
|
1713
|
+ timeLayout := "2006-01-02 15:04:05"
|
|
1714
|
+ theTime, err := utils.ParseTimeStringToTime(timeLayout, birthday+" 00:00:00")
|
|
1715
|
+ birth := theTime.Unix()
|
|
1716
|
+ role := models.App_Role{
|
|
1717
|
+ Birthday: birth,
|
|
1718
|
+ }
|
|
1719
|
+ err = service.SaveBirthday(ids, orgid, appid, &role)
|
|
1720
|
+ if err != nil {
|
|
1721
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1722
|
+ return
|
|
1723
|
+ }
|
|
1724
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1725
|
+ "role": role,
|
|
1726
|
+ })
|
|
1727
|
+}
|
|
1728
|
+
|
|
1729
|
+func (this *NewDialysisApiController) GetOrgName() {
|
|
1730
|
+
|
|
1731
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1732
|
+ name, err := service.GetOrgName(orgid)
|
|
1733
|
+ if err != nil {
|
|
1734
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1735
|
+ return
|
|
1736
|
+ }
|
|
1737
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1738
|
+ "name": name,
|
|
1739
|
+ })
|
|
1740
|
+}
|
|
1741
|
+
|
|
1742
|
+func (this *NewDialysisApiController) GetRoleName() {
|
|
1743
|
+ id, _ := this.GetInt64("id")
|
|
1744
|
+ fmt.Println("id", id)
|
|
1745
|
+ orgid := this.GetMobileAdminUserInfo().Org.Id
|
|
1746
|
+ fmt.Println("orgid", orgid)
|
|
1747
|
+ appid := this.GetMobileAdminUserInfo().App.Id
|
|
1748
|
+ fmt.Println("appid", appid)
|
|
1749
|
+ name, err := service.GetRoleName(id, orgid, appid)
|
|
1750
|
+ positionName, err := service.GetPositionName(id, orgid, appid)
|
|
1751
|
+ if err != nil {
|
|
1752
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1753
|
+ return
|
|
1754
|
+ }
|
|
1755
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1756
|
+ "name": name,
|
|
1757
|
+ "positionName": positionName,
|
|
1758
|
+ })
|
|
1759
|
+}
|
|
1760
|
+
|
|
1761
|
+func (this *NewDialysisApiController) SavePartition() {
|
|
1762
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
|
1763
|
+ name := this.GetString("name")
|
|
1764
|
+ fmt.Println("分区名称", name)
|
|
1765
|
+ zonetype, _ := this.GetInt64("type")
|
|
1766
|
+ fmt.Println("分区型号", zonetype)
|
|
1767
|
+ strInt64 := strconv.FormatInt(zonetype, 10)
|
|
1768
|
+ typeid, _ := strconv.Atoi(strInt64)
|
|
1769
|
+ zone := models.DeviceZone{
|
|
1770
|
+ Name: name,
|
|
1771
|
+ Type: typeid,
|
|
1772
|
+ OrgID: adminInfo.Org.Id,
|
|
1773
|
+ Status: 1,
|
|
1774
|
+ CreateTime: time.Now().Unix(),
|
|
1775
|
+ }
|
|
1776
|
+ err := service.CreatedZone(&zone)
|
|
1777
|
+ if err != nil {
|
|
1778
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1779
|
+ return
|
|
1780
|
+ }
|
|
1781
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1782
|
+ "zone": zone,
|
|
1783
|
+ })
|
|
1784
|
+}
|
|
1785
|
+
|
|
1786
|
+func (this *NewDialysisApiController) GetAllZone() {
|
|
1787
|
+
|
|
1788
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
1789
|
+ orgid := adminUser.Org.Id
|
|
1790
|
+ page, _ := this.GetInt64("page")
|
|
1791
|
+ limit, _ := this.GetInt64("limit")
|
|
1792
|
+ zone, total, err := service.GetAllZone(orgid, page, limit)
|
|
1793
|
+ if err != nil {
|
|
1794
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1795
|
+ return
|
|
1796
|
+ }
|
|
1797
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1798
|
+ "zone": zone,
|
|
1799
|
+ "total": total,
|
|
1800
|
+ })
|
|
1801
|
+}
|
|
1802
|
+
|
|
1803
|
+func (this *NewDialysisApiController) DeleteZone() {
|
|
1804
|
+ id, _ := this.GetInt64("id")
|
|
1805
|
+ err := service.DeleteZoneById(id)
|
|
1806
|
+ fmt.Println("删除失败", err)
|
|
1807
|
+ returnData := make(map[string]interface{}, 0)
|
|
1808
|
+ returnData["msg"] = "删除失败"
|
|
1809
|
+ this.ServeSuccessJSON(returnData)
|
|
1810
|
+ return
|
|
1811
|
+}
|
|
1812
|
+
|
|
1813
|
+func (this *NewDialysisApiController) SaveGroup() {
|
|
1814
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
1815
|
+ orgid := adminUser.Org.Id
|
|
1816
|
+ name := this.GetString("name")
|
|
1817
|
+ fmt.Println("name", name)
|
|
1818
|
+ group := models.DeviceGroup{
|
|
1819
|
+ Name: name,
|
|
1820
|
+ Status: 1,
|
|
1821
|
+ CreateTime: time.Now().Unix(),
|
|
1822
|
+ OrgID: orgid,
|
|
1823
|
+ }
|
|
1824
|
+ err := service.SaveGroup(&group)
|
|
1825
|
+ if err != nil {
|
|
1826
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1827
|
+ return
|
|
1828
|
+ }
|
|
1829
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1830
|
+ "group": group,
|
|
1831
|
+ })
|
|
1832
|
+}
|
|
1833
|
+
|
|
1834
|
+func (this *NewDialysisApiController) GetAllGroup() {
|
|
1835
|
+ adminUser := this.GetMobileAdminUserInfo()
|
|
1836
|
+ orgid := adminUser.Org.Id
|
|
1837
|
+ page, _ := this.GetInt64("page")
|
|
1838
|
+ fmt.Println("page", page)
|
|
1839
|
+ limit, _ := this.GetInt64("limit")
|
|
1840
|
+ fmt.Println("limit", limit)
|
|
1841
|
+ group, total, err := service.GetAllGroup(orgid, page, limit)
|
|
1842
|
+ if err != nil {
|
|
1843
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1844
|
+ return
|
|
1845
|
+ }
|
|
1846
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1847
|
+ "group": group,
|
|
1848
|
+ "total": total,
|
|
1849
|
+ })
|
|
1850
|
+}
|
|
1851
|
+
|
|
1852
|
+func (this *NewDialysisApiController) DeleteGroup() {
|
|
1853
|
+ id, _ := this.GetInt64("id")
|
|
1854
|
+ fmt.Println("id", id)
|
|
1855
|
+ err := service.DeleteGroup(id)
|
|
1856
|
+ fmt.Println("删除失败", err)
|
|
1857
|
+ returnData := make(map[string]interface{}, 0)
|
|
1858
|
+ returnData["msg"] = "删除失败"
|
|
1859
|
+ this.ServeSuccessJSON(returnData)
|
|
1860
|
+ return
|
|
1861
|
+}
|
|
1862
|
+
|
|
1863
|
+func (this *NewDialysisApiController) GetAllGroupOne() {
|
|
1864
|
+ admininfo := this.GetMobileAdminUserInfo()
|
|
1865
|
+ orgid := admininfo.Org.Id
|
|
1866
|
+ zone, _ := service.GetAllZoneOne(orgid)
|
|
1867
|
+ group, err := service.GetAllGroupOne(orgid)
|
|
1868
|
+ if err != nil {
|
|
1869
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1870
|
+ return
|
|
1871
|
+ }
|
|
1872
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1873
|
+ "zone": zone,
|
|
1874
|
+ "group": group,
|
|
1875
|
+ })
|
|
1876
|
+}
|
|
1877
|
+
|
|
1878
|
+func (this *NewDialysisApiController) SaveBed() {
|
|
1879
|
+ adminuser := this.GetMobileAdminUserInfo()
|
|
1880
|
+ orgid := adminuser.Org.Id
|
|
1881
|
+ name := this.GetString("name")
|
|
1882
|
+ fmt.Println("name", name)
|
|
1883
|
+ zone, _ := this.GetInt64("zone")
|
|
1884
|
+ fmt.Print("zone", zone)
|
|
1885
|
+ group, _ := this.GetInt64("group")
|
|
1886
|
+ fmt.Println("group", group)
|
|
1887
|
+ number := models.DeviceNumber{
|
|
1888
|
+ Number: name,
|
|
1889
|
+ ZoneID: zone,
|
|
1890
|
+ GroupID: group,
|
|
1891
|
+ OrgID: orgid,
|
|
1892
|
+ Status: 1,
|
|
1893
|
+ CreateTime: time.Now().Unix(),
|
|
1894
|
+ }
|
|
1895
|
+ err := service.CreateNumber(&number)
|
|
1896
|
+ if err != nil {
|
|
1897
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1898
|
+ return
|
|
1899
|
+ }
|
|
1900
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1901
|
+ "number": number,
|
|
1902
|
+ })
|
|
1903
|
+}
|
|
1904
|
+
|
|
1905
|
+func (this *NewDialysisApiController) GetAllNumber() {
|
|
1906
|
+ admininfo := this.GetMobileAdminUserInfo()
|
|
1907
|
+ orgid := admininfo.Org.Id
|
|
1908
|
+ page, _ := this.GetInt64("page")
|
|
1909
|
+ fmt.Print("page", page)
|
|
1910
|
+ limit, _ := this.GetInt64("limit")
|
|
1911
|
+ fmt.Println("limit", limit)
|
|
1912
|
+ number, total, err := service.GetAllNumber(page, limit, orgid)
|
|
1913
|
+ zone, _ := service.GetAllZoneOne(orgid)
|
|
1914
|
+ group, _ := service.GetAllGroupOne(orgid)
|
|
1915
|
+ if err != nil {
|
|
1916
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
1917
|
+ return
|
|
1918
|
+ }
|
|
1919
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1920
|
+ "number": number,
|
|
1921
|
+ "total": total,
|
|
1922
|
+ "zone": zone,
|
|
1923
|
+ "group": group,
|
|
1924
|
+ })
|
|
1925
|
+}
|
|
1926
|
+
|
|
1927
|
+func (this *NewDialysisApiController) DeleteBed() {
|
|
1928
|
+ id, _ := this.GetInt64("id")
|
|
1929
|
+ fmt.Println("id", id)
|
|
1930
|
+ err := service.DeleteBed(id)
|
|
1931
|
+ fmt.Println("删除失败", err)
|
|
1932
|
+ returnData := make(map[string]interface{}, 0)
|
|
1933
|
+ returnData["msg"] = "删除失败"
|
|
1934
|
+ this.ServeSuccessJSON(returnData)
|
|
1935
|
+ return
|
|
1936
|
+}
|