Browse Source

覆盖率

WH01243 2 years ago
parent
commit
9439b5f4e8
6 changed files with 191 additions and 1188 deletions
  1. 2 2
      Makefile
  2. 130 130
      doc/test_cover.out
  3. 17 0
      service/AuthService_test.go
  4. 42 0
      service/InstitutionService_test.go
  5. 0 64
      service/coverage
  6. 0 992
      service/coverage.html

+ 2 - 2
Makefile

@@ -64,10 +64,10 @@ build_rpc_win:
 #单元测试覆盖率
 cover_out:
 	@echo "===========> Run go test "
-	cd service/ &&  go test -v -covermode=count -coverprofile=test_cover.out
+	cd service/ &&  go test -v -covermode=count -coverprofile=../doc/test_cover.out
 cover_html:
 	@echo "===========> Run go test "
-	cd service/ &&   go tool cover -html=test_cover.out -o ../doc/coverage.html
+	cd doc/ &&   go tool cover -html=test_cover.out -o coverage.html
 
 #清理
 clean:

+ 130 - 130
service/test_cover.out → doc/test_cover.out

@@ -1,134 +1,4 @@
 mode: count
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:22.76,27.17 2 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.2,37.34 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:27.17,28.32 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:28.32,30.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:31.8,32.35 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:32.35,34.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.34,49.10 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:49.10,51.4 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:51.9,54.4 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:55.8,70.74 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:95.3,95.17 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:70.74,72.16 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:78.4,88.38 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:93.4,93.18 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:72.16,76.5 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:88.38,92.5 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:100.82,106.2 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:21.93,29.2 5 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:32.111,45.23 10 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.2,57.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.2,62.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.2,67.24 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.2,72.25 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.2,77.31 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.2,82.26 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:88.2,90.22 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:93.2,102.49 8 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:123.2,126.18 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:129.2,133.44 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:149.2,149.8 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:45.23,47.31 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:47.31,48.60 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:48.60,50.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:50.10,52.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.22,60.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.22,65.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.24,70.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.25,75.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.31,80.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.26,86.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:90.22,92.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:102.49,105.40 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:105.40,106.15 1 14
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:109.4,112.60 4 14
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:117.4,117.52 1 14
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:106.15,108.5 1 13
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:112.60,114.5 1 14
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:114.10,116.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:120.8,122.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:126.18,128.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:133.44,134.35 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.3,142.36 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:134.35,135.44 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:135.44,140.5 4 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.36,144.4 1 12
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:145.8,148.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:153.111,166.23 10 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.2,177.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.2,182.22 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:187.2,189.20 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.2,194.27 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.2,199.26 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:202.2,203.22 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:206.2,215.49 8 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:236.2,238.18 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:241.2,244.44 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:259.2,259.8 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:166.23,168.31 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:168.31,169.60 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:169.60,171.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:171.10,173.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.22,180.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.22,185.3 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:189.20,192.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.27,197.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.26,201.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:203.22,205.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:215.49,218.40 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:218.40,219.15 1 7
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:222.4,225.60 4 7
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:230.4,230.55 1 7
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:219.15,221.5 1 6
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:225.60,227.5 1 7
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:227.10,229.5 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:232.8,234.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:238.18,240.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:244.44,245.35 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.3,253.36 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:245.35,246.44 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:246.44,251.5 4 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.36,255.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:256.8,258.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:269.122,277.46 3 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:280.2,280.31 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:283.2,283.21 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:277.46,279.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:280.31,282.3 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:287.152,289.28 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:318.2,318.24 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:289.28,293.35 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:293.35,297.31 3 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.4,301.40 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.4,305.34 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:309.4,309.32 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:297.31,299.5 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.40,303.5 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.34,307.5 1 6
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:309.32,311.33 2 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:314.5,314.104 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:311.33,313.6 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:18.57,22.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:25.71,26.65 1 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:29.2,29.90 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:26.65,28.3 1 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:33.90,43.32 3 4
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:47.2,55.99 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:43.32,46.3 2 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:59.96,68.2 2 6
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:71.126,82.16 5 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:85.2,85.115 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:82.16,84.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:89.126,99.16 5 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:102.2,102.115 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:99.16,101.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:106.82,107.19 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:110.2,112.46 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:107.19,109.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:116.86,117.19 1 3
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:120.2,122.35 3 2
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:117.19,119.3 1 1
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:28.54,32.2 1 1
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:39.98,41.37 1 3
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:45.2,51.36 2 0
@@ -195,3 +65,133 @@ bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:319.2,3
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:299.37,301.3 1 0
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:305.38,307.3 1 0
 bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:309.27,318.3 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:22.76,27.17 2 5
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.2,37.34 1 3
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:27.17,28.32 1 3
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:28.32,30.4 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:31.8,32.35 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:32.35,34.4 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:37.34,49.10 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:49.10,51.4 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:51.9,54.4 2 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:55.8,70.74 3 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:95.3,95.17 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:70.74,72.16 2 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:78.4,88.38 3 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:93.4,93.18 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:72.16,76.5 3 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:88.38,92.5 3 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:100.82,106.2 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:21.93,29.2 5 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:32.111,45.23 10 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.2,57.22 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.2,62.22 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.2,67.24 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.2,72.25 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.2,77.31 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.2,82.26 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:88.2,90.22 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:93.2,102.49 8 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:123.2,126.18 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:129.2,133.44 4 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:149.2,149.8 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:45.23,47.31 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:47.31,48.60 1 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:48.60,50.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:50.10,52.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:57.22,60.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:62.22,65.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:67.24,70.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:72.25,75.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:77.31,80.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:82.26,86.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:90.22,92.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:102.49,105.40 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:105.40,106.15 1 28
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:109.4,112.60 4 28
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:117.4,117.52 1 28
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:106.15,108.5 1 26
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:112.60,114.5 1 26
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:114.10,116.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:120.8,122.3 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:126.18,128.3 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:133.44,134.35 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.3,142.36 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:134.35,135.44 1 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:135.44,140.5 4 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:142.36,144.4 1 24
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:145.8,148.3 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:153.111,166.23 10 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.2,177.22 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.2,182.22 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:187.2,189.20 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.2,194.27 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.2,199.26 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:202.2,203.22 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:206.2,215.49 8 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:236.2,238.18 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:241.2,244.44 4 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:259.2,259.8 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:166.23,168.31 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:168.31,169.60 1 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:169.60,171.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:171.10,173.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:177.22,180.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:182.22,185.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:189.20,192.3 2 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:194.27,197.3 2 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:199.26,201.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:203.22,205.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:215.49,218.40 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:218.40,219.15 1 14
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:222.4,225.60 4 14
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:230.4,230.55 1 14
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:219.15,221.5 1 12
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:225.60,227.5 1 14
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:227.10,229.5 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:232.8,234.3 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:238.18,240.3 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:244.44,245.35 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.3,253.36 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:245.35,246.44 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:246.44,251.5 4 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:253.36,255.4 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:256.8,258.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:269.122,277.46 3 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:280.2,280.31 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:283.2,283.21 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:277.46,279.3 1 0
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:280.31,282.3 1 10
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:287.152,289.28 2 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:318.2,318.24 1 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:289.28,293.35 3 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:293.35,297.31 3 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.4,301.40 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.4,305.34 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:309.4,309.32 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:297.31,299.5 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:301.40,303.5 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:305.34,307.5 1 12
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:309.32,311.33 2 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:314.5,314.104 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:311.33,313.6 1 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:29.56,33.2 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:36.71,37.65 1 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:40.2,40.90 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:37.65,39.3 1 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:44.91,54.32 3 4
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:58.2,66.99 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:54.32,57.3 2 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:70.96,79.2 2 6
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:82.126,93.16 5 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:96.2,96.115 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:93.16,95.3 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:100.126,110.16 5 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:113.2,113.115 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:110.16,112.3 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:117.83,118.19 1 3
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:121.2,123.46 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:118.19,120.3 1 1
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:127.87,128.19 1 3
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:131.2,133.35 3 2
+bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:128.19,130.3 1 1

