xiaoming_global hace 5 años
padre
commit
975c6d2a8e

+ 98 - 64
.idea/workspace.xml Ver fichero

@@ -3,6 +3,10 @@
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="7aa7cc45-aece-4fa3-9063-5e3df12471b4" name="Default" comment="">
5 5
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go" beforeDir="false" afterPath="$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/models/function_models/fuction_query_models.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/function_models/fuction_query_models.go" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/service/function_service.go" beforeDir="false" afterPath="$PROJECT_DIR$/service/function_service.go" afterDir="false" />
6 10
     </list>
7 11
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
8 12
     <option name="TRACKING_ENABLED" value="true" />
@@ -16,7 +20,7 @@
16 20
       <file leaf-file-name="analysis_api_controller.go" pinned="false" current-in-tab="false">
17 21
         <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/analysis_api_controller.go">
18 22
           <provider selected="true" editor-type-id="text-editor">
19
-            <state relative-caret-position="9240">
23
+            <state relative-caret-position="437">
20 24
               <caret line="427" selection-start-line="427" selection-end-line="427" />
21 25
             </state>
22 26
           </provider>
@@ -25,8 +29,8 @@
25 29
       <file leaf-file-name="function_api_router_register.go" pinned="false" current-in-tab="false">
26 30
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
27 31
           <provider selected="true" editor-type-id="text-editor">
28
-            <state relative-caret-position="1694">
29
-              <caret line="80" column="81" selection-start-line="80" selection-start-column="56" selection-end-line="80" selection-end-column="81" />
32
+            <state relative-caret-position="388">
33
+              <caret line="95" selection-start-line="95" selection-end-line="95" />
30 34
               <folding>
31 35
                 <element signature="e#34#79#0" expanded="true" />
32 36
               </folding>
@@ -37,29 +41,56 @@
37 41
       <file leaf-file-name="admin_service.go" pinned="false" current-in-tab="false">
38 42
         <entry file="file://$PROJECT_DIR$/service/admin_service.go">
39 43
           <provider selected="true" editor-type-id="text-editor">
40
-            <state relative-caret-position="9636">
41
-              <caret line="444" selection-start-line="444" selection-end-line="444" />
44
+            <state relative-caret-position="572">
45
+              <caret line="34" column="1" selection-start-line="34" selection-start-column="1" selection-end-line="34" selection-end-column="1" />
46
+            </state>
47
+          </provider>
48
+        </entry>
49
+      </file>
50
+      <file leaf-file-name="function_service.go" pinned="false" current-in-tab="true">
51
+        <entry file="file://$PROJECT_DIR$/service/function_service.go">
52
+          <provider selected="true" editor-type-id="text-editor">
53
+            <state relative-caret-position="228">
54
+              <caret line="149" column="219" selection-start-line="149" selection-start-column="219" selection-end-line="149" selection-end-column="219" />
42 55
               <folding>
43
-                <element signature="e#35#139#0" expanded="true" />
56
+                <element signature="e#17#73#0" expanded="true" />
44 57
               </folding>
45 58
             </state>
46 59
           </provider>
47 60
         </entry>
48 61
       </file>
49
-      <file leaf-file-name="function_service.go" pinned="false" current-in-tab="false">
50
-        <entry file="file://$PROJECT_DIR$/service/function_service.go">
62
+      <file leaf-file-name="fuction_query_models.go" pinned="false" current-in-tab="false">
63
+        <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
51 64
           <provider selected="true" editor-type-id="text-editor">
52
-            <state relative-caret-position="264">
53
-              <caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
65
+            <state relative-caret-position="471">
66
+              <caret line="513" column="13" selection-start-line="513" selection-start-column="13" selection-end-line="513" selection-end-column="13" />
54 67
             </state>
55 68
           </provider>
56 69
         </entry>
57 70
       </file>
58
-      <file leaf-file-name="function_api_base_controller.go" pinned="false" current-in-tab="true">
71
+      <file leaf-file-name="function_api_base_controller.go" pinned="false" current-in-tab="false">
59 72
         <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
60 73
           <provider selected="true" editor-type-id="text-editor">
61
-            <state relative-caret-position="273">
62
-              <caret line="3065" column="22" selection-start-line="3065" selection-start-column="22" selection-end-line="3065" selection-end-column="22" />
74
+            <state relative-caret-position="168">
75
+              <caret line="3556" column="51" selection-start-line="3556" selection-start-column="35" selection-end-line="3556" selection-end-column="51" />
76
+            </state>
77
+          </provider>
78
+        </entry>
79
+      </file>
80
+      <file leaf-file-name="app.conf" pinned="false" current-in-tab="false">
81
+        <entry file="file://$PROJECT_DIR$/conf/app.conf">
82
+          <provider selected="true" editor-type-id="text-editor">
83
+            <state>
84
+              <caret column="12" selection-start-column="12" selection-end-column="12" />
85
+            </state>
86
+          </provider>
87
+        </entry>
88
+      </file>
89
+      <file leaf-file-name="router.go" pinned="false" current-in-tab="false">
90
+        <entry file="file://$PROJECT_DIR$/routers/router.go">
91
+          <provider selected="true" editor-type-id="text-editor">
92
+            <state relative-caret-position="104">
93
+              <caret line="12" column="80" selection-start-line="12" selection-start-column="71" selection-end-line="12" selection-end-column="80" />
63 94
             </state>
64 95
           </provider>
65 96
         </entry>
@@ -111,9 +142,9 @@
111 142
         <option value="$PROJECT_DIR$/service/admin_service.go" />
112 143
         <option value="$PROJECT_DIR$/controllers/admin_api_controllers/analysis_api_controller.go" />
113 144
         <option value="$PROJECT_DIR$/models/function_models/fuction_query_models.go" />
114
-        <option value="$PROJECT_DIR$/service/function_service.go" />
115 145
         <option value="$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go" />
