|
@@ -70,6 +70,14 @@ func siteRouters() {
|
70
|
70
|
beego.Router("/api/site/deletenavition",&Microwebsite{},"Get:DeleteNavition")
|
71
|
71
|
beego.Router("/api/site/deletemodle",&Microwebsite{},"Get:DeleteModle")
|
72
|
72
|
beego.Router("/api/site/getordermodel",&Microwebsite{},"Post:GetOrderModel")
|
|
73
|
+ beego.Router("/api/site/addrotationpic",&Microwebsite{},"Post:AddRotationpic")
|
|
74
|
+ beego.Router("/api/site/getrotationimages",&Microwebsite{},"Post:GetRotationimages")
|
|
75
|
+ beego.Router("/api/site/addrotationimage",&Microwebsite{},"Post:AddrotationImage")
|
|
76
|
+ beego.Router("/api/site/addimageslink",&Microwebsite{},"Post:AddImageslink")
|
|
77
|
+ beego.Router("/api/site/geteditimages",&Microwebsite{},"Post:GetEditImages")
|
|
78
|
+ beego.Router("/api/site/addmagicnavi",&Microwebsite{},"Post:AddMagicNavi")
|
|
79
|
+ beego.Router("/api/site/getmagicimages",&Microwebsite{},"Post:GetMagicImages")
|
|
80
|
+ beego.Router("/api/site/addmarginchart",&Microwebsite{},"Post:AddMarginChart")
|
73
|
81
|
}
|
74
|
82
|
|
75
|
83
|
type Microwebsite struct {
|
|
@@ -95,24 +103,21 @@ func (this *Microwebsite) AddRotaionChart() {
|
95
|
103
|
return
|
96
|
104
|
}
|
97
|
105
|
fmt.Println("姓名:",title)
|
98
|
|
- sort := dataBody["sort"].(string)
|
99
|
|
- if len(sort) == 0 {
|
|
106
|
+ sort := int64(dataBody["sort"].(float64))
|
|
107
|
+ if sort <= 0 {
|
100
|
108
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序值不能为空")
|
101
|
109
|
return
|
102
|
110
|
}
|
103
|
|
- sortt, err := strconv.ParseInt(sort, 10, 64)
|
104
|
|
- fmt.Println("排序:",sortt)
|
|
111
|
+
|
105
|
112
|
rotationImages := dataBody["rotationImages"]
|
106
|
113
|
//图片数组转为字符串保存到数据库
|
107
|
|
- replace := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
|
|
114
|
+ images := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
|
108
|
115
|
fmt.Println("姓名:",rotationImages)
|
109
|
|
- fmt.Println("字符串",replace)
|
110
|
|
-
|
111
|
|
-
|
|
116
|
+ fmt.Println("字符串",images)
|
112
|
117
|
|
113
|
118
|
model := models.SgjPatientModel{
|
114
|
119
|
Title: title,
|
115
|
|
- Sort: sortt,
|
|
120
|
+ Sort: sort,
|
116
|
121
|
UserOrgId: userOrgID,
|
117
|
122
|
Status: 1,
|
118
|
123
|
Ctime: time.Now().Unix(),
|
|
@@ -125,8 +130,8 @@ func (this *Microwebsite) AddRotaionChart() {
|
125
|
130
|
fmt.Println("patientModel是什麽",patientModel)
|
126
|
131
|
rotation := models.SgjPatientRotation{
|
127
|
132
|
Title: title,
|
128
|
|
- Sort: sortt,
|
129
|
|
- RotationImages: replace,
|
|
133
|
+ Sort: sort,
|
|
134
|
+ RotationImages: images,
|
130
|
135
|
UserOrgId: userOrgID,
|
131
|
136
|
Status: 1,
|
132
|
137
|
Ctime: time.Now().Unix(),
|
|
@@ -1876,7 +1881,7 @@ func (this *Microwebsite) GetOrderModel() {
|
1876
|
1881
|
adminUserInfo := this.GetAdminUserInfo()
|
1877
|
1882
|
userOrgID := int64(adminUserInfo.CurrentOrgId)
|
1878
|
1883
|
ordmodel, err := site_service.GetOrederModel(userOrgID)
|
1879
|
|
- fmt.Println("马文强错误是什么",err)
|
|
1884
|
+
|
1880
|
1885
|
if err !=nil{
|
1881
|
1886
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
1882
|
1887
|
return
|
|
@@ -1886,4 +1891,322 @@ func (this *Microwebsite) GetOrderModel() {
|
1886
|
1891
|
})
|
1887
|
1892
|
}
|
1888
|
1893
|
|
|
1894
|
+func (this *Microwebsite) AddRotationpic() {
|
|
1895
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1896
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1897
|
+ fmt.Println("机构ID",userOrgID)
|
|
1898
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1899
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
1900
|
+ if err != nil {
|
|
1901
|
+ utils.ErrorLog(err.Error())
|
|
1902
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
1903
|
+ return
|
|
1904
|
+ }
|
|
1905
|
+ images := dataBody["Images"].(string)
|
|
1906
|
+ fmt.Println("图片",images)
|
|
1907
|
+ if len(images) == 0 {
|
|
1908
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片不能为空")
|
|
1909
|
+ return
|
|
1910
|
+ }
|
|
1911
|
+
|
|
1912
|
+ sort := int64(dataBody["sort"].(float64))
|
|
1913
|
+ if sort <= 0 {
|
|
1914
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序不能为空")
|
|
1915
|
+ return
|
|
1916
|
+ }
|
|
1917
|
+ fmt.Println("排序",sort)
|
|
1918
|
+ piclink := int64(dataBody["piclink"].(float64))
|
|
1919
|
+ if piclink <= 0 {
|
|
1920
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片链接不能为空")
|
|
1921
|
+ return
|
|
1922
|
+ }
|
|
1923
|
+ fmt.Println("图片链接",piclink)
|
|
1924
|
+ linkaddress := dataBody["linkaddress"].(string)
|
|
1925
|
+ if len(linkaddress) == 0 {
|
|
1926
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "链接地址不能为空")
|
|
1927
|
+ return
|
|
1928
|
+ }
|
|
1929
|
+ fmt.Println("链接地址",piclink)
|
|
1930
|
+
|
|
1931
|
+ conrotation := models.SgjPatientConrotation{
|
|
1932
|
+ Images: images,
|
|
1933
|
+ Sort: sort,
|
|
1934
|
+ Piclink: piclink,
|
|
1935
|
+ Linkaddress: linkaddress,
|
|
1936
|
+ Status: 1,
|
|
1937
|
+ Ctime: time.Now().Unix(),
|
|
1938
|
+ UserOrgId: userOrgID,
|
|
1939
|
+ }
|
|
1940
|
+
|
|
1941
|
+ err = site_service.AddRotationpic(conrotation)
|
|
1942
|
+ if err !=nil{
|
|
1943
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1944
|
+ return
|
|
1945
|
+ }
|
|
1946
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1947
|
+ "conrotation":conrotation,
|
|
1948
|
+ })
|
|
1949
|
+}
|
|
1950
|
+
|
|
1951
|
+func (this *Microwebsite) GetRotationimages() {
|
|
1952
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1953
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1954
|
+ conrotations, err := site_service.GetRotationImages(userOrgID)
|
|
1955
|
+ if err !=nil{
|
|
1956
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
1957
|
+ return
|
|
1958
|
+ }
|
|
1959
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
1960
|
+ "conrotations":conrotations,
|
|
1961
|
+ })
|
|
1962
|
+}
|
|
1963
|
+
|
|
1964
|
+func (this *Microwebsite) AddrotationImage() {
|
|
1965
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
1966
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
1967
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1968
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
1969
|
+ if err != nil {
|
|
1970
|
+ utils.ErrorLog(err.Error())
|
|
1971
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
1972
|
+ return
|
|
1973
|
+ }
|
|
1974
|
+ title := dataBody["title"].(string)
|
|
1975
|
+ fmt.Println("模块标题",title)
|
|
1976
|
+ if len(title) == 0 {
|
|
1977
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "模块标题不能为空")
|
|
1978
|
+ return
|
|
1979
|
+ }
|
|
1980
|
+
|
|
1981
|
+ sort := int64(dataBody["sort"].(float64))
|
|
1982
|
+ if sort<=0{
|
|
1983
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong,"排序不能为空")
|
|
1984
|
+ return
|
|
1985
|
+ }
|
|
1986
|
+ fmt.Println("排序",sort)
|
|
1987
|
+ rotationImages := dataBody["rotationImages"]
|
|
1988
|
+ fmt.Println("图片",rotationImages)
|
|
1989
|
+ images := strings.Replace(strings.Trim(fmt.Sprint(rotationImages), "[]"), " ", ",", -1)
|
|
1990
|
+ fmt.Println("images",images)
|
|
1991
|
+ ordmodel := models.SgjPatientOrdmodel{
|
|
1992
|
+ Title: title,
|
|
1993
|
+ Sort: sort,
|
|
1994
|
+ ModeType: 1,
|
|
1995
|
+ Ctime:time.Now().Unix(),
|
|
1996
|
+ Status:1,
|
|
1997
|
+ UserOrgId:userOrgID,
|
|
1998
|
+ }
|
|
1999
|
+ err = site_service.AddOrdModel(ºodel)
|
|
2000
|
+ patientOrdmodel, err := site_service.QueryOrdeModelByID(userOrgID)
|
|
2001
|
+ oldrotation := models.SgjPatientOldrotation{
|
|
2002
|
+ Title: title,
|
|
2003
|
+ Sort: sort,
|
|
2004
|
+ RotationImages: images,
|
|
2005
|
+ ModeId: patientOrdmodel.ID,
|
|
2006
|
+ Status: 1,
|
|
2007
|
+ UserOrgId: userOrgID,
|
|
2008
|
+ Ctime: time.Now().Unix(),
|
|
2009
|
+ }
|
|
2010
|
+ err = site_service.AddrotationImage(&oldrotation)
|
|
2011
|
+ if err !=nil{
|
|
2012
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2013
|
+ return
|
|
2014
|
+ }
|
|
2015
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2016
|
+ "oldrotation":oldrotation,
|
|
2017
|
+ })
|
|
2018
|
+}
|
|
2019
|
+
|
|
2020
|
+func (this *Microwebsite) AddImageslink() {
|
|
2021
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2022
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2023
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2024
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2025
|
+ if err != nil {
|
|
2026
|
+ utils.ErrorLog(err.Error())
|
|
2027
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2028
|
+ return
|
|
2029
|
+ }
|
|
2030
|
+ imageUrl := dataBody["imageUrl"].(string)
|
|
2031
|
+ fmt.Println("图片编辑",imageUrl)
|
|
2032
|
+ if len(imageUrl) == 0 {
|
|
2033
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2034
|
+ return
|
|
2035
|
+ }
|
|
2036
|
+ sort := int64(dataBody["sort"].(float64))
|
|
2037
|
+ fmt.Println("排序",sort)
|
|
2038
|
+ if sort <= 0 {
|
|
2039
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "排序不能为空")
|
|
2040
|
+ return
|
|
2041
|
+ }
|
|
2042
|
+ imagelink :=int64(dataBody["imagelink"].(float64))
|
|
2043
|
+ if imagelink <= 0 {
|
|
2044
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片链接不能为空")
|
|
2045
|
+ return
|
|
2046
|
+ }
|
|
2047
|
+ fmt.Println("图片链接",imagelink)
|
|
2048
|
+ linkaddress := dataBody["linkaddress"].(string)
|
|
2049
|
+ if len(linkaddress) == 0 {
|
|
2050
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "链接地址不能为空")
|
|
2051
|
+ return
|
|
2052
|
+ }
|
|
2053
|
+
|
|
2054
|
+ editpiclink := models.SgjPatientEditpiclink{
|
|
2055
|
+ Images: imageUrl,
|
|
2056
|
+ Sort: sort,
|
|
2057
|
+ Piclink: imagelink,
|
|
2058
|
+ Linkaddress: linkaddress,
|
|
2059
|
+ Status: 1,
|
|
2060
|
+ Ctime: time.Now().Unix(),
|
|
2061
|
+ UserOrgId: userOrgID,
|
|
2062
|
+ }
|
|
2063
|
+
|
|
2064
|
+ err = site_service.AddImageslink(&editpiclink)
|
|
2065
|
+ if err !=nil{
|
|
2066
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2067
|
+ return
|
|
2068
|
+ }
|
|
2069
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2070
|
+ "editpiclink":editpiclink,
|
|
2071
|
+ })
|
|
2072
|
+}
|
|
2073
|
+
|
|
2074
|
+func (this *Microwebsite) GetEditImages() {
|
|
2075
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2076
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2077
|
+ editpiclinks, err := site_service.GetEditImages(userOrgID)
|
|
2078
|
+ fmt.Println("查询到的数据",editpiclinks,err)
|
|
2079
|
+ if err !=nil{
|
|
2080
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2081
|
+ return
|
|
2082
|
+ }
|
|
2083
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2084
|
+ "editpiclinks":editpiclinks,
|
|
2085
|
+ })
|
|
2086
|
+}
|
|
2087
|
+
|
|
2088
|
+func (this *Microwebsite) AddMagicNavi() {
|
|
2089
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2090
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2091
|
+ fmt.Println("这个是",userOrgID)
|
|
2092
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2093
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2094
|
+ if err != nil {
|
|
2095
|
+ utils.ErrorLog(err.Error())
|
|
2096
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2097
|
+ return
|
|
2098
|
+ }
|
|
2099
|
+ margtitle := dataBody["margtitle"].(string)
|
|
2100
|
+ fmt.Println("导航标题",margtitle)
|
|
2101
|
+ if len(margtitle) == 0 {
|
|
2102
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航标题不能为空")
|
|
2103
|
+ return
|
|
2104
|
+ }
|
|
2105
|
+ margImage := dataBody["margImage"].(string)
|
|
2106
|
+ fmt.Println("导航图标",margImage)
|
|
2107
|
+ if len(margtitle) == 0 {
|
|
2108
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航图标不能为空")
|
|
2109
|
+ return
|
|
2110
|
+ }
|
|
2111
|
+ jumpset := int64(dataBody["jumpset"].(float64))
|
|
2112
|
+ fmt.Println("跳转设置",jumpset)
|
|
2113
|
+ if len(margtitle) == 0 {
|
|
2114
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "跳转设置不能为空")
|
|
2115
|
+ return
|
|
2116
|
+ }
|
|
2117
|
+ marginaddress := dataBody["marginaddress"].(string)
|
|
2118
|
+ fmt.Println("链接地址",marginaddress)
|
|
2119
|
+ if len(marginaddress) == 0 {
|
|
2120
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "导航图标不能为空")
|
|
2121
|
+ return
|
|
2122
|
+ }
|
|
2123
|
+
|
|
2124
|
+ editmargin := models.SgjPatientEditmargin{
|
|
2125
|
+ Margtitle: margtitle,
|
|
2126
|
+ Margimage: margImage,
|
|
2127
|
+ Jumpset: jumpset,
|
|
2128
|
+ Marginaddress: marginaddress,
|
|
2129
|
+ Status: 1,
|
|
2130
|
+ Ctime: time.Now().Unix(),
|
|
2131
|
+ UserOrgId: userOrgID,
|
|
2132
|
+ }
|
|
2133
|
+
|
|
2134
|
+ err = site_service.AddMagicNavi(&editmargin)
|
|
2135
|
+ if err !=nil{
|
|
2136
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2137
|
+ return
|
|
2138
|
+ }
|
|
2139
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2140
|
+ "editmargin":editmargin,
|
|
2141
|
+ })
|
|
2142
|
+}
|
|
2143
|
+
|
|
2144
|
+func (this *Microwebsite) GetMagicImages() {
|
|
2145
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2146
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2147
|
+ editmargins, err := site_service.GetMagicImages(userOrgID)
|
|
2148
|
+ if err !=nil{
|
|
2149
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2150
|
+ return
|
|
2151
|
+ }
|
|
2152
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2153
|
+ "editmargins":editmargins,
|
|
2154
|
+ })
|
|
2155
|
+}
|
|
2156
|
+
|
|
2157
|
+func (this *Microwebsite) AddMarginChart() {
|
|
2158
|
+ adminUserInfo := this.GetAdminUserInfo()
|
|
2159
|
+ userOrgID := int64(adminUserInfo.CurrentOrgId)
|
|
2160
|
+ fmt.Println(userOrgID)
|
|
2161
|
+ dataBody := make(map[string]interface{}, 0)
|
|
2162
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
|
|
2163
|
+ if err != nil {
|
|
2164
|
+ utils.ErrorLog(err.Error())
|
|
2165
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "参数错误")
|
|
2166
|
+ return
|
|
2167
|
+ }
|
|
2168
|
+ title := dataBody["title"].(string)
|
|
2169
|
+ fmt.Println("图片编辑",title)
|
|
2170
|
+ if len(title) == 0 {
|
|
2171
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2172
|
+ return
|
|
2173
|
+ }
|
|
2174
|
+ sort := int64(dataBody["sort"].(float64))
|
|
2175
|
+ fmt.Println("排序",sort)
|
|
2176
|
+ if sort <= 0 {
|
|
2177
|
+ this.ServeFailJsonSend(enums.ErrorCodeParamWrong, "图片编辑不能为空")
|
|
2178
|
+ return
|
|
2179
|
+ }
|
|
2180
|
+ macimages := dataBody["marginImages"]
|
|
2181
|
+ images := strings.Replace(strings.Trim(fmt.Sprint(macimages), "[]"), " ", ",", -1)
|
|
2182
|
+ fmt.Println("images",images)
|
|
2183
|
+ model := models.SgjPatientModel{
|
|
2184
|
+ Title: title,
|
|
2185
|
+ Sort: sort,
|
|
2186
|
+ UserOrgId: userOrgID,
|
|
2187
|
+ Status: 1,
|
|
2188
|
+ Ctime: time.Now().Unix(),
|
|
2189
|
+ ModeType: 8,
|
|
2190
|
+ }
|
|
2191
|
+ site_service.AddPatientModel(&model)
|
|
2192
|
+ fmt.Println("rotation是什么",model)
|
|
2193
|
+ patientModel, err := site_service.QueryModel(userOrgID)
|
|
2194
|
+ macnavigation := models.SgjPatientMacnavigation{
|
|
2195
|
+ Title: title,
|
|
2196
|
+ Sort: sort,
|
|
2197
|
+ MacImages: images,
|
|
2198
|
+ Modeid: patientModel.ID,
|
|
2199
|
+ Status: 1,
|
|
2200
|
+ Ctime: time.Now().Unix(),
|
|
2201
|
+ UserOrgId: userOrgID,
|
|
2202
|
+ }
|
1889
|
2203
|
|
|
2204
|
+ err = site_service.AddMarginChart(&macnavigation)
|
|
2205
|
+ if err !=nil{
|
|
2206
|
+ this.ServeFailJsonSend(enums.ErrorCodeDataException, "删除回复成功")
|
|
2207
|
+ return
|
|
2208
|
+ }
|
|
2209
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
2210
|
+ "macnavigation":macnavigation,
|
|
2211
|
+ })
|
|
2212
|
+}
|