+ 17 - 0
service/AuthService_test.go

@@ -103,6 +103,23 @@ func TestAuthService_UserAuthInfoSave(t *testing.T) {
 				},
 			},
 		},
+		{
+			name: "用户未认证,不可修改",
+			args: args{
+				&medical.UserInfo{
+					UserId:        11,
+					Mail:          "qqq.com",
+					Phone:         "13111111111",
+					Name:          fmt.Sprintf("用户%d", rand.Int63n(1000)),
+					Position:      "经理",
+					Department:    "公关",
+					EntName:       "测试企业",
+					OperationType: "update",
+					Appid:         "10000",
+				},
+			},
+			want1: "用户未认证,不可修改",
+		},
 
 		{
 			name: "用户认证信息修改-未认证",

+ 42 - 0
service/InstitutionService_test.go

@@ -140,6 +140,26 @@ func TestInstitutionService_Institution(t *testing.T) {
 					Appid:            "10000",
 				}},
 		},
+		{
+			name: "医疗机构搜索",
+			args: args{
+				&medical.SearchInstitutionReq{
+					CompanyName: "医院",
+					AreaCode:    "{'河南':['郑州市','开封市'],'上海':[]}",
+					LevelCode:   "0104,0201,0202",
+					MiTypeCode:  "17,03",
+					SdequipmentCode: []*medical.Business_Scope{
+						{Key: []string{"装置"},
+							Appendkey: []string{},
+							Notkey:    []string{"1", "2"}},
+					},
+					BusinessTypeCode: "1",
+					NewUserId:        68819,
+					ResourceUseCount: int64(100),
+					Appid:            "10000",
+					Sort:             int64(1),
+				}},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
@@ -181,6 +201,28 @@ func TestInstitutionService_Distributor(t *testing.T) {
 					ResourceUseCount: int64(100),
 				}},
 		},