116 146
         <option value="$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go" />
147
+        <option value="$PROJECT_DIR$/service/function_service.go" />
117 148
       </list>
118 149
     </option>
119 150
   </component>
@@ -124,8 +155,9 @@
124 155
     <sorting>DEFINITION_ORDER</sorting>
125 156
   </component>
126 157
   <component name="ProjectFrameBounds" extendedState="6">
127
-    <option name="x" value="525" />
128
-    <option name="width" value="1230" />
158
+    <option name="x" value="37" />
159
+    <option name="y" value="53" />
160
+    <option name="width" value="1690" />
129 161
     <option name="height" value="1040" />
130 162
   </component>
131 163
   <component name="ProjectView">
@@ -133,7 +165,6 @@
133 165
       <foldersAlwaysOnTop value="true" />
134 166
     </navigator>
135 167
     <panes>
136
-      <pane id="Scope" />
137 168
       <pane id="ProjectPane">
138 169
         <subPane>
139 170
           <expand>
@@ -149,7 +180,18 @@
149 180
             <path>
150 181
               <item name="XT_Admin_Api" type="b2602c69:ProjectViewProjectNode" />
151 182
               <item name="XT_Admin_Api" type="462c0819:PsiDirectoryNode" />
152
-              <item name="controllers" type="462c0819:PsiDirectoryNode" />
183
+              <item name="models" type="462c0819:PsiDirectoryNode" />
184
+            </path>
185
+            <path>
186
+              <item name="XT_Admin_Api" type="b2602c69:ProjectViewProjectNode" />
187
+              <item name="XT_Admin_Api" type="462c0819:PsiDirectoryNode" />
188
+              <item name="models" type="462c0819:PsiDirectoryNode" />
189
+              <item name="function_models" type="462c0819:PsiDirectoryNode" />
190
+            </path>
191
+            <path>
192
+              <item name="XT_Admin_Api" type="b2602c69:ProjectViewProjectNode" />
193
+              <item name="XT_Admin_Api" type="462c0819:PsiDirectoryNode" />
194
+              <item name="routers" type="462c0819:PsiDirectoryNode" />
153 195
             </path>
154 196
             <path>
155 197
               <item name="XT_Admin_Api" type="b2602c69:ProjectViewProjectNode" />
@@ -160,13 +202,14 @@
160 202
           <select />
161 203
         </subPane>
162 204
       </pane>
205
+      <pane id="Scope" />
163 206
     </panes>
164 207
   </component>
165 208
   <component name="PropertiesComponent">
166 209
     <property name="DefaultGoTemplateProperty" value="Go Application" />
167 210
     <property name="go.gopath.indexing.explicitly.defined" value="true" />
168 211
     <property name="go.sdk.automatically.set" value="true" />
169
-    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
212
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../SCRM" />
170 213
   </component>
171 214
   <component name="RunDashboard">
172 215
     <option name="ruleStates">
@@ -183,15 +226,15 @@
183 226
   <component name="ToolWindowManager">
184 227
     <frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
185 228
     <layout>
186
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.19906166" />
229
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.20442359" />
187 230
       <window_info anchor="bottom" id="TODO" order="6" />
188
-      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.10656837" side_tool="true" visible="true" weight="0.44507846" />
231
+      <window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.102546915" side_tool="true" visible="true" weight="0.47075605" />
189 232
       <window_info anchor="right" id="Database" order="3" />
190 233
       <window_info anchor="bottom" id="Database Changes" order="8" show_stripe_button="false" />
191 234
       <window_info anchor="bottom" id="Version Control" order="9" />
192 235
       <window_info anchor="bottom" id="Run" order="2" />
193 236
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
194
-      <window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.89343166" visible="true" weight="0.44507846" />
237
+      <window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.89745307" visible="true" weight="0.47075605" />
195 238
       <window_info id="Favorites" order="2" side_tool="true" />
196 239
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
197 240
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -250,9 +293,6 @@
250 293
       <provider selected="true" editor-type-id="text-editor">
251 294
         <state relative-caret-position="10274">
252 295
           <caret line="473" column="124" selection-start-line="473" selection-start-column="124" selection-end-line="473" selection-end-column="124" />
253
-          <folding>
254
-            <element signature="e#35#139#0" expanded="true" />
255
-          </folding>
256 296
         </state>
257 297
       </provider>
258 298
     </entry>
@@ -312,9 +352,6 @@
312 352
       <provider selected="true" editor-type-id="text-editor">
313 353
         <state relative-caret-position="10406">
314 354
           <caret line="473" column="124" selection-start-line="473" selection-start-column="124" selection-end-line="473" selection-end-column="124" />
315
-          <folding>
316
-            <element signature="e#35#139#0" expanded="true" />
317
-          </folding>
318 355
         </state>
319 356
       </provider>
320 357
     </entry>
@@ -367,9 +404,6 @@
367 404
       <provider selected="true" editor-type-id="text-editor">
368 405
         <state relative-caret-position="10274">
369 406
           <caret line="473" column="124" selection-start-line="473" selection-start-column="67" selection-end-line="473" selection-end-column="124" />
370
-          <folding>
371
-            <element signature="e#35#139#0" expanded="true" />
372
-          </folding>
373 407
         </state>
374 408
       </provider>
375 409
     </entry>
@@ -506,13 +540,6 @@
506 540
         </state>
507 541
       </provider>
508 542
     </entry>
509
-    <entry file="file://$PROJECT_DIR$/routers/router.go">
510
-      <provider selected="true" editor-type-id="text-editor">
511
-        <state relative-caret-position="506">
512
-          <caret line="23" column="54" selection-start-line="23" selection-start-column="17" selection-end-line="23" selection-end-column="54" />
513
-        </state>
514
-      </provider>
515
-    </entry>
516 543
     <entry file="file://$PROJECT_DIR$/models/dialysis.go">
