Commit e673c0331a40160555e8e2e37ee857f18bde0cb6

Authored by liquanyu
1 parent a2d31c906a

update

Showing 5 changed files with 151 additions and 21 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java View file @ e673c03
... ... @@ -131,5 +131,10 @@
131 131 List<Map<String,String>> getMatdeliverHivktCheckzqCount(Map param);
132 132 List<Map<String,String>> getHasMatdeliverHivktCheckzqCount(Map param);
133 133  
  134 + int getAllFmCount(Map param);
  135 + int getAllBuildCount(Map param);
  136 + int getNameFmCount(Map param);
  137 + int getNameBuildCount(Map param);
  138 + int getBuildAndFmCount(Map param);
134 139 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java View file @ e673c03
... ... @@ -134,5 +134,11 @@
134 134 List<Map<String,String>> getMatdeliverHivktCheckCount(Map param);
135 135 List<Map<String,String>> getMatdeliverHivktCheckzqCount(Map param);
136 136 List<Map<String,String>> getHasMatdeliverHivktCheckzqCount(Map param);
  137 +
  138 + int getAllFmCount(Map param);
  139 + int getAllBuildCount(Map param);
  140 + int getNameFmCount(Map param);
  141 + int getNameBuildCount(Map param);
  142 + int getBuildAndFmCount(Map param);
137 143 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java View file @ e673c03
... ... @@ -382,5 +382,27 @@
382 382 public void addRisk(MysqlRisk model) {
383 383 masterMysqlAntexcMapper.addRisk(model);
384 384 }
  385 +
  386 + @Override
  387 + public int getAllFmCount(Map param){
  388 + return masterMysqlAntexcMapper.getAllFmCount(param);
  389 + }
  390 + @Override
  391 + public int getAllBuildCount(Map param){
  392 + return masterMysqlAntexcMapper.getAllBuildCount(param);
  393 + }
  394 + @Override
  395 + public int getNameFmCount(Map param){
  396 + return masterMysqlAntexcMapper.getNameFmCount(param);
  397 + }
  398 + @Override
  399 + public int getNameBuildCount(Map param){
  400 + return masterMysqlAntexcMapper.getNameBuildCount(param);
  401 + }
  402 + @Override
  403 + public int getBuildAndFmCount(Map param){
  404 + return masterMysqlAntexcMapper.getBuildAndFmCount(param);
  405 + }
  406 +
