Commit db6895f5727b99754993db66d3d8e501fb749421

Authored by litao@lymsh.com
1 parent bbf8687bf1

加接口

Showing 9 changed files with 102 additions and 0 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterOrganizationMapper.java View file @ db6895f
... ... @@ -4,6 +4,7 @@
4 4 import com.lyms.platform.permission.model.OrganizationQuery;
5 5  
6 6 import java.util.List;
  7 +import java.util.Map;
7 8  
8 9 public interface MasterOrganizationMapper {
9 10 public Integer addOrganization(Organization obj);
... ... @@ -23,5 +24,7 @@
23 24 List<Organization> queryHospital();
24 25  
25 26 void execSql(String sql);
  27 +
  28 + List<Map<String,Object>> getOrganizationByAreaId(String id);
26 29 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java View file @ db6895f
... ... @@ -4,6 +4,7 @@
4 4 import com.lyms.platform.permission.model.OrganizationQuery;
5 5  
6 6 import java.util.List;
  7 +import java.util.Map;
7 8  
8 9 public interface OrganizationService {
9 10 public Integer addOrganization(Organization obj);
... ... @@ -31,5 +32,7 @@
31 32 public void rebuildDefaultRoles();
32 33  
33 34 void execSql(String sql);
  35 +
  36 + List<Map<String,Object>> getOrganizationByAreaId(String id);
34 37 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java View file @ db6895f
... ... @@ -82,6 +82,12 @@
82 82 masterOrganizationMapper.execSql(sql);
83 83 }
84 84  
  85 + @Override
  86 + public List<Map<String, Object>> getOrganizationByAreaId(String id) {
  87 + return masterOrganizationMapper.getOrganizationByAreaId(id);
  88 + }
  89 +
  90 +
85 91 private void addDefaultRoles(Organization obj) {
86 92 List<Roles> rolesList = new ArrayList<>();
87 93 rolesList.add(rolesService.getRoles(87));
platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml View file @ db6895f
... ... @@ -249,6 +249,10 @@
249 249 <select id="execSql" parameterType="String">
250 250 ${value}
251 251 </select>
  252 +
  253 + <select id="getOrganizationByAreaId" parameterType="string" resultType="map">
  254 + SELECT id, name FROM `organization` where yn = 1 and area_id = #{areaId}
  255 + </select>
252 256  
253 257 </mapper>
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java View file @ db6895f
... ... @@ -25,6 +25,18 @@
25 25 private AreaCountFacade areaCountFacade;
26 26  
27 27 /**
  28 + * flag 是否返回的是医院
  29 + * @param name
  30 + * @param flag
  31 + * @return
  32 + */
  33 + @RequestMapping(value = "/area/childs", method = RequestMethod.GET)
  34 + @ResponseBody
  35 + public BaseResponse getAreaChilds(@RequestParam String name, boolean flag) {
  36 + return areaCountFacade.getAreaChilds(name, flag);
  37 + }
  38 +
  39 + /**
28 40 * 产检节点统计
29 41 * @param request
30 42 * @param time 时间范围
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ db6895f
... ... @@ -11,6 +11,7 @@
11 11 import org.springframework.stereotype.Controller;
12 12 import org.springframework.web.bind.annotation.RequestMapping;
13 13 import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RequestParam;
14 15 import org.springframework.web.bind.annotation.ResponseBody;
15 16  
16 17 import javax.servlet.http.HttpServletRequest;
... ... @@ -29,6 +30,37 @@
29 30  
30 31 @Autowired
31 32 private IReportService reportService;
  33 +
  34 + /**
  35 + * 建档统计(环比)
  36 + * @param areaType 1=省 2=市 3=区县
  37 + * @param startDate
  38 + * @param endDate
  39 + * @param reportType 1=周 2=月 3=季度 4=半年 5=年
  40 + * @return
  41 + */
  42 + @ResponseBody
  43 + @TokenRequired
  44 + @RequestMapping(value = "/patient/huanbi", method = RequestMethod.GET)
  45 + public BaseObjectResponse patientHuanBi(@RequestParam Integer areaType, Date startDate, Date endDate, Integer reportType, HttpServletRequest request) {
  46 + return reportService.patientHuanBi(areaType, startDate, endDate, reportType, getUserId(request));
  47 + }
  48 +
  49 + /**
  50 + * 建档统计(占比)
  51 + * @param areaType 1=省 2=市 3=区县
  52 + * @param ageType 1=全部年龄 2=20岁以下 3=20-30岁 4=30-40岁 5=40岁以上
  53 + * @param areaId 乡镇ID
  54 + * @param patientType 建档孕周 1=孕早期 2=孕中期 3=孕晚期
  55 + * @return
  56 + */
  57 + @ResponseBody
  58 + @TokenRequired
  59 + @RequestMapping(value = "/patient/zhanbi", method = RequestMethod.GET)
  60 + public BaseObjectResponse patientZhanbi(@RequestParam Integer areaType, @RequestParam Integer ageType, Integer areaId, Integer patientType, HttpServletRequest request) {
  61 + return reportService.patientZhanbi(areaType, ageType, areaId, patientType, getUserId(request));
  62 + }
  63 +
32 64  
33 65 /**
34 66 * 未发放优惠券统计
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AreaCountFacade.java View file @ db6895f
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseObjectResponse;
9 9 import com.lyms.platform.common.result.BaseResponse;
  10 +import com.lyms.platform.common.result.RespBuilder;
10 11 import com.lyms.platform.common.utils.*;
11 12 import com.lyms.platform.common.utils.StringUtils;
12 13 import com.lyms.platform.operate.web.utils.CommonsHelper;
... ... @@ -19,6 +20,7 @@
19 20 import com.lyms.platform.permission.service.OrganizationService;
20 21 import com.lyms.platform.permission.service.UsersService;
21 22 import com.lyms.platform.pojo.AntExRecordModel;
  23 +import com.lyms.platform.pojo.BasicConfig;
22 24 import com.lyms.platform.pojo.DataPermissionsModel;
23 25 import com.lyms.platform.pojo.Patients;
24 26 import com.lyms.platform.query.AntExRecordQuery;
... ... @@ -28,6 +30,9 @@
28 30 import org.springframework.beans.factory.annotation.Autowired;
29 31 import org.springframework.beans.factory.annotation.Qualifier;
30 32 import org.springframework.data.domain.Sort;
  33 +import org.springframework.data.mongodb.core.MongoTemplate;
  34 +import org.springframework.data.mongodb.core.query.Criteria;
  35 +import org.springframework.data.mongodb.core.query.Query;
31 36 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
32 37 import org.springframework.stereotype.Component;
33 38  
... ... @@ -46,6 +51,8 @@
46 51 @Component
47 52 public class AreaCountFacade {
48 53  
  54 + @Autowired
  55 + private MongoTemplate mongoTemplate;
49 56  
50 57 @Autowired
51 58 private AntExRecordService recordService;
... ... @@ -832,6 +839,27 @@
832 839  
833 840 ResponseUtil.responseExcel(cnames,results,httpServletResponse);
834 841 }
  842 +
  843 + public BaseResponse getAreaChilds(String name, boolean flag) {
  844 + List<Map<String, Object>> childs = new ArrayList<>();
  845 + BasicConfig basic = mongoTemplate.findOne(Query.query(Criteria.where("name").is(name)), BasicConfig.class);
  846 + if(basic != null) {
  847 + if(flag) {
  848 + List<Map<String, Object>> hospitals = organizationService.getOrganizationByAreaId(basic.getId());
  849 + childs.addAll(hospitals);
  850 + } else {
  851 + List<BasicConfig> basicConfigs = mongoTemplate.find(Query.query(Criteria.where("typeId").is("b7ea005c-dfac-4c2a-bdae-25239b3f44fd").and("parentId").is(basic.getId())), BasicConfig.class);
  852 + for (BasicConfig basicConfig : basicConfigs) {
  853 + Map<String, Object> temp = new HashMap<>();
  854 + temp.put("id", basicConfig.getId());
  855 + temp.put("name", basicConfig.getName());
  856 + childs.add(temp);
  857 + }
  858 + }
  859 + }
  860 + return RespBuilder.buildSuccess(childs);
  861 + }
  862 +
835 863  
836 864 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java View file @ db6895f
... ... @@ -97,5 +97,9 @@
97 97 void unUsedExport(Date startDate, Date endDate, String provinceId, String cityId, String areaId, String hospitalId, Integer userId, HttpServletResponse response);
98 98  
99 99 BaseObjectResponse unUsedPeopleInfo(Date startDate, Date endDate, String provinceId, String cityId, String areaId, String hospitalId, Integer page, Integer limit, Integer userId);
  100 +
  101 + BaseObjectResponse patientHuanBi(Integer areaType, Date startDate, Date endDate, Integer reportType, Integer userId);
  102 +
  103 + BaseObjectResponse patientZhanbi(Integer areaType, Integer ageType, Integer areaId, Integer patientType, Integer userId);
100 104 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ db6895f
... ... @@ -178,6 +178,16 @@
178 178 }
179 179  
180 180 @Override
  181 + public BaseObjectResponse patientHuanBi(Integer areaType, Date startDate, Date endDate, Integer reportType, Integer userId) {
  182 + return null;
  183 + }
  184 +
  185 + @Override
  186 + public BaseObjectResponse patientZhanbi(Integer areaType, Integer ageType, Integer areaId, Integer patientType, Integer userId) {
  187 + return null;
  188 + }
  189 +
  190 + @Override
181 191 public BaseObjectResponse areaCountFacade(String startDate, String endDate, Integer startWeek, Integer endWeek, Integer childBirth, Integer userId) {
182 192 BaseObjectResponse rest = new BaseObjectResponse();
183 193 Map<String, Object> restMap = new HashMap<>();