517 544
       <provider selected="true" editor-type-id="text-editor">
518 545
         <state relative-caret-position="220">
@@ -527,13 +554,6 @@
527 554
         </state>
528 555
       </provider>
529 556
     </entry>
530
-    <entry file="file://$PROJECT_DIR$/conf/app.conf">
531
-      <provider selected="true" editor-type-id="text-editor">
532
-        <state>
533
-          <caret column="12" selection-start-column="12" selection-end-column="12" />
534
-        </state>
535
-      </provider>
536
-    </entry>
537 557
     <entry file="file://$PROJECT_DIR$/models/admin_models/admin_models.go">
538 558
       <provider selected="true" editor-type-id="text-editor">
539 559
         <state relative-caret-position="330">
@@ -548,51 +568,65 @@
548 568
         </state>
549 569
       </provider>
550 570
     </entry>
551
-    <entry file="file://$PROJECT_DIR$/service/admin_service.go">
571
+    <entry file="file://$PROJECT_DIR$/routers/router.go">
552 572
       <provider selected="true" editor-type-id="text-editor">
553
-        <state relative-caret-position="9636">
554
-          <caret line="444" selection-start-line="444" selection-end-line="444" />
555
-          <folding>
556
-            <element signature="e#35#139#0" expanded="true" />
557
-          </folding>
573
+        <state relative-caret-position="104">
574
+          <caret line="12" column="80" selection-start-line="12" selection-start-column="71" selection-end-line="12" selection-end-column="80" />
558 575
         </state>
559 576
       </provider>
560 577
     </entry>
561
-    <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
578
+    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/analysis_api_controller.go">
562 579
       <provider selected="true" editor-type-id="text-editor">
563
-        <state relative-caret-position="329">
564
-          <caret line="531" column="36" selection-start-line="531" selection-start-column="36" selection-end-line="531" selection-end-column="36" />
580
+        <state relative-caret-position="437">
581
+          <caret line="427" selection-start-line="427" selection-end-line="427" />
565 582
         </state>
566 583
       </provider>
567 584
     </entry>
568
-    <entry file="file://$PROJECT_DIR$/service/function_service.go">
585
+    <entry file="file://$PROJECT_DIR$/conf/app.conf">
569 586
       <provider selected="true" editor-type-id="text-editor">
570
-        <state relative-caret-position="264">
571
-          <caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
587
+        <state>
588
+          <caret column="12" selection-start-column="12" selection-end-column="12" />
589
+        </state>
590
+      </provider>
591
+    </entry>
592
+    <entry file="file://$PROJECT_DIR$/models/function_models/fuction_query_models.go">
593
+      <provider selected="true" editor-type-id="text-editor">
594
+        <state relative-caret-position="471">
595
+          <caret line="513" column="13" selection-start-line="513" selection-start-column="13" selection-end-line="513" selection-end-column="13" />
572 596
         </state>
573 597
       </provider>
574 598
     </entry>
575 599
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_router_register.go">
576 600
       <provider selected="true" editor-type-id="text-editor">
577
-        <state relative-caret-position="1694">
578
-          <caret line="80" column="81" selection-start-line="80" selection-start-column="56" selection-end-line="80" selection-end-column="81" />
601
+        <state relative-caret-position="388">
602
+          <caret line="95" selection-start-line="95" selection-end-line="95" />
579 603
           <folding>
580 604
             <element signature="e#34#79#0" expanded="true" />
581 605
           </folding>
582 606
         </state>
583 607
       </provider>
584 608
     </entry>
585
-    <entry file="file://$PROJECT_DIR$/controllers/admin_api_controllers/analysis_api_controller.go">
609
+    <entry file="file://$PROJECT_DIR$/service/admin_service.go">
586 610
       <provider selected="true" editor-type-id="text-editor">
587
-        <state relative-caret-position="9240">
588
-          <caret line="427" selection-start-line="427" selection-end-line="427" />
611
+        <state relative-caret-position="572">
612
+          <caret line="34" column="1" selection-start-line="34" selection-start-column="1" selection-end-line="34" selection-end-column="1" />
589 613
         </state>
590 614
       </provider>
591 615
     </entry>
592 616
     <entry file="file://$PROJECT_DIR$/controllers/function_api_controllers/function_api_base_controller.go">
593 617
       <provider selected="true" editor-type-id="text-editor">
594
-        <state relative-caret-position="273">
595
-          <caret line="3065" column="22" selection-start-line="3065" selection-start-column="22" selection-end-line="3065" selection-end-column="22" />
618
+        <state relative-caret-position="168">
619
+          <caret line="3556" column="51" selection-start-line="3556" selection-start-column="35" selection-end-line="3556" selection-end-column="51" />
620
+        </state>
621
+      </provider>
622
+    </entry>
623
+    <entry file="file://$PROJECT_DIR$/service/function_service.go">
624
+      <provider selected="true" editor-type-id="text-editor">
625
+        <state relative-caret-position="228">
626
+          <caret line="149" column="219" selection-start-line="149" selection-start-column="219" selection-end-line="149" selection-end-column="219" />
627
+          <folding>
628
+            <element signature="e#17#73#0" expanded="true" />
629
+          </folding>
596 630
         </state>
597 631
       </provider>
598 632
     </entry>

BIN
XT_Admin_Api.exe Ver fichero


+ 499 - 0
controllers/function_api_controllers/function_api_base_controller.go Ver fichero

@@ -3065,4 +3065,503 @@ func  (this *FunctionBaseAPIController) GetYesterdayEntrylist()  {
3065 3065
 		"userorg":userorg,
3066 3066
 		"total":total,
3067 3067
 	})
3068
+}
3069
+
3070
+func (this *FunctionBaseAPIController) GetWeekEntrylist()  {
3071
+	range_data := this.GetString("range_data")
3072
+	fmt.Println("本日出库单",range_data)
3073
+	page, _ := this.GetInt64("page", 1)
3074
+	fmt.Println("页面",page)
3075
+	limit, _ := this.GetInt64("limit", 10)
3076
+	fmt.Println("limit",limit)
3077
+	if page <= 0 {
3078
+		page = 1
3079
+	}
3080
+	if limit <= 0 {
3081
+		limit = 10
3082
+	}
3083
+	var rangeDate *time.Time
3084
+	var parseDateErr error
3085
+	var rangeTimeStamp int64
3086
+
3087
+	if len(range_data) > 0 {
3088
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3089
+		if parseDateErr != nil {
3090
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3091
+			return
3092
+		}
3093
+		rangeTimeStamp = rangeDate.Unix()
3094
+	} else {
3095
+		rangeTimeStamp = 0
3096
+	}
3097
+	now := time.Now().Unix()
3098
+	userorg, total, err := service.GetTodayEntrylist(rangeTimeStamp, now, limit, page)
3099
+	//3代表血透,2//退出登录状态
3100
+	//userorgs, err := service.GetTodayLogout(0, 2)
3101
+	//fmt.Scan("userorgs是什么",userorgs)
3102
+	fmt.Println("userorg是什么",userorg)
3103
+	fmt.Println("err",err)
3104
+	fmt.Println("total是什么",total)
3105
+	if err !=nil{
3106
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3107
+		return
3108
+	}
3109
+	this.ServeSuccessJSON(map[string]interface{}{
3110
+		"userorg":userorg,
3111
+		"total":total,
3112
+	})
3113
+}
3114
+
3115
+func (this *FunctionBaseAPIController) GetMonthEntrylist()  {
3116
+	range_data := this.GetString("range_data")
3117
+	fmt.Println("本日出库单",range_data)
3118
+	page, _ := this.GetInt64("page", 1)
3119
+	fmt.Println("页面",page)
3120
+	limit, _ := this.GetInt64("limit", 10)
3121
+	fmt.Println("limit",limit)
3122
+	if page <= 0 {
3123
+		page = 1
3124
+	}
3125
+	if limit <= 0 {
3126
+		limit = 10
3127
+	}
3128
+	var rangeDate *time.Time
3129
+	var parseDateErr error
3130
+	var rangeTimeStamp int64
3131
+
3132
+	if len(range_data) > 0 {
3133
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3134
+		if parseDateErr != nil {
3135
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3136
+			return
3137
+		}
3138
+		rangeTimeStamp = rangeDate.Unix()
3139
+	} else {
3140
+		rangeTimeStamp = 0
3141
+	}
3142
+	now := time.Now().Unix()
3143
+	userorg, total, err := service.GetTodayEntrylist(rangeTimeStamp, now, limit, page)
3144
+	//3代表血透,2//退出登录状态
3145
+	//userorgs, err := service.GetTodayLogout(0, 2)
3146
+	//fmt.Scan("userorgs是什么",userorgs)
3147
+	fmt.Println("userorg是什么",userorg)
3148
+	fmt.Println("err",err)
3149
+	fmt.Println("total是什么",total)
3150
+	if err !=nil{
3151
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3152
+		return
3153
+	}
3154
+	this.ServeSuccessJSON(map[string]interface{}{
3155
+		"userorg":userorg,
3156
+		"total":total,
3157
+	})
3158
+}
3159
+
3160
+func (this *FunctionBaseAPIController) GetThreeMonthEntrylist()  {
3161
+	range_data := this.GetString("range_data")
3162
+	fmt.Println("本日出库单",range_data)
3163
+	page, _ := this.GetInt64("page", 1)
3164
+	fmt.Println("页面",page)
3165
+	limit, _ := this.GetInt64("limit", 10)
3166
+	fmt.Println("limit",limit)
3167
+	if page <= 0 {
3168
+		page = 1
3169
+	}
3170
+	if limit <= 0 {
3171
+		limit = 10
3172
+	}
3173
+	var rangeDate *time.Time
3174
+	var parseDateErr error
3175
+	var rangeTimeStamp int64
3176
+
3177
+	if len(range_data) > 0 {
3178
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3179
+		if parseDateErr != nil {
3180
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3181
+			return
3182
+		}
3183
+		rangeTimeStamp = rangeDate.Unix()
3184
+	} else {
3185
+		rangeTimeStamp = 0
3186
+	}
3187
+	now := time.Now().Unix()
3188
+	userorg, total, err := service.GetTodayEntrylist(rangeTimeStamp, now, limit, page)
3189
+	//3代表血透,2//退出登录状态
3190
+	//userorgs, err := service.GetTodayLogout(0, 2)
3191
+	//fmt.Scan("userorgs是什么",userorgs)
3192
+	fmt.Println("userorg是什么",userorg)
3193
+	fmt.Println("err",err)
3194
+	fmt.Println("total是什么",total)
3195
+	if err !=nil{
3196
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3197
+		return
3198
+	}
3199
+	this.ServeSuccessJSON(map[string]interface{}{
3200
+		"userorg":userorg,
3201
+		"total":total,
3202
+	})
3203
+}
3204
+
3205
+func (this *FunctionBaseAPIController)  GetHalfYearEntrylist()  {
3206
+	range_data := this.GetString("range_data")
3207
+	fmt.Println("本日出库单",range_data)
3208
+	page, _ := this.GetInt64("page", 1)
3209
+	fmt.Println("页面",page)
3210
+	limit, _ := this.GetInt64("limit", 10)
3211
+	fmt.Println("limit",limit)
3212
+	if page <= 0 {
3213
+		page = 1
3214
+	}
3215
+	if limit <= 0 {
3216
+		limit = 10
3217
+	}
3218
+	var rangeDate *time.Time
3219
+	var parseDateErr error
3220
+	var rangeTimeStamp int64
3221
+
3222
+	if len(range_data) > 0 {
3223
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3224
+		if parseDateErr != nil {
3225
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3226
+			return
3227
+		}
3228
+		rangeTimeStamp = rangeDate.Unix()
3229
+	} else {
3230
+		rangeTimeStamp = 0
3231
+	}
3232
+	now := time.Now().Unix()
3233
+	userorg, total, err := service.GetTodayEntrylist(rangeTimeStamp, now, limit, page)
3234
+	//3代表血透,2//退出登录状态
3235
+	//userorgs, err := service.GetTodayLogout(0, 2)
3236
+	//fmt.Scan("userorgs是什么",userorgs)
3237
+	fmt.Println("userorg是什么",userorg)
3238
+	fmt.Println("err",err)
3239
+	fmt.Println("total是什么",total)
3240
+	if err !=nil{
3241
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3242
+		return
3243
+	}
3244
+	this.ServeSuccessJSON(map[string]interface{}{
3245
+		"userorg":userorg,
3246
+		"total":total,
3247
+	})
3248
+}
3249
+
3250
+func  (this *FunctionBaseAPIController) GetYearEntrylist()  {
3251
+	range_data := this.GetString("range_data")
3252
+	fmt.Println("本日出库单",range_data)
3253
+	page, _ := this.GetInt64("page", 1)
3254
+	fmt.Println("页面",page)
3255
+	limit, _ := this.GetInt64("limit", 10)
3256
+	fmt.Println("limit",limit)
3257
+	if page <= 0 {
3258
+		page = 1
3259
+	}
3260
+	if limit <= 0 {
3261
+		limit = 10
3262
+	}
3263
+	var rangeDate *time.Time
3264
+	var parseDateErr error
3265
+	var rangeTimeStamp int64
3266
+
3267
+	if len(range_data) > 0 {
3268
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3269
+		if parseDateErr != nil {
3270
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3271
+			return
3272
+		}
3273
+		rangeTimeStamp = rangeDate.Unix()
3274
+	} else {
3275
+		rangeTimeStamp = 0
3276
+	}
3277
+	now := time.Now().Unix()
3278
+	userorg, total, err := service.GetTodayEntrylist(rangeTimeStamp, now, limit, page)
3279
+	//3代表血透,2//退出登录状态
3280
+	//userorgs, err := service.GetTodayLogout(0, 2)
3281
+	//fmt.Scan("userorgs是什么",userorgs)
3282
+	fmt.Println("userorg是什么",userorg)
3283
+	fmt.Println("err",err)
3284
+	fmt.Println("total是什么",total)
3285
+	if err !=nil{
3286
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3287
+		return
3288
+	}
3289
+	this.ServeSuccessJSON(map[string]interface{}{
3290
+		"userorg":userorg,
3291
+		"total":total,
3292
+	})
3293
+}
3294
+
3295
+func (this *FunctionBaseAPIController) GetTodayExitlist()  {
3296
+	range_data := this.GetString("range_data")
3297
+	fmt.Println("本日出库单",range_data)
3298
+	page, _ := this.GetInt64("page", 1)
3299
+	fmt.Println("页面",page)
3300
+	limit, _ := this.GetInt64("limit", 10)
3301
+	fmt.Println("limit",limit)
3302
+	if page <= 0 {
3303
+		page = 1
3304
+	}
3305
+	if limit <= 0 {
3306
+		limit = 10
3307
+	}
3308
+	var rangeDate *time.Time
3309
+	var parseDateErr error
3310
+	var rangeTimeStamp int64
3311
+
3312
+	if len(range_data) > 0 {
3313
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3314
+		if parseDateErr != nil {
3315
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3316
+			return
3317
+		}
3318
+		rangeTimeStamp = rangeDate.Unix()
3319
+	} else {
3320
+		rangeTimeStamp = 0
3321
+	}
3322
+	now := time.Now().Unix()
3323
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3324
+	if err !=nil{
3325
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3326
+		return
3327
+	}
3328
+	this.ServeSuccessJSON(map[string]interface{}{
3329
+		"userorg":userorg,
3330
+		"total":total,
3331
+	})
3332
+}
3333
+
3334
+func (this *FunctionBaseAPIController) GetYesterdayExitlist()  {
3335
+	range_data := this.GetString("range_data")
3336
+	fmt.Println("本日出库单",range_data)
3337
+	page, _ := this.GetInt64("page", 1)
3338
+	fmt.Println("页面",page)
3339
+	limit, _ := this.GetInt64("limit", 10)
3340
+	fmt.Println("limit",limit)
3341
+	if page <= 0 {
3342
+		page = 1
3343
+	}
3344
+	if limit <= 0 {
3345
+		limit = 10
3346
+	}
3347
+	var rangeDate *time.Time
3348
+	var parseDateErr error
3349
+	var rangeTimeStamp int64
3350
+
3351
+	if len(range_data) > 0 {
3352
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3353
+		if parseDateErr != nil {
3354
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3355
+			return
3356
+		}
3357
+		rangeTimeStamp = rangeDate.Unix()
3358
+	} else {
3359
+		rangeTimeStamp = 0
3360
+	}
3361
+	now := time.Now().Unix()
3362
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3363
+	if err !=nil{
3364
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3365
+		return
3366
+	}
3367
+	this.ServeSuccessJSON(map[string]interface{}{
3368
+		"userorg":userorg,
3369
+		"total":total,
3370
+	})
3371
+}
3372
+
3373
+func (this *FunctionBaseAPIController) GetWeekExitlist()  {
3374
+	range_data := this.GetString("range_data")
3375
+	fmt.Println("本日出库单",range_data)
3376
+	page, _ := this.GetInt64("page", 1)
3377
+	fmt.Println("页面",page)
3378
+	limit, _ := this.GetInt64("limit", 10)
3379
+	fmt.Println("limit",limit)
3380
+	if page <= 0 {
3381
+		page = 1
3382
+	}
3383
+	if limit <= 0 {
3384
+		limit = 10
3385
+	}
3386
+	var rangeDate *time.Time
3387
+	var parseDateErr error
3388
+	var rangeTimeStamp int64
3389
+
3390
+	if len(range_data) > 0 {
3391
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3392
+		if parseDateErr != nil {
3393
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3394
+			return
3395
+		}
3396
+		rangeTimeStamp = rangeDate.Unix()
3397
+	} else {
3398
+		rangeTimeStamp = 0
3399
+	}
3400
+	now := time.Now().Unix()
3401
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3402
+	if err !=nil{
3403
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3404
+		return
3405
+	}
3406
+	this.ServeSuccessJSON(map[string]interface{}{
3407
+		"userorg":userorg,
3408
+		"total":total,
3409
+	})
3410
+}
3411
+
3412
+func (this *FunctionBaseAPIController) GetMonthExitlist()  {
3413
+	range_data := this.GetString("range_data")
3414
+	fmt.Println("本日出库单",range_data)
3415
+	page, _ := this.GetInt64("page", 1)
3416
+	fmt.Println("页面",page)
3417
+	limit, _ := this.GetInt64("limit", 10)
3418
+	fmt.Println("limit",limit)
3419
+	if page <= 0 {
3420
+		page = 1
3421
+	}
3422
+	if limit <= 0 {
3423
+		limit = 10
3424
+	}
3425
+	var rangeDate *time.Time
3426
+	var parseDateErr error
3427
+	var rangeTimeStamp int64
3428
+
3429
+	if len(range_data) > 0 {
3430
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3431
+		if parseDateErr != nil {
3432
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3433
+			return
3434
+		}
3435
+		rangeTimeStamp = rangeDate.Unix()
3436
+	} else {
3437
+		rangeTimeStamp = 0
3438
+	}
3439
+	now := time.Now().Unix()
3440
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3441
+	if err !=nil{
3442
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3443
+		return
3444
+	}
3445
+	this.ServeSuccessJSON(map[string]interface{}{
3446
+		"userorg":userorg,
3447
+		"total":total,
3448
+	})
3449
+}
3450
+
3451
+func (this *FunctionBaseAPIController) GetThreeMonthExitlist()  {
3452
+	range_data := this.GetString("range_data")
3453
+	fmt.Println("本日出库单",range_data)
3454
+	page, _ := this.GetInt64("page", 1)
3455
+	fmt.Println("页面",page)
3456
+	limit, _ := this.GetInt64("limit", 10)
3457
+	fmt.Println("limit",limit)
3458
+	if page <= 0 {
3459
+		page = 1
3460
+	}
3461
+	if limit <= 0 {
3462
+		limit = 10
3463
+	}
3464
+	var rangeDate *time.Time
3465
+	var parseDateErr error
3466
+	var rangeTimeStamp int64
3467
+
3468
+	if len(range_data) > 0 {
3469
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3470
+		if parseDateErr != nil {
3471
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3472
+			return
3473
+		}
3474
+		rangeTimeStamp = rangeDate.Unix()
3475
+	} else {
3476
+		rangeTimeStamp = 0
3477
+	}
3478
+	now := time.Now().Unix()
3479
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3480
+	if err !=nil{
3481
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3482
+		return
3483
+	}
3484
+	this.ServeSuccessJSON(map[string]interface{}{
3485
+		"userorg":userorg,
3486
+		"total":total,
3487
+	})
3488
+}
3489
+
3490
+func (this *FunctionBaseAPIController) GetHalfExitlist()  {
3491
+	range_data := this.GetString("range_data")
3492
+	fmt.Println("本日出库单",range_data)
3493
+	page, _ := this.GetInt64("page", 1)
3494
+	fmt.Println("页面",page)
3495
+	limit, _ := this.GetInt64("limit", 10)
3496
+	fmt.Println("limit",limit)
3497
+	if page <= 0 {
3498
+		page = 1
3499
+	}
3500
+	if limit <= 0 {
3501
+		limit = 10
3502
+	}
3503
+	var rangeDate *time.Time
3504
+	var parseDateErr error
3505
+	var rangeTimeStamp int64
3506
+
3507
+	if len(range_data) > 0 {
3508
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3509
+		if parseDateErr != nil {
3510
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3511
+			return
3512
+		}
3513
+		rangeTimeStamp = rangeDate.Unix()
3514
+	} else {
3515
+		rangeTimeStamp = 0
3516
+	}
3517
+	now := time.Now().Unix()
3518
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3519
+	if err !=nil{
3520
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3521
+		return
3522
+	}
3523
+	this.ServeSuccessJSON(map[string]interface{}{
3524
+		"userorg":userorg,
3525
+		"total":total,
3526
+	})
3527
+}
3528
+
3529
+func (this *FunctionBaseAPIController) GetYearExitlist()  {
3530
+	range_data := this.GetString("range_data")
3531
+	fmt.Println("本日出库单",range_data)
3532
+	page, _ := this.GetInt64("page", 1)
3533
+	fmt.Println("页面",page)
3534
+	limit, _ := this.GetInt64("limit", 10)
3535
+	fmt.Println("limit",limit)
3536
+	if page <= 0 {
3537
+		page = 1
3538
+	}
3539
+	if limit <= 0 {
3540
+		limit = 10
3541
+	}
3542
+	var rangeDate *time.Time
3543
+	var parseDateErr error
3544
+	var rangeTimeStamp int64
3545
+
3546
+	if len(range_data) > 0 {
3547
+		rangeDate, parseDateErr = utils.ParseTimeStringToTime("2006-01-02", range_data)
3548
+		if parseDateErr != nil {
3549
+			this.ErrorLog("日期(%v)解析错误:%v", range_data, parseDateErr)
3550
+			return
3551
+		}
3552
+		rangeTimeStamp = rangeDate.Unix()
3553
+	} else {
3554
+		rangeTimeStamp = 0
3555
+	}
3556
+	now := time.Now().Unix()
3557
+	userorg, total, err := service.GetTodayExitlist(rangeTimeStamp, now, limit, page)
3558
+	fmt.Println("错误是什么",err)
3559
+	if err !=nil{
3560
+		this.ServeFailJsonSend(enums.ErrorCodeDataException, "更改数据失败")
3561
+		return
3562
+	}
3563
+	this.ServeSuccessJSON(map[string]interface{}{
3564
+		"userorg":userorg,
3565
+		"total":total,
3566
+	})
3068 3567
 }

+ 13 - 0
controllers/function_api_controllers/function_api_router_register.go Ver fichero

@@ -79,6 +79,19 @@ func FunctionAPIControllersRegisterRouters() {
79 79
 	beego.Router("/api/function/getYearPostAssessment",&FunctionBaseAPIController{},"Get:GetYearPostAssessment")
80 80
 	beego.Router("/api/function/gettodayentrylist",&FunctionBaseAPIController{},"Get:GetTodayEntrylist")
81 81
 	beego.Router("/api/function/getyesterdayentrylist",&FunctionBaseAPIController{},"Get:GetYesterdayEntrylist")
82
+	beego.Router("/api/function/getweekentrylist",&FunctionBaseAPIController{},"Get:GetWeekEntrylist")
83
+	beego.Router("/api/function/getmonthentrylist",&FunctionBaseAPIController{},"Get:GetMonthEntrylist")
84
+	beego.Router("/api/function/getthreemonthlist",&FunctionBaseAPIController{},"Get:GetThreeMonthEntrylist")
85
+	beego.Router("/api/function/gethalfentrylsit",&FunctionBaseAPIController{},"Get:GetHalfYearEntrylist")
86
+	beego.Router("/api/function/getyearentrylist",&FunctionBaseAPIController{},"Get:GetYearEntrylist")
87
+	beego.Router("/api/function/gettodayexitlist",&FunctionBaseAPIController{},"Get:GetTodayExitlist")
88
+	beego.Router("/api/function/getyestrdayexitlist",&FunctionBaseAPIController{},"Get:GetYesterdayExitlist")
89
+	beego.Router("/api/function/getweekexitlist",&FunctionBaseAPIController{},"Get:GetWeekExitlist")
90
+	beego.Router("/api/function/getmonthexitlist",&FunctionBaseAPIController{},"Get:GetMonthExitlist")
91
+	beego.Router("/api/function/getthreemonthexitlist",&FunctionBaseAPIController{},"Get:GetThreeMonthExitlist")
92
+	beego.Router("/api/function/gethalfexitlist",&FunctionBaseAPIController{},"Get:GetHalfExitlist")
93
+	beego.Router("/api/function/getyearexitlist",&FunctionBaseAPIController{},"Get:GetYearExitlist")
94
+
82 95
 
83 96
 
84 97
 }

+ 34 - 2
models/function_models/fuction_query_models.go Ver fichero

@@ -511,10 +511,14 @@ func (XtAssessmentAfterDislysis) TableName() string {
511 511
 }
512 512
 
513 513
 type PatientInfo struct {
514
+	ID  int64
514 515
 	OrgName string
515
-	Name  string
516
+	Name string
516 517
     Ctime string
517 518
     Address string
519
+	ContactName string
520
+
521
+
518 522
 }
519 523
 
520 524
 type SgjUserAdminLoginLog struct {
@@ -534,4 +538,32 @@ func (SgjUserAdminLoginLog) TableName() string {
534 538
 
535 539
 type Logout struct {
536 540
 	Ctime int64
537
-} 
541
+}
542
+
543
+type SgjOrgFollow struct {
544
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
545
+	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
546
+	AdminUserId int64 `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
547
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
548
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
549
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
550
+}
551
+
552
+func (SgjOrgFollow) TableName() string {
553
+	return "sgj_org_follow"
554
+}
555
+
556
+type SgjAdmin struct {
557
+	ID int64 `gorm:"column:id" json:"id" form:"id"`
558
+	Account string `gorm:"column:account" json:"account" form:"account"`
559
+	Pwd string `gorm:"column:pwd" json:"pwd" form:"pwd"`
560
+	Status int64 `gorm:"column:status" json:"status" form:"status"`
561
+	Ctime int64 `gorm:"column:ctime" json:"ctime" form:"ctime"`
562
+	Mtime int64 `gorm:"column:mtime" json:"mtime" form:"mtime"`
563
+	IsSuperAdmin int64 `gorm:"column:is_super_admin" json:"is_super_admin" form:"is_super_admin"`
564
+	Name string `gorm:"column:name" json:"name" form:"name"`
565
+}
566
+func (SgjAdmin) TableName() string {
567
+	return "sgj_admin"
568
+}
569
+

+ 20 - 16
service/function_service.go Ver fichero

@@ -9,7 +9,7 @@ import (
9 9
 func GetTodayInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
10 10
 
11 11
 	offset := (page - 1) * limit
12
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
12
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
13 13
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_patients as x on x.user_org_id = u.id where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
14 14
 	fmt.Println("rows是什么",rows)
15 15
 	if rows.Next() {
@@ -23,7 +23,7 @@ func GetTodayInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []fun
23 23
 func GetTodayDialysisPatientsInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
24 24
 
25 25
 	offset := (page - 1) * limit
26
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
26
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
27 27
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_prescription as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
28 28
 	if rows.Next() {
29 29
 		rows.Scan(&total)
@@ -37,7 +37,7 @@ func GetTodayDialysisPatientsInfo(to int64,ctime int64,page int64,limit int64)(p
37 37
 func GetTodayReceivePatientsInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
38 38
 
39 39
 	offset := (page - 1) * limit
40
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
40
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u  join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
41 41
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_receive_treatment_asses as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
42 42
 	if rows.Next() {
43 43
 		rows.Scan(&total)
@@ -48,7 +48,7 @@ func GetTodayReceivePatientsInfo(to int64,ctime int64,page int64,limit int64)(pa
48 48
 // 透前评估
49 49
 func GetTodayBeforDislysisInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
50 50
 	offset := (page - 1) * limit
51
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
51
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
52 52
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_before_dislysis as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
53 53
 	if rows.Next() {
54 54
 		rows.Scan(&total)
@@ -62,7 +62,7 @@ func GetTodayDoctorsOrderInfo(to int64,ctime int64,page int64,limit int64)(patie
62 62
 
63 63
 
64 64
 	offset := (page - 1) * limit
65
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
65
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
66 66
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_doctor_advice as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
67 67
 	if rows.Next() {
68 68
 		rows.Scan(&total)
@@ -74,7 +74,7 @@ func GetTodayDoctorsOrderInfo(to int64,ctime int64,page int64,limit int64)(patie
74 74
 func GetTodayDoubleCheckInfo(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
75 75
 
76 76
 	offset := (page - 1) * limit
77
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_double_check as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
77
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_double_check as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
78 78
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_double_check as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
79 79
 	if rows.Next() {
80 80
 		rows.Scan(&total)
@@ -86,7 +86,7 @@ func GetTodayDoubleCheckInfo(to int64,ctime int64,page int64,limit int64)(patien
86 86
 func GetTodayDialysisMachinek(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
87 87
 
88 88
 	offset := (page - 1) * limit
89
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
89
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
90 90
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
91 91
 	if rows.Next() {
92 92
 		rows.Scan(&total)
@@ -99,7 +99,7 @@ func GetTodayDialysisMachinek(to int64,ctime int64,page int64,limit int64)(patie
99 99
 func GetTodayDialysisExamination(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error) {
100 100
 
101 101
 	offset := (page - 1) * limit
102
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
102
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
103 103
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_monitoring_record as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
104 104
 	if rows.Next() {
105 105
 		rows.Scan(&total)
@@ -112,7 +112,7 @@ func GetTodayDialysisExamination(to int64,ctime int64,page int64,limit int64)(pa
112 112
 func GetTodayBeforOrpenetration(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
113 113
 
114 114
 	offset := (page - 1) * limit
115
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
115
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
116 116
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_dialysis_order as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
117 117
 	if rows.Next() {
118 118
 		rows.Scan(&total)
@@ -124,7 +124,7 @@ func GetTodayBeforOrpenetration(to int64,ctime int64,page int64,limit int64)(pat
124 124
 //透后评估
125 125
 func GetTodayPostAssessment(to int64,ctime int64,page int64,limit int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
126 126
 	offset := (page - 1) * limit
127
-	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ?",to,ctime).Scan(&patientinfo).Error
127
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.patient_id  where x.created_time >= ? AND x.created_time <= ? GROUP BY x.user_org_id",to,ctime).Scan(&patientinfo).Error
128 128
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_assessment_after_dislysis as x on x.user_org_id = u.id  where x.created_time >= ? AND x.created_time <= ?", to, ctime).Rows()
129 129
 	if rows.Next() {
130 130
 		rows.Scan(&total)
@@ -135,7 +135,7 @@ func GetTodayPostAssessment(to int64,ctime int64,page int64,limit int64)(patient
135 135
 
136 136
 func GetTodayEntrylist(to int64,ctime int64,limit int64,page int64)(patientinfo []function_models.PatientInfo,total int64, err error)  {
137 137
 	 offset := (page - 1) * limit
138
-	 err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse as x on x.org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.creater where x.warehousing_time >= ? AND x.warehousing_time<= ?",to,ctime).Scan(&patientinfo).Error
138
+	 err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id  join sgj_xt.xt_warehouse as x on x.org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.creater  where x.warehousing_time >= ? AND x.warehousing_time<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
139 139
 	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse as x on x.org_id = u.id where x.warehousing_time >= ? AND x.warehousing_time <= ?", to, ctime).Rows()
140 140
 	if rows.Next() {
141 141
 		rows.Scan(&total)
@@ -144,8 +144,12 @@ func GetTodayEntrylist(to int64,ctime int64,limit int64,page int64)(patientinfo
144 144
 	return patientinfo,total,err
145 145
 }
146 146
 
147
-//func GetTodayLogout(apptype int64,oppratetype int64)(userorg []function_models.SgjUserOrg,err error) {
148
-//
149
-//	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_users.sgj_user_admin_login_log as l on l.org_id = u.id where l.operate_type = ? AND l.app_type = ?", oppratetype, apptype).Scan(&userorg).Error
150
-//	return userorg,err
151
-//}
147
+func GetTodayExitlist(to int64,ctime int64,limit int64,page int64)(patientinfo []function_models.PatientInfo,total int64,err error)  {
148
+	offset := (page - 1) * limit
149
+	err = readUserDb.Raw("select * from sgj_users.sgj_user_org as u join sgj_org_follow as f On f.org_id = u.id JoIN sgj_admin as a On a.id = f.admin_user_id  join sgj_xt.xt_warehouse_out as x on x.org_id = u.id JOIN sgj_xt.xt_patients as p On p.id = x.creater  where x.warehouse_out_time >= ? AND x.warehouse_out_time<= ? GROUP BY x.org_id",to,ctime).Scan(&patientinfo).Error
150
+	rows, err := readUserDb.Offset(offset).Limit(limit).Raw("select Count(1) from sgj_users.sgj_user_org as u join sgj_xt.xt_warehouse_out as x on x.org_id = u.id where x.warehouse_out_time >= ? AND x.warehouse_out_time <= ?", to, ctime).Rows()
151
+	if rows.Next() {
152
+		rows.Scan(&total)
153
+	}
154
+	return patientinfo,total,err
155
+}