385 407 }
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml View file @ e673c03
... ... @@ -2576,6 +2576,96 @@
2576 2576 </select>
2577 2577  
2578 2578  
  2579 + <select id="getAllFmCount" resultType="java.lang.Integer" parameterType="java.util.Map">
  2580 + SELECT count(1) as allFmCount from report_matdeliver m where
  2581 + <if test="hospitalId != null and hospitalId != ''">
  2582 + m.hospitalId = #{hospitalId,jdbcType=VARCHAR}
  2583 + </if>
  2584 + <if test="startDate != null">
  2585 + and m.dueDate1 >= #{startDate}
  2586 + </if>
  2587 + <if test="endDate != null">
  2588 + and m.dueDate1 <![CDATA[ <= ]]> #{endDate}
  2589 + </if>
  2590 + </select>
  2591 +
  2592 +
  2593 + <select id="getAllBuildCount" resultType="java.lang.Integer" parameterType="java.util.Map">
  2594 + SELECT count(1) as allBuildCount from report_matdeliver m
  2595 + INNER JOIN
  2596 + (select * from report_patients p where p.hospitalId=#{hospitalId,jdbcType=VARCHAR} and p.enable is null) r on m.sourceId = r.patientId where
  2597 + <if test="hospitalId != null and hospitalId != ''">
  2598 + m.hospitalId = #{hospitalId,jdbcType=VARCHAR}
  2599 + </if>
  2600 + <if test="startDate != null">
  2601 + and m.dueDate1 >= #{startDate}
  2602 + </if>
  2603 + <if test="endDate != null">
  2604 + and m.dueDate1 <![CDATA[ <= ]]> #{endDate}
  2605 + </if>
  2606 + </select>
  2607 +
  2608 +
  2609 +
  2610 +
  2611 +
  2612 +
  2613 + <select id="getNameFmCount" resultType="java.lang.Integer" parameterType="java.util.Map">
  2614 + select count(m.id) as fmCount from report_matdeliver m INNER JOIN users u on m.fmDoctor = u.id where
  2615 + <if test="hospitalId != null and hospitalId != ''">
  2616 + m.hospitalId = #{hospitalId,jdbcType=VARCHAR}
  2617 + </if>
  2618 + <if test="startDate != null">
  2619 + and m.dueDate1 >= #{startDate}
  2620 + </if>
  2621 + <if test="endDate != null">
  2622 + and m.dueDate1 <![CDATA[ <= ]]> #{endDate}
  2623 + </if>
  2624 + <if test="userId != null">
  2625 + and u.id= #{userId,jdbcType=INTEGER}
  2626 + </if>
  2627 + </select>
  2628 +
  2629 +
  2630 + <select id="getNameBuildCount" resultType="java.lang.Integer" parameterType="java.util.Map">
  2631 + select count(m.id) as buildCount from report_matdeliver m INNER JOIN
  2632 + (select * from report_patients p where p.hospitalId=#{hospitalId,jdbcType=VARCHAR} and p.enable is null) r on m.sourceId = r.patientId INNER JOIN
  2633 + users u on r.bookbuildingDoctor = u.id where
  2634 + <if test="hospitalId != null and hospitalId != ''">
  2635 + m.hospitalId = #{hospitalId,jdbcType=VARCHAR}
  2636 + </if>
  2637 + <if test="startDate != null">
  2638 + and m.dueDate1 >= #{startDate}
  2639 + </if>
  2640 + <if test="endDate != null">
  2641 + and m.dueDate1 <![CDATA[ <= ]]> #{endDate}
  2642 + </if>
  2643 + <if test="userId != null">
  2644 + and u.id= #{userId,jdbcType=INTEGER}
  2645 + </if>
  2646 + </select>
  2647 +
  2648 +
  2649 +
  2650 + <select id="getBuildAndFmCount" resultType="java.lang.Integer" parameterType="java.util.Map">
  2651 + select count(m.id) as buildAndFmCount from report_matdeliver m INNER JOIN
  2652 + (select * from report_patients p where p.hospitalId= #{hospitalId,jdbcType=VARCHAR} and p.enable is null) r on m.sourceId = r.patientId INNER JOIN
  2653 + users u on r.bookbuildingDoctor = u.id and m.fmDoctor = r.bookbuildingDoctor where
  2654 + <if test="hospitalId != null and hospitalId != ''">
  2655 + m.hospitalId = #{hospitalId,jdbcType=VARCHAR}
  2656 + </if>
  2657 + <if test="startDate != null">
  2658 + and m.dueDate1 >= #{startDate}
  2659 + </if>
  2660 + <if test="endDate != null">
  2661 + and m.dueDate1 <![CDATA[ <= ]]> #{endDate}
  2662 + </if>
  2663 + <if test="userId != null">
  2664 + and u.id= #{userId,jdbcType=INTEGER}
  2665 + </if>
  2666 + </select>
  2667 +
  2668 +
2579 2669  
2580 2670 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java View file @ e673c03
... ... @@ -25,6 +25,7 @@
25 25 import com.lyms.platform.permission.model.Users;
26 26 import com.lyms.platform.permission.model.UsersQuery;
27 27 import com.lyms.platform.permission.service.CouponService;
  28 +import com.lyms.platform.permission.service.MysqlAntexcService;
28 29 import com.lyms.platform.permission.service.OrganizationService;
29 30 import com.lyms.platform.permission.service.UsersService;
30 31 import com.lyms.platform.pojo.*;
31 32  
32 33  
33 34  
34 35  
35 36  
36 37  
37 38  
38 39  
39 40  
40 41  
41 42  
... ... @@ -3644,53 +3645,58 @@
3644 3645 return baseResponse;
3645 3646 }
3646 3647  
3647   - public void getFmManageCount() {
3648   - }
3649   -
  3648 + @Autowired
  3649 + private MysqlAntexcService mysqlAntexcService;
3650 3650 public BaseObjectResponse getFmManageCount(String time, Integer userId) {
3651 3651 String hospitalId = autoMatchFacade.getHospitalId(userId);
3652 3652  
3653 3653 UsersQuery usersQuery = new UsersQuery();
3654 3654 usersQuery.setOrgId(Integer.parseInt(hospitalId));
3655   - usersQuery.setNames(Arrays.asList("ๅˆ˜ๆก‚่Šฌ", "่ดพๆท‘ๅนณ", "ไป˜ๅ†ฌๅŽ", "ๅฎ‹ไผŸ", "ไฟข็ด ่‹ฑ", "ๆŽ้›…็Žฒ", "้ƒ่‰ณๆธ…", "ๆŽๅฝฉๅฒฉ", "้ญ็ง€ไธฝ"));
  3655 + usersQuery.setNames(Arrays.asList("ๅˆ˜ๆก‚่Šฌ", "่ดพๆท‘ๅนณ", "ไป˜ๅ†ฌๅŽ", "ๅฎ‹ไผŸ", "ไฟข็ด ่‹ฑ", "ๆŽ้›…็Žฒ", "้ƒ่‰ณๆธ…", "ๆŽๅฝฉๅฒฉ", "้ญ็ง€ไธฝ","้š†ๅŒ–ๅฆ‡ๅนผ"));
3656 3656 List<Users> users = usersService.queryUsers(usersQuery);
3657   -
3658   -
3659   - MatDeliverQuery matDeliverQuery = new MatDeliverQuery();
3660   - matDeliverQuery.setYn(YnEnums.YES.getId());
3661   - matDeliverQuery.setFmHospital(hospitalId);
3662   - if (StringUtils.isNotEmpty(time))
  3657 + Date startDate = null;
  3658 + Date endDate = null;
  3659 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(time))
3663 3660 {
3664   - matDeliverQuery.setCreatedStart(DateUtil.getSNDate(time)[0]);
3665   - matDeliverQuery.setEndStart(DateUtil.getSNDate(time)[1]);
  3661 + String[] arrs = time.split(" - ");
  3662 + startDate = DateUtil.parseYMD(arrs[0]);
  3663 + endDate = DateUtil.parseYMD(arrs[1]);
3666 3664 }
3667   - int allFmCount = matDeliverService.count(matDeliverQuery);
3668 3665  
  3666 + Map param = new HashMap();
  3667 + param.put("startDate",startDate);
  3668 + param.put("endDate", endDate);
  3669 + param.put("hospitalId", hospitalId);
  3670 +
  3671 + int allFmCount = mysqlAntexcService.getAllFmCount(param);
  3672 +
  3673 +
  3674 +
3669 3675 List<Map> datas = new ArrayList<>();
3670 3676 int fmNameCount = 0;
3671 3677 int buildNameCount = 0;
3672   - PatientsQuery patientsQuery = new PatientsQuery();
3673   - patientsQuery.setHospitalId(hospitalId);
3674   - int allBuildCount = patientsService.queryPatientCount(patientsQuery);
  3678 + int allBuildCount = mysqlAntexcService.getAllBuildCount(param);
3675 3679  
3676 3680 for (Users user : users)
3677 3681 {
3678 3682 Map data = new HashMap();
3679   - matDeliverQuery.setDeliverDoctor(String.valueOf(user.getId()));
3680   - int fmCount = matDeliverService.count(matDeliverQuery);
  3683 + param.put("userId",String.valueOf(user.getId()));
  3684 + int fmCount = mysqlAntexcService.getNameFmCount(param);
3681 3685 fmNameCount+=fmCount;
3682 3686  
3683 3687 data.put("name",user.getName());
3684 3688 data.put("fmCount", fmCount);
3685 3689  
3686   - patientsQuery.setBookbuildingDoctor(String.valueOf(user.getId()));
3687 3690  
3688   - int buildCount = patientsService.queryPatientCount(patientsQuery);
  3691 + int buildCount = mysqlAntexcService.getNameBuildCount(param);
3689 3692 buildNameCount+=buildCount;
3690 3693  
3691 3694 data.put("buildCount", buildCount);
3692   - data.put("buildAndFmCount", 0);
3693 3695  
  3696 +
  3697 + int buildAndFmCount = mysqlAntexcService.getBuildAndFmCount(param);
  3698 + data.put("buildAndFmCount", buildAndFmCount);
  3699 +
3694 3700 datas.add(data);
3695 3701 }
3696 3702  
... ... @@ -3699,6 +3705,7 @@
3699 3705 data.put("fmCount",allFmCount - fmNameCount);
3700 3706 data.put("buildCount",allBuildCount - buildNameCount);
3701 3707 data.put("buildAndFmCount", "-");
  3708 + datas.add(data);
3702 3709  
3703 3710  
3704 3711 BaseObjectResponse objectResponse = new BaseObjectResponse();