+		{
+			name: "经销商查询",
+			args: args{
+				&medical.SearchDistributorReq{
+					CompanyName: "公司",
+					AreaCode:    "{'河南':['郑州市','开封市'],'北京':[]}",
+					BusinessScope: []*medical.Business_Scope{
+						{Key: []string{"定制式义齿"},
+							Appendkey: []string{},
+							Notkey:    []string{"1", "2"}},
+						{Key: []string{"细胞保存液"},
+							Appendkey: []string{"释放剂"},
+							Notkey:    []string{"1", "2"}},
+					},
+					Brand:            "",
+					ProductModel:     "",
+					Appid:            "10000",
+					NewUserId:        68819,
+					ResourceUseCount: int64(100),
+					Sort:             int64(1),
+				}},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {

+ 0 - 64
service/coverage

@@ -1,64 +0,0 @@
-mode: set
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:14.76,19.17 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:29.2,29.34 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:19.17,20.32 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:20.32,22.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:23.8,24.35 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:24.35,26.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:29.34,41.10 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:41.10,43.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:43.9,46.4 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:47.8,62.13 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:62.13,64.4 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:64.9,67.4 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go:72.82,78.2 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go:10.93,16.2 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:16.57,20.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:23.61,25.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:28.58,34.32 3 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:39.2,40.23 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:45.2,49.70 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:34.32,37.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:40.23,43.3 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:53.93,61.2 2 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:64.126,75.16 5 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:78.2,78.115 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:75.16,77.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:82.126,92.16 5 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:95.2,95.115 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go:92.16,94.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:28.54,32.2 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:38.83,40.21 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:44.2,50.36 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:54.2,57.37 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:63.2,65.47 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:69.2,88.26 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:40.21,42.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:50.36,52.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:57.37,61.3 3 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:65.47,67.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:98.119,100.21 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:103.2,107.18 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:113.2,117.48 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:148.2,148.53 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:100.21,102.3 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:107.18,109.17 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:109.17,111.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:117.48,121.43 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:124.3,125.30 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:146.3,146.26 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:121.43,123.4 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:125.30,126.18 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:137.4,144.32 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:126.18,127.24 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:131.5,132.20 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:135.5,135.67 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:127.24,130.6 2 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:132.20,134.6 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:152.83,160.2 4 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:163.66,170.25 6 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:173.2,173.31 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:170.25,172.3 1 1
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:175.34,176.29 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:179.2,179.45 1 0
-bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go:176.29,178.3 1 0

+ 0 - 992
service/coverage.html

@@ -1,992 +0,0 @@
-
-<!DOCTYPE html>
-<html>
-	<head>
-		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-		<title>service: Go Coverage Report</title>
-		<style>
-			body {
-				background: black;
-				color: rgb(80, 80, 80);
-			}
-			body, pre, #legend span {
-				font-family: Menlo, monospace;
-				font-weight: bold;
-			}
-			#topbar {
-				background: black;
-				position: fixed;
-				top: 0; left: 0; right: 0;
-				height: 42px;
-				border-bottom: 1px solid rgb(80, 80, 80);
-			}
-			#content {
-				margin-top: 50px;
-			}
-			#nav, #legend {
-				float: left;
-				margin-left: 10px;
-			}
-			#legend {
-				margin-top: 12px;
-			}
-			#nav {
-				margin-top: 10px;
-			}
-			#legend span {
-				margin: 0 5px;
-			}
-			.cov0 { color: rgb(192, 0, 0) }
-.cov1 { color: rgb(128, 128, 128) }
-.cov2 { color: rgb(116, 140, 131) }
-.cov3 { color: rgb(104, 152, 134) }
-.cov4 { color: rgb(92, 164, 137) }
-.cov5 { color: rgb(80, 176, 140) }
-.cov6 { color: rgb(68, 188, 143) }
-.cov7 { color: rgb(56, 200, 146) }
-.cov8 { color: rgb(44, 212, 149) }
-.cov9 { color: rgb(32, 224, 152) }
-.cov10 { color: rgb(20, 236, 155) }
-
-		</style>
-	</head>
-	<body>
-		<div id="topbar">
-			<div id="nav">
-				<select id="files">
-				
-				<option value="file0">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/AuthService.go (77.4%)</option>
-				
-				<option value="file1">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/InstitutionService.go (89.2%)</option>
-				
-				<option value="file2">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/claim.go (100.0%)</option>
-				
-				<option value="file3">bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service/portrait.go (21.8%)</option>
-				
-				</select>
-			</div>
-			<div id="legend">
-				<span>not tracked</span>
-			
-				<span class="cov0">no coverage</span>
-				<span class="cov1">low coverage</span>
-				<span class="cov2">*</span>
-				<span class="cov3">*</span>
-				<span class="cov4">*</span>
-				<span class="cov5">*</span>
-				<span class="cov6">*</span>
-				<span class="cov7">*</span>
-				<span class="cov8">*</span>
-				<span class="cov9">*</span>
-				<span class="cov10">high coverage</span>
-			
-			</div>
-		</div>
-		<div id="content">
-		
-		<pre class="file" id="file0" style="display: none">package service
-
-import (
-        "app.yhyue.com/moapp/jybase/date"
-        "app.yhyue.com/moapp/jybase/go-xweb/log"
-        "app.yhyue.com/moapp/jybase/mysql"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
-        "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/resource"
-        "context"
-        "database/sql"
-        "fmt"
-)
-
-type AuthService struct {
-        GoodsCode   string
-        GoodsSpecId int64
-        BasesqlConn *mysql.Mysql
-}
-
-//认证信息保存
-func (b AuthService) UserAuthInfoSave(in *medical.UserInfo) (bool, string) <span class="cov10" title="4">{
-        //先判断用户是否存在
-        user := b.BasesqlConn.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
-                "user_id": in.UserId, "appid": in.Appid,
-        }, "id", "")
-        if user != nil </span><span class="cov8" title="3">{
-                if in.OperationType == "add" </span><span class="cov1" title="1">{
-                        return false, "用户已验证"
-                }</span>
-        } else<span class="cov1" title="1"> {
-                if in.OperationType == "update" </span><span class="cov0" title="0">{
-                        return false, "用户未认证,不可修改"
-                }</span>
-        }
-
-        <span class="cov8" title="3">if in.OperationType == "update" </span><span class="cov5" title="2">{
-                //修改处理
-                data := map[string]interface{}{
-                        "name":       in.Name,
-                        "phone":      in.Phone,
-                        "position":   in.Position,
-                        "department": in.Department,
-                        "mail":       in.Mail,
-                        "ent_name":   in.EntName,
-                        "source":     entity.MEDICALDOMAIN,
-                }
-                ok1 := b.BasesqlConn.Update(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{"user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN}, data)
-                if ok1 </span><span class="cov5" title="2">{
-                        return true, ""
-                }</span> else<span class="cov0" title="0"> {
-                        log.Println(fmt.Sprintf("认证修改失败:入参:%v:%v,", in.UserId, data))
-                        return false, "修改失败"
-                }</span>
-        } else<span class="cov1" title="1"> {
-                //新增处理
-                data := map[string]interface{}{
-                        "name":        in.Name,
-                        "phone":       in.Phone,
-                        "position":    in.Position,
-                        "department":  in.Department,
-                        "mail":        in.Mail,
-                        "ent_name":    in.EntName,
-                        "user_id":     in.UserId,
-                        "create_time": date.NowFormat(date.Date_Full_Layout),
-                        "appid":       in.Appid,
-                        "source":      entity.MEDICALDOMAIN,
-                }
-                msg := ""
-                ok := b.BasesqlConn.ExecTx("认证信息保存", func(tx *sql.Tx) bool </span><span class="cov1" title="1">{
-                        ok1 := b.BasesqlConn.InsertByTx(tx, entity.DOMAIN_CAPITAL_RETENTION, data)
-                        if ok1 &lt;= 0 </span><span class="cov0" title="0">{
-                                log.Println(fmt.Sprintf("认证失败:参数:%v", data))
-                                msg = "认证信息保存失败"
-                                return false
-                        }</span>
-                        //开通权益
-                        <span class="cov1" title="1">req := &amp;resource.PowerReq{
-                                Appid:       in.Appid,
-                                GoodsCode:   b.GoodsCode,
-                                GoodsSpecId: b.GoodsSpecId,
-                                EntId:       0,
-                                UserId:      in.UserId,
-                                BuyNum:      1,
-                                Type:        int64(1),
-                        }
-                        resq, err := entity.ResourceLib.PowerHandle(context.Background(), req)
-                        if err != nil || resq.Status != 1 </span><span class="cov1" title="1">{
-                                log.Println("权益开通调用失败:", req, resq)
-                                msg = "权益开通调用失败"
-                                return false
-                        }</span>
-                        <span class="cov0" title="0">return ok1 &gt; 0</span>
-                })
-                <span class="cov1" title="1">return ok, msg</span>
-        }
-}
-
-//认证信息查询
-func (b AuthService) UserAuthInfo(in *medical.CommonReq) *map[string]interface{} <span class="cov5" title="2">{
-        //先判断用户是否存在
-        user := b.BasesqlConn.FindOne(entity.DOMAIN_CAPITAL_RETENTION, map[string]interface{}{
-                "user_id": in.UserId, "appid": in.Appid, "source": entity.MEDICALDOMAIN,
-        }, "*", "")
-        return user
-}</span>
-</pre>
-		
-		<pre class="file" id="file1" style="display: none">package service
-
-import (
-        quitl "app.yhyue.com/moapp/jybase/common"
-        elastic "app.yhyue.com/moapp/jybase/esv1"
-        "app.yhyue.com/moapp/jybase/mysql"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
-        "fmt"
-        "log"
-        "strings"
-)
-
-type InstitutionService struct {
-        Bidfield   string
-        BasesqlCon *mysql.Mysql
-        MysqlConn  *mysql.Mysql
-}
-
-// GetFilterItem 医疗机构搜索条件
-func (b InstitutionService) GetFilterItem() (levelList, typeList *[]map[string]interface{}) <span class="cov1" title="1">{
-        //机构类型
-        levelSql := fmt.Sprintf("select  * from %s where  name!='%s'", entity.CODE_MEDICAL_INSTITUTION_LEVEL, "其它")
-        levelList = b.MysqlConn.SelectBySql(levelSql)
-        //医院等级
-        typeSql := fmt.Sprintf("select  * from %s where  name!='%s' and  level=1", entity.CODE_MEDICAL_INSTITUTION_TYPE, "其它")
-        typeList = b.MysqlConn.SelectBySql(typeSql)
-        return
-}</span>
-
-// Institution 医疗机构搜索条件
-func (b InstitutionService) Institution(in *medical.SearchInstitutionReq) (dataList []map[string]interface{}) <span class="cov1" title="1">{
-        //先查询医疗机构
-        //医疗机构查询拼接
-        query := `{"query":{"bool":{"must":[%s],"must_not": [{"term": {"p_miname": ""}}],"should":[%s],"minimum_should_match": %d}},"sort":{"id":{"order":"desc"}}, "from": %d,"size": %d}`
-        shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
-        multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
-        musts := []string{}
-        var query_bool_must_and = `{"bool": {"must": [%s]%s}}`
-        shoulds := []string{}
-        bools := []string{}
-        //省份处理
-        cityArr := []string{}
-        areaArr := []string{}
-        if in.AreaCode != "" </span><span class="cov1" title="1">{
-                areaCode := quitl.ObjToMap(in.AreaCode)
-                for k, v := range *areaCode </span><span class="cov3" title="2">{
-                        if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 </span><span class="cov1" title="1">{
-                                areaArr = append(areaArr, k)
-                        }</span> else<span class="cov1" title="1"> {
-                                cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
-                        }</span>
-                }
-        }
-
-        //省份处理
-        <span class="cov1" title="1">if len(areaArr) &gt; 0 </span><span class="cov1" title="1">{
-                areaQuery := entity.SplicingArr("area", areaArr)
-                shoulds = append(shoulds, areaQuery)
-        }</span>
-        //城市处理
-        <span class="cov1" title="1">if len(cityArr) &gt; 0 </span><span class="cov1" title="1">{
-                cityQuery := entity.SplicingArr("city", cityArr)
-                shoulds = append(shoulds, cityQuery)
-        }</span>
-        //医疗等级处理
-        <span class="cov1" title="1">if in.LevelCode != "" </span><span class="cov1" title="1">{
-                levelQuery := entity.SplicingString("level_code", in.LevelCode)
-                musts = append(musts, levelQuery)
-        }</span>
-        //机构类型处理
-        <span class="cov1" title="1">if in.MiTypeCode != "" </span><span class="cov1" title="1">{
-                miTyprQuery := entity.SplicingString("mi_type_code", in.MiTypeCode)
-                musts = append(musts, miTyprQuery)
-        }</span>
-        //经营性质处理
-        <span class="cov1" title="1">if in.BusinessTypeCode != "" </span><span class="cov1" title="1">{
-                businessTypeQuery := entity.SplicingString("business_type", in.BusinessTypeCode)
-                musts = append(musts, businessTypeQuery)
-        }</span>
-        //机构名称处理
-        <span class="cov1" title="1">if in.CompanyName != "" </span><span class="cov1" title="1">{
-                /*companyNameQuery := entity.SplicingString("p_miname", in.CompanyName)
-                musts = append(musts, companyNameQuery)*/
-                musts = append(musts, fmt.Sprintf(multi_match, "\""+in.CompanyName+"\"", "\"p_miname\""))
-        }</span>
-        //业务范围处理
-        <span class="cov1" title="1">boolsNum, bools := BusinessScopehandle(in.SdequipmentCode, multi_match, `"sdequipment"`, query_bool_must_and, bools)
-        shouldNumber := 0
-        if len(shoulds) &gt; 0 </span><span class="cov1" title="1">{
-                shouldNumber = 1
-        }</span>
-        <span class="cov1" title="1">shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
-        musts = append(musts, shouldStr)
-        queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, in.ResourceUseCount)
-        //医疗机构查找
-        companyList := elastic.Get(entity.INSTITUTION_INDEX, entity.INSTITUTION_TYPE, queryStr)
-        log.Println(queryStr)
-        //再根据医疗机构名称查找项目金额总数
-        companyName := ""
-        companyMap := make(map[string]map[string]interface{})
-        if len(*companyList) &gt; 0 &amp;&amp; companyList != nil </span><span class="cov1" title="1">{
-                //认领数据查询
-                companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeInstitution)
-                for key, value := range *companyList </span><span class="cov10" title="14">{
-                        if key &gt; 0 </span><span class="cov9" title="13">{
-                                companyName += `,`
-                        }</span>
-                        <span class="cov10" title="14">companyName += `"` + fmt.Sprint(value["mi_name"]) + `"`
-                        value["project_money"] = float64(0.00)
-                        value["project_count"] = 0
-                        if companyIdMap[fmt.Sprint(value["company_id"])] == nil </span><span class="cov10" title="14">{
-                                value["isClaim"] = false
-                        }</span> else<span class="cov0" title="0"> {
-                                value["isClaim"] = true
-                        }</span>
-                        <span class="cov10" title="14">companyMap[fmt.Sprint(value["mi_name"])] = value</span>
-                }
-
-        } else<span class="cov0" title="0"> {
-                return
-        }</span>
-        <span class="cov1" title="1">orderField := "_count"
-        orderType := "desc"
-        //排序处理
-        if in.Sort == 1 </span><span class="cov0" title="0">{
-                orderField = "count"
-        }</span>
-        <span class="cov1" title="1">aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"buyer":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}},{"term":{"bid_field":"%s"}}],"minimum_should_match":0}},"aggs":{"group_field":{"terms":{"field":"buyer","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyName, b.Bidfield, orderField, orderType)
-        log.Println(aggStr)
-        countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
-        //
-        if len(countList) &gt; 0 &amp;&amp; countList != nil </span><span class="cov1" title="1">{
-                for _, value := range countList </span><span class="cov3" title="2">{
-                        if companyMap[value.CompanyName] != nil </span><span class="cov3" title="2">{
-                                companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
-                                companyMap[value.CompanyName]["project_count"] = value.ProjectCount
-                                dataList = append(dataList, companyMap[value.CompanyName])
-                                delete(companyMap, value.CompanyName)
-                        }</span>
-                }
-                <span class="cov1" title="1">for _, value := range companyMap </span><span class="cov9" title="12">{
-                        dataList = append(dataList, value)
-                }</span>
-        } else<span class="cov0" title="0"> {
-                dataList = *companyList
-
-        }</span>
-        <span class="cov1" title="1">return</span>
-}
-
-// Distributor 经销商搜索
-func (b InstitutionService) Distributor(in *medical.SearchDistributorReq) (dataList []map[string]interface{}) <span class="cov1" title="1">{
-        //先查询医疗机构
-        //医疗机构查询拼接
-        query := `{"query":{"bool":{"must":[%s],"must_not": [{"term": {"p_supplier": ""}}],"should":[%s],"minimum_should_match": %d}}, "sort":{"id":{"order":"desc"}},"from": %d,"size": %d}`
-        shouldQuery := `{"bool":{"should":[%s],"minimum_should_match": %d}}`
-        multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
-        var query_bool_must_and = `{"bool": {"must": [%s]%s}}`
-        musts := []string{}
-        shoulds := []string{}
-        bools := []string{}
-        //省份处理
-        cityArr := []string{}
-        areaArr := []string{}
-        if in.AreaCode != "" </span><span class="cov1" title="1">{
-                areaCode := quitl.ObjToMap(in.AreaCode)
-                for k, v := range *areaCode </span><span class="cov3" title="2">{
-                        if len(quitl.ObjArrToStringArr(v.([]interface{}))) == 0 </span><span class="cov1" title="1">{
-                                areaArr = append(areaArr, k)
-                        }</span> else<span class="cov1" title="1"> {
-                                cityArr = append(cityArr, quitl.ObjArrToStringArr(v.([]interface{}))...)
-                        }</span>
-                }
-        }
-        //省份处理
-        <span class="cov1" title="1">if len(areaArr) &gt; 0 </span><span class="cov1" title="1">{
-                areaQuery := entity.SplicingArr("area", areaArr)
-                shoulds = append(shoulds, areaQuery)
-        }</span>
-        //城市处理
-        <span class="cov1" title="1">if len(cityArr) &gt; 0 </span><span class="cov1" title="1">{
-                cityQuery := entity.SplicingArr("city", cityArr)
-                shoulds = append(shoulds, cityQuery)
-        }</span>
-        //业务范围处理
-        <span class="cov1" title="1">boolsNum, bools := BusinessScopehandle(in.BusinessScope, multi_match, `"productlist.name"`, query_bool_must_and, bools)
-        //品牌处理
-        if in.Brand != "" </span><span class="cov0" title="0">{
-                brandQuery := entity.SplicingString("productlist.brand", in.Brand)
-                musts = append(musts, brandQuery)
-        }</span>
-        //产品型号处理
-        <span class="cov1" title="1">if in.ProductModel != "" </span><span class="cov0" title="0">{
-                productModelQuery := entity.SplicingString("productlist.model", in.ProductModel)
-                musts = append(musts, productModelQuery)
-        }</span>
-        //机构名称处理
-        <span class="cov1" title="1">if in.CompanyName != "" </span><span class="cov1" title="1">{
-                musts = append(musts, fmt.Sprintf(multi_match, "\""+in.CompanyName+"\"", "\"p_supplier\""))
-        }</span>
-        <span class="cov1" title="1">shouldNumber := 0
-        if len(shoulds) &gt; 0 </span><span class="cov1" title="1">{
-                shouldNumber = 1
-        }</span>
-        <span class="cov1" title="1">shouldStr := fmt.Sprintf(shouldQuery, strings.Join(shoulds, ","), shouldNumber)
-        musts = append(musts, shouldStr)
-        queryStr := fmt.Sprintf(query, strings.Join(musts, ","), strings.Join(bools, ","), boolsNum, 0, in.ResourceUseCount)
-        //医疗机构查找
-        companyList := elastic.Get(entity.SUPPLIER_PRODUCT_INDEX, entity.SUPPLIER_PRODUCT_TYPE, queryStr)
-        log.Println(queryStr)
-        //再根据医疗机构名称查找项目金额总数
-        companyIds := ""
-        companyMap := make(map[string]map[string]interface{})
-        if len(*companyList) &gt; 0 &amp;&amp; companyList != nil </span><span class="cov1" title="1">{
-                //认领数据查询
-                companyIdMap := b.ClaimCompanyData(in.Appid, in.NewUserId, entity.TypeDistributor)
-                for key, value := range *companyList </span><span class="cov7" title="7">{
-                        if key &gt; 0 </span><span class="cov7" title="6">{
-                                companyIds += `,`
-                        }</span>
-                        <span class="cov7" title="7">companyIds += `"` + fmt.Sprint(value["company_id"]) + `"`
-                        value["project_money"] = float64(0.00)
-                        value["project_count"] = 0
-                        if companyIdMap[fmt.Sprint(value["company_id"])] == nil </span><span class="cov7" title="7">{
-                                value["isClaim"] = false
-                        }</span> else<span class="cov0" title="0"> {
-                                value["isClaim"] = true
-                        }</span>
-                        <span class="cov7" title="7">companyMap[fmt.Sprint(value["company_id"])] = value</span>
-                }
-        } else<span class="cov0" title="0"> {
-                return
-        }</span>
-        //排序处理
-        <span class="cov1" title="1">orderField := "_count"
-        orderType := "desc"
-        if in.Sort == 1 </span><span class="cov0" title="0">{
-                orderField = "count"
-        }</span>
-        <span class="cov1" title="1">aggStr := fmt.Sprintf(`{"query":{"bool":{"must":[{"terms":{"entidlist":[%s]}},{"terms":{"bidstatus":["中标","成交","合同"]}},{"term":{"bid_field":"%s"}}],"minimum_should_match":0}},"aggs":{"group_field":{"terms":{"field":"entidlist","order":[{"%s":"%s"}]},"aggs":{"count":{"sum":{"field":"bidamount"}}}}},"size":0}`, companyIds, b.Bidfield, orderField, orderType)
-        log.Println(aggStr)
-        countList := entity.GetAggs(entity.PROJECTSET_INDEX, entity.PROJECTSET_TYPE, aggStr)
-        if len(countList) &gt; 0 &amp;&amp; countList != nil </span><span class="cov0" title="0">{
-                for _, value := range countList </span><span class="cov0" title="0">{
-                        if companyMap[value.CompanyName] != nil </span><span class="cov0" title="0">{
-                                companyMap[value.CompanyName]["project_money"] = value.ProjectMoney
-                                companyMap[value.CompanyName]["project_count"] = value.ProjectCount
-                                dataList = append(dataList, companyMap[value.CompanyName])
-                                delete(companyMap, value.CompanyName)
-                        }</span>
-                }
-                <span class="cov0" title="0">for _, value := range companyMap </span><span class="cov0" title="0">{
-                        dataList = append(dataList, value)
-                }</span>
-        } else<span class="cov1" title="1"> {
-                dataList = *companyList
-        }</span>
-        <span class="cov1" title="1">return</span>
-}
-
-//  ClaimCompanyData 已认领企业查询处理
-//  @Description:
-//  @param appId 用户标识
-//  @param newUserId 用户标识
-//  @param claimType 数据类型
-//  @return map[string]map[string]interface{} 认领的企业信息
-//
-func (b InstitutionService) ClaimCompanyData(appId string, newUserId, claimType int64) map[string]map[string]interface{} <span class="cov5" title="4">{
-        claimList := b.BasesqlCon.Find(entity.TableDomainEntClaim, map[string]interface{}{
-                "user_id": newUserId,
-                "status":  1,
-                "type":    claimType,
-                "appid":   appId,
-        }, "ent_id", "", -1, -1)
-        companyIdMap := make(map[string]map[string]interface{})
-        if claimList == nil || len(*claimList) == 0 </span><span class="cov4" title="3">{
-                return companyIdMap
-        }</span>
-        <span class="cov1" title="1">for _, m := range *claimList </span><span class="cov1" title="1">{
-                companyIdMap[quitl.InterfaceToStr(m["ent_id"])] = m
-        }</span>
-        <span class="cov1" title="1">return companyIdMap</span>
-}
-
-// BusinessScopehandle 业务范围处理
-func BusinessScopehandle(BusinessScope []*medical.Business_Scope, multi_match, findfields, query_bool_must_and string, bools []string) (int, []string) <span class="cov3" title="2">{
-        boolsNum := 0
-        if len(BusinessScope) &gt; 0 </span><span class="cov3" title="2">{
-                boolsNum = 1
-
-                multi_match = fmt.Sprintf(multi_match, "%s", findfields)
-                for _, v := range BusinessScope </span><span class="cov4" title="3">{
-                        businessShoulds := []string{}
-                        businessMust_not := []string{}
-                        //关键词
-                        for _, keyV := range v.Key </span><span class="cov4" title="3">{
-                                businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+keyV+"\""))
-                        }</span>
-                        //附加词
-                        <span class="cov4" title="3">for _, AppendV := range v.Appendkey </span><span class="cov1" title="1">{
-                                businessShoulds = append(businessShoulds, fmt.Sprintf(multi_match, "\""+AppendV+"\""))
-                        }</span>
-                        //排除词
-                        <span class="cov4" title="3">for _, notV := range v.Notkey </span><span class="cov7" title="6">{
-                                businessMust_not = append(businessMust_not, fmt.Sprintf(multi_match, "\""+notV+"\""))
-                        }</span>
-                        //添加
-                        <span class="cov4" title="3">if len(businessShoulds) &gt; 0 </span><span class="cov4" title="3">{
-                                notStr := ""
-                                if len(businessShoulds) &gt; 0 </span><span class="cov4" title="3">{
-                                        notStr = fmt.Sprintf(`,"must_not":[%s]`, strings.Join(businessMust_not, ","))
-                                }</span>
-                                <span class="cov4" title="3">bools = append(bools, fmt.Sprintf(query_bool_must_and, strings.Join(businessShoulds, ","), notStr))</span>
-                        }
-                }
-        }
-        <span class="cov3" title="2">return boolsNum, bools</span>
-}
-</pre>
-		
-		<pre class="file" id="file2" style="display: none">package service
-
-import (
-        "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/date"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-        "fmt"
-        "github.com/zeromicro/go-zero/core/logx"
-        "strings"
-)
-
-// EntClaimService 企业认领
-type EntClaimService struct {
-        *entity.Conn
-}
-
-// NewEntClaimSrv 创建一个EntClaimSrv实例
-func NewEntClaimSrv(conn *entity.Conn) *EntClaimService <span class="cov1" title="1">{
-        return &amp;EntClaimService{
-                conn,
-        }
-}</span>
-
-// Claim 认领
-func (e *EntClaimService) Claim(data *entity.EntClaim) (int64, error) <span class="cov7" title="4">{
-        if e.IsClaimed(data.UserId, data.AppId, data.EntId, data.Type) </span><span class="cov4" title="2">{
-                return 0, entity.RepeatErr
-        }</span>
-        <span class="cov4" title="2">return e.BaseMysql.Insert(entity.TableDomainEntClaim, common.StructToMapMore(data)), nil</span>
-}
-
-// UnclaimedByEnt 根据企业id取消认领
-func (e EntClaimService) UnclaimedByEnt(userId int, entId string, type_ int) (bool, int) <span class="cov7" title="4">{
-
-        query := map[string]interface{}{
-                "user_id": userId,
-                "status":  entity.StatusClaimed,
-                "ent_id":  entId,
-                "type":    type_,
-        }
-        // 1. 查询该条数据
-        rs := e.BaseMysql.FindOne(entity.TableDomainEntClaim, query, "id", "")
-        if rs == nil || len(*rs) == 0 </span><span class="cov4" title="2">{
-                logx.Errorf("取消认领:无效的企业id %v", entId)
-                return false, 0
-        }</span>
-        <span class="cov4" title="2">query2 := map[string]interface{}{
-                "id": (*rs)["id"],
-        }
-        // 2. 取消认领
-        update := map[string]interface{}{
-                "status":      entity.StatusUnClaimed,
-                "update_time": date.NowFormat(date.Date_Full_Layout),
-        }
-        return e.BaseMysql.Update(entity.TableDomainEntClaim, query2, update), common.IntAll((*rs)["id"])</span>
-}
-
-// IsClaimed 是否认领
-func (e *EntClaimService) IsClaimed(userId int, appId string, entId string, typeCode int) bool <span class="cov10" title="6">{
-        query := map[string]interface{}{
-                "appId":   appId,
-                "user_id": userId,
-                "type":    typeCode,
-                "ent_id":  entId,
-                "status":  entity.StatusClaimed,
-        }
-        return e.BaseMysql.Count(entity.TableDomainEntClaim, query) &gt; 0
-}</span>
-
-// DistributorList 关注的经销商列表
-func (e *EntClaimService) DistributorList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov4" title="2">{
-
-        query := map[string]interface{}{
-                "user_id": userId,
-                "appid":   appId,
-                "type":    entity.TypeDistributor,
-                "status":  entity.StatusClaimed,
-        }
-        field := "id,appid,user_id,ent_id,ent_name,create_time"
-        order := "create_time desc"
-        total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
-        if total == 0 </span><span class="cov1" title="1">{
-                return nil, 0
-        }</span>
-        <span class="cov1" title="1">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
-}
-
-// InstitutionList  我关注的医疗机构列表
-func (e *EntClaimService) InstitutionList(userId int, appId string, page int, pageSize int) (*[]map[string]interface{}, int) <span class="cov4" title="2">{
-        query := map[string]interface{}{
-                "user_id": userId,
-                "appid":   appId,
-                "type":    entity.TypeInstitution,
-                "status":  entity.StatusClaimed,
-        }
-        field := "id,appid,user_id,ent_id,ent_name,create_time"
-        order := "create_time desc"
-        total := e.BaseMysql.Count(entity.TableDomainEntClaim, query)
-        if total == 0 </span><span class="cov1" title="1">{
-                return nil, 0
-        }</span>
-        <span class="cov1" title="1">return e.BaseMysql.Find(entity.TableDomainEntClaim, query, field, order, (page-1)*pageSize, pageSize), int(total)</span>
-}
-
-// GetCompanyByIds   批量获取经销商详细信息
-func (e EntClaimService) GetCompanyByIds(ids []string) *[]map[string]interface{} <span class="cov6" title="3">{
-        if len(ids) == 0 </span><span class="cov1" title="1">{
-                return &amp;[]map[string]interface{}{}
-        }</span>
-        <span class="cov4" title="2">q := "select a.company_id,a.company_name,a.establish_date,a.company_address,a.capital,a.company_phone,b.area,b.city from %v a left join %v b on a.area_code=b.code  where a.company_id in (\"%v\")  "
-        query := fmt.Sprintf(q, entity.TableCompanyBasInfo, entity.TableCodeArea, strings.Join(ids, "\" , \""))
-        return e.GlobalCommonData.SelectBySql(query)</span>
-}
-
-// GetInstitutionByIds  批量获取机构详细信息
-func (e EntClaimService) GetInstitutionByIds(ids []string) *[]map[string]interface{} <span class="cov6" title="3">{
-        if len(ids) == 0 </span><span class="cov1" title="1">{
-                return &amp;[]map[string]interface{}{}
-        }</span>
-        <span class="cov4" title="2">q := "select a.company_id,a.mi_name,a.establish_date,b.area,b.city from %v.%v a left join %v.%v b on a.area_code=b.code  where a.company_id in (\"%v\")  "
-        query := fmt.Sprintf(q, entity.DbMedical, entity.TableInstitutionBaseInfo, entity.DbGlobal, entity.TableCodeArea, strings.Join(ids, "\" , \""))
-        return e.Mysql.SelectBySql(query)</span>
-}
-</pre>
-		
-		<pre class="file" id="file3" style="display: none">// @Description   画像相关
-package service
-
-import (
-        "errors"
-        "fmt"
-        "log"
-        "regexp"
-        "strings"
-        "time"
-
-        . "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/encrypt"
-        elastic "app.yhyue.com/moapp/jybase/esv1"
-        "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
-)
-
-//画像
-type PortraitService struct {
-        *entity.Conn
-}
-
-var ClearHtml = regexp.MustCompile("&lt;[^&gt;]*&gt;")
-
-// @description           生成结构体
-// @param                     conn 数据库实例
-// @return                    Portrait 画像实例
-func NewPortrait(conn *entity.Conn) *PortraitService <span class="cov1" title="1">{
-        return &amp;PortraitService{
-                conn,
-        }
-}</span>
-
-// @description           获取画像内容
-// @param                     companyId 机构id
-// @param                     user_id   base_user_id
-// @return                    PortraitInfo 画像信息
-// @return                    error 错误信息
-func (this *PortraitService) Info(companyId string, user_id int64) (*entity.PortraitInfo, error) <span class="cov10" title="3">{
-        //判断是否存在companyid
-        if companyId == "" || user_id == 0 </span><span class="cov10" title="3">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        //获取信息
-        <span class="cov0" title="0">data := this.Mysql.SelectBySql(fmt.Sprintf(`SELECT a.sdequipment_code,a.area_code,a.beds,a.visit_perday,a.doctorsnum,a.address,a.website,a.business_type,replace(a.equipment,",","、") equipment, replace(e.equipment,",","、") sdleveltypeequip ,a.mi_name,a.establish_date,b.name LEVEL,c.name miType,d.class FROM %s a 
-                                                                                                        LEFT JOIN %s b ON a.level_code=b.code 
-                                                                                                        LEFT JOIN %s c ON c.code =a.mi_type_code
-                                                                                                        LEFT JOIN (SELECT GROUP_CONCAT(DISTINCT departname_class1 SEPARATOR  '、') class,company_id FROM %s WHERE company_id=?)  AS d ON d.company_id =a.company_id
-                                                                                                        left join %s e on e.code =a.sdequipment_code
-                                                                                                        WHERE  a.company_id=?`, entity.Institution_baseinfo, entity.Code_level, entity.Code_type, entity.Institution_department, entity.Code_sdleveltypeequip), companyId, companyId)
-        if data == nil || len(*data) == 0 </span><span class="cov0" title="0">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        //获取area_code 省份,城市,区县
-        <span class="cov0" title="0">area, city, district := "", "", ""
-        rdata := (*data)[0]
-        adata := this.GlobalCommonData.SelectBySql(fmt.Sprintf(`select area,city,district from %s where code =? limit 1`, entity.Code_area), ObjToString(rdata["area_code"]))
-        if adata != nil &amp;&amp; len(*adata) &gt; 0 </span><span class="cov0" title="0">{
-                area = ObjToString((*adata)[0]["area"])
-                city = ObjToString((*adata)[0]["city"])
-                district = ObjToString((*adata)[0]["district"])
-        }</span>
-        //医疗设备如果基本信息表中没有,则根据sdequipment_code、code联合查询得到equipment
-        <span class="cov0" title="0">equipment := ObjToString(rdata["equipment"])
-        sdleveltypeequip := ObjToString(rdata["sdleveltypeequip"])
-        if equipment == "" &amp;&amp; sdleveltypeequip != "" </span><span class="cov0" title="0">{
-                equipment = ObjToString(rdata["sdleveltypeequip"])
-        }</span>
-        //医疗画像结果
-        <span class="cov0" title="0">portraitInfo := &amp;entity.PortraitInfo{
-                Beds:          Int64All(rdata["beds"]),
-                VisitPerday:   Int64All(rdata["visit_perday"]),      // 门诊量/日
-                Doctorsnum:    Int64All(rdata["doctorsnum"]),        //医生人数
-                Address:       ObjToString(rdata["address"]),        //医疗机构地址
-                Website:       ObjToString(rdata["website"]),        //医疗机构网站
-                Area:          area,                                 //省
-                City:          city,                                 //市
-                District:      district,                             //区
-                BusinessType:  Int64All(rdata["business_type"]),     //医疗机构经营方式(0:公立、1:民营、2:其它)
-                Level:         ObjToString(rdata["level"]),          //医疗机构等级
-                MiType:        ObjToString(rdata["miType"]),         //医疗机构类型
-                Equipment:     equipment,                            //医院设备
-                Departnames:   ObjToString(rdata["class"]),          //医院科室
-                Follow:        this.IsFollow(companyId, user_id, 1), //是否关注 0-未关注 1已关注
-                CompanyName:   ObjToString(rdata["mi_name"]),        //医疗机构名称
-                EstablishDate: ObjToString(rdata["establish_date"]), //成立日期
-        }
-        return portraitInfo, nil</span>
-}
-
-// @description           获取医疗机构画像相关招标动态
-// @param                     companyName 机构名称
-// @param                     pageSize 条数
-// @param                     pageNum 页码
-// @param                     isExport 是否用于数据导出
-// @return                    GetNewMsgList 招标动态
-// @return                    count 招标数量
-// @return                    error 错误信息
-func (this *PortraitService) List(companyName string, pageSize, pageNum int64, isExport bool) (*[]*entity.GetNewMsgList, int64, error) <span class="cov1" title="1">{
-        //判断是否存在companyid
-        if companyName == "" </span><span class="cov0" title="0">{
-                return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov1" title="1">var total int64
-        mustQueryArr := this.CommonPare(companyName)
-        log.Println("~~~~,", mustQueryArr)
-        //仅第一页查询总量(非数据导出)
-
-        if pageNum == 1 </span><span class="cov1" title="1">{
-                total = elastic.Count(entity.BiddingIndex, entity.BiddingIndex, fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), ""))
-                if total &lt;= 0 </span><span class="cov1" title="1">{
-                        return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-        }
-        <span class="cov0" title="0">start, limit := (pageNum-1)*pageSize, pageSize
-        fields := `"title","area","subtype","_id","projectname","publishtime"`
-        if isExport </span><span class="cov0" title="0">{
-                start, limit = 0, entity.DataExportNumLimit
-                fields = `"_id","title"`
-        }</span>
-        <span class="cov0" title="0">list := &amp;[]*entity.GetNewMsgList{}
-        //列表查询
-        if total &lt;= entity.DataExportBatchSearchLimit </span><span class="cov0" title="0">{
-                listQuery := fmt.Sprintf(entity.NewMustSearch, strings.Join(mustQueryArr, ","), fmt.Sprintf(entity.ListSearchLimit, fields, "publishtime", start, limit))
-                log.Printf("PortraitWinnerProject GetList Sql %s\n", listQuery)
-                newData := elastic.Get(entity.BiddingIndex, entity.BiddingType, listQuery)
-                if newData == nil || len(*newData) == 0 </span><span class="cov0" title="0">{
-                        return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-                <span class="cov0" title="0">log.Println("newdata:", newData)
-                for k, v := range *newData </span><span class="cov0" title="0">{
-                        if len(v) &gt; 0 </span><span class="cov0" title="0">{
-                                if v["_id"] != nil </span><span class="cov0" title="0">{
-                                        (*newData)[k]["id"] = EncodeId(v["_id"].(string))
-                                        delete((*newData)[k], "_id") //删除未加密id
-                                }</span>
-                                <span class="cov0" title="0">title := ObjToString(ObjToString(v["title"]))
-                                if title == "" </span><span class="cov0" title="0">{
-                                        title = ObjToString(v["projectname"])
-                                }</span>
-                                <span class="cov0" title="0">(*newData)[k]["title"] = ClearHtml.ReplaceAllString(title, "")</span>
-                        }
-                        <span class="cov0" title="0">*list = append(*list, &amp;entity.GetNewMsgList{
-                                Area:      ObjToString(v["area"]),
-                                Bidstatus: ObjToString(v["subtype"]),           //信息类型
-                                Firsttime: Int64All(v["publishtime"]),          //时间
-                                Id:        ObjToString((*newData)[k]["id"]),    //加密信息id
-                                Title:     ObjToString((*newData)[k]["title"]), //标题
-                        })
-                        log.Println("~~list:", list)</span>
-                }
-                <span class="cov0" title="0">return list, total, nil</span>
-        }
-        <span class="cov0" title="0">return nil, 0, errors.New(entity.NO_DATA_ERROR_MSG)</span>
-}
-
-//医疗机构画像查询语句拼接
-func (this *PortraitService) CommonPare(companyName string) (mustQueryArr []string) <span class="cov1" title="1">{
-        sTime, eTime := this.PareTimeSelect()
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"term":{"buyer":"%s"}}`, companyName))
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"term":{"bid_field":"%s"}}`, entity.BidField))
-        mustQueryArr = append(mustQueryArr, fmt.Sprintf(`{"range":{"publishtime":{"gte":"%d","lte":"%d"}}}`, sTime.Unix(), eTime.Unix()))
-
-        return
-}</span>
-
-//PareTimeSelect 默认2年
-func (this *PortraitService) PareTimeSelect() (st, et time.Time) <span class="cov1" title="1">{
-        now := time.Now()
-        sYear := now.Year() - 2
-        eYear := now.Year()
-        //返回默认时间
-        sTimeStamp := time.Date(sYear, 1, 1, 0, 0, 0, 0, time.Local)
-        eTimeStamp := time.Date(eYear+1, 1, 1, 0, 0, -1, 0, time.Local)
-        if eYear == now.Year() </span><span class="cov1" title="1">{
-                eTimeStamp = time.Date(eYear, now.Month(), now.Day(), now.Hour(), now.Minute(), 0, 0, time.Local)
-        }</span>
-        <span class="cov1" title="1">return sTimeStamp, eTimeStamp</span>
-}
-
-//短地址加密
-func EncodeId(sid string) string <span class="cov0" title="0">{
-        if sid == "" || sid == "-" </span><span class="cov0" title="0">{ //不存在的id为-
-                return ""
-        }</span>
-        <span class="cov0" title="0">return encrypt.EncodeArticleId2ByCheck(sid)</span>
-}
-
-// @description           判断用户是否关注该项目
-// @param                     companyId 机构id
-// @param                     user_id base_user_id
-// @param                     types 类型 1医疗机构 2经销商
-// @return                    int64 是否关注 1关注 0未关注
-func (this *PortraitService) IsFollow(companyId string, user_id, types int64) int64 <span class="cov0" title="0">{
-        if this.BaseMysql.CountBySql(fmt.Sprintf(`select count(1) from %s where user_id =? and ent_id =? and type =?`, entity.Domain_ent_claim), user_id, companyId, types) &gt; 0 </span><span class="cov0" title="0">{
-                return 1
-        }</span>
-        <span class="cov0" title="0">return 0</span>
-}
-
-// @description           获取医疗机构画像相关招标动态导出的加密戳 用于数据导出支付页面
-// @param                     mongoUid mongodb用户id
-// @param                     companyName 机构名称
-// @param                     ids 选中的招标信息 多个,隔开 全部则传空字符串
-// @return                    string 生成的数据导出加密戳
-// @return                    error 错误信息
-func (this *PortraitService) Export(mongoUid, companyName, ids string) (string, error) <span class="cov0" title="0">{
-        //判断是否存在companyid
-        if companyName == "" </span><span class="cov0" title="0">{
-                return "", errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov0" title="0">sTime, eTime := this.PareTimeSelect()
-        idsArr := []string{}
-        if ids == "" </span><span class="cov0" title="0">{
-                //获取全部id
-                list, _, err := this.List(companyName, -1, -1, true)
-                if err != nil || list == nil || len(*list) == 0 </span><span class="cov0" title="0">{
-                        return "", errors.New(entity.NO_DATA_ERROR_MSG)
-                }</span>
-                <span class="cov0" title="0">for k, v := range *list </span><span class="cov0" title="0">{
-                        ids += v.Id
-                        if k != len(*list)-1 </span><span class="cov0" title="0">{
-                                ids += ","
-                        }</span>
-                }
-        }
-        <span class="cov0" title="0">for _, v := range strings.Split(ids, ",") </span><span class="cov0" title="0">{
-                id := encrypt.DecodeArticleId2ByCheck(v) //解密id
-                if len(id) &gt; 0 </span><span class="cov0" title="0">{
-                        //
-                        idsArr = append(idsArr, id[0])
-                }</span>
-        }
-        //
-        <span class="cov0" title="0">saveMap := map[string]interface{}{
-                "s_userid":    mongoUid,
-                "comeinfrom":  "medicalPortrait", //来源
-                "comeintime":  time.Now().Unix(),
-                "selectIds":   idsArr,
-                "area":        []string{},
-                "publishtime": fmt.Sprintf("%d_%d", sTime.Unix(), eTime.Unix()),
-                "industry":    []string{},
-                "keywords":    []string{},
-                "selectType":  "",
-                "buyer":       []string{companyName},
-        }
-
-        if _id := this.MgoJy.Save("export_search", saveMap); _id != "" </span><span class="cov0" title="0">{
-                return encrypt.SE.Encode2Hex(_id), nil
-        }</span>
-        <span class="cov0" title="0">return "", errors.New(entity.NO_DATA_ERROR_MSG)</span>
-}
-
-// @description          经销商画像基本信息
-// @param                     companyId 经销商id
-// @param                     user_id   base_user_id
-// @return                    distributorInfo 经销商画像信息
-// @return                    error 错误信息
-func (this *PortraitService) DistributorInfo(companyId string, user_id int64) (*entity.DistributorInfo, error) <span class="cov0" title="0">{
-        if companyId == "" || user_id == 0 </span><span class="cov0" title="0">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        //查找基本信息
-        <span class="cov0" title="0">rdata := this.GlobalCommonData.SelectBySql(fmt.Sprintf(`select company_name,company_code,cancel_date,company_phone,operation_startdate,operation_enddate,credit_no,real_capital,org_code,tax_code,establish_date,legal_person,company_type,employee_no,company_address,business_scope
-                                                                                                                        from %s where company_id =?`, entity.Company_baseinfo), companyId)
-        if rdata == nil || len(*rdata) == 0 </span><span class="cov0" title="0">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov0" title="0">data := (*rdata)[0]
-        distributorInfo := &amp;entity.DistributorInfo{
-                //TODO 还没判断是否关注
-                LegalPerson: ObjToString(data["legal_person"]), //法定代表人
-                //TODO 经营状态不知道咋看
-                // CompanyStatus       //经营状态
-                CreditNo:           ObjToString(data["credit_no"]),           //统一信用代码
-                EstablishDate:      ObjToString(data["establish_date"]),      //成立日期
-                OrgCode:            ObjToString(data["org_code"]),            //组织机构代码
-                Capital:            ObjToString(data["real_capital"]),        //注册资本
-                TaxCode:            ObjToString(data["tax_code"]),            //纳税人识别号
-                OperationStartdate: ObjToString(data["operation_startdate"]), //营业期限开始
-                OperationEnddate:   ObjToString(data["operation_enddate"]),   //营业期限至 结束
-                CompanyCode:        ObjToString(data["company_code"]),        //工商注册号
-                CompanyType:        ObjToString(data["company_type"]),        //公司类型
-                EmployeeNo:         ObjToString(data["employee_no"]),         //人员规模
-                CompanyPhone:       ObjToString(data["company_phone"]),       //联系方式
-                CompanyAddress:     ObjToString(data["business_scope"]),      //注册地址
-                BusinessScope:      ObjToString(data["cancel_date"]),         //经营范围
-                ConpanyName:        ObjToString(data["company_name"]),        //企业名称
-        }
-        return distributorInfo, nil</span>
-}
-
-// @description          经销商画像-医械产品
-// @param                     companyId 经销商id
-// @param                     user_id   base_user_id
-// @return                    distributorInfo 经销商画像信息
-// @return                    error 错误信息
-func (this *PortraitService) MedicalProdcutList(companyId string, user_id int64) (*[]entity.MedicalEquipment, error) <span class="cov0" title="0">{
-        if companyId == "" || user_id == 0 </span><span class="cov0" title="0">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        //查找基本信息
-        <span class="cov0" title="0">rdata := this.GlobalCommonData.SelectBySql(fmt.Sprintf(`SELECT product_name,regno,approve_date,validity_date,manage_type,regist_type
-                                                                                                                        from %s where company_id =? order by id desc`, entity.Product_baseinfo), companyId)
-        if rdata == nil || len(*rdata) == 0 </span><span class="cov0" title="0">{
-                return nil, errors.New(entity.NO_DATA_ERROR_MSG)
-        }</span>
-        <span class="cov0" title="0">list := &amp;[]entity.MedicalEquipment{}
-        for _, v := range *rdata </span><span class="cov0" title="0">{
-                *list = append(*list, entity.MedicalEquipment{
-                        ProductName:  ObjToString(v["product_name"]),  //产品名称
-                        Regno:        ObjToString(v["regno"]),         //注册/备案证编号
-                        ApproveDate:  ObjToString(v["approve_date"]),  //批准日期|备案日期
-                        ValidityDate: ObjToString(v["validity_date"]), //有效期至
-                        ManageType:   ObjToString(v["manage_type"]),   //管理类别
-                        RegistType:   Int64All(v["regist_type"]),      //1-注册产品 2-备案产品
-                })
-        }</span>
-        <span class="cov0" title="0">return list, nil</span>
-}
-</pre>
-		
-		</div>
-	</body>
-	<script>
-	(function() {
-		var files = document.getElementById('files');
-		var visible;
-		files.addEventListener('change', onChange, false);
-		function select(part) {
-			if (visible)
-				visible.style.display = 'none';
-			visible = document.getElementById(part);
-			if (!visible)
-				return;
-			files.value = part;
-			visible.style.display = 'block';
-			location.hash = part;
-		}
-		function onChange() {
-			select(files.value);
-			window.scrollTo(0, 0);
-		}
-		if (location.hash != "") {
-			select(location.hash.substr(1));
-		}
-		if (!visible) {
-			select("file0");
-		}
-	})();
-	</script>
-</html>