Просмотр исходного кода

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 лет назад
Родитель
Сommit
a6a00acf98

+ 6 - 6
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -173,7 +173,7 @@ public class CurrentDayAllQuotaJob implements Job {
     */
    public Map<String,Object> getTowmRenewTotals(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient " +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard " +
                    " from wlyy_sign_family_renew_log fr " +
                    " where  " +
                    " fr.apply_date<'"+ tomorrow+"' and " +
@ -199,7 +199,7 @@ public class CurrentDayAllQuotaJob implements Job {
     */
    public Map<String,Object> getOrgRenewTotals(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient " +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard " +
                    " from wlyy_sign_family_renew_log fr " +
                    " where " +
                    " fr.apply_date<'"+ tomorrow+"' and  fr.sign_year= '" + Constant.getNowYearByDate(tomorrow) + "'and  fr.hospital=fr.old_hospital  and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
@ -221,7 +221,7 @@ public class CurrentDayAllQuotaJob implements Job {
     */
    public Map<String,Object> getTeamRenewTotals(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient " +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard " +
                    " from wlyy_sign_family_renew_log fr " +
                    " where   " +
                    " fr.apply_date<'"+ tomorrow+"' and  fr.sign_year= '" + Constant.getNowYearByDate(tomorrow) + "' and fr.admin_team_id=fr.old_admin_team_id  and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
@ -239,7 +239,7 @@ public class CurrentDayAllQuotaJob implements Job {
    public Map<String,Object> getTeamRenewOut(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient " +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard " +
                    " from wlyy_sign_family_renew_log fr " +
                    " where    " +
                    " fr.apply_date<'"+ tomorrow+"' and  fr.sign_year= '" + Constant.getNowYearByDate(tomorrow) + "' and fr.admin_team_id!=fr.old_admin_team_id  and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
@ -257,7 +257,7 @@ public class CurrentDayAllQuotaJob implements Job {
    public Map<String,Object> getOrgRenewOut(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient" +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard" +
                    " from wlyy_sign_family_renew_log fr " +
                    " where   " +
                    " fr.apply_date<'"+ tomorrow+"' and  fr.sign_year= '" + Constant.getNowYearByDate(tomorrow) + "' and fr.admin_team_id!=fr.old_admin_team_id and fr.hospital!=fr.old_hospital and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";
@ -275,7 +275,7 @@ public class CurrentDayAllQuotaJob implements Job {
    public Map<String,Object> getTownRenewOut(){
        try{
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient " +
            String sql=" select fr.sign_code code,fr.old_hospital hospital,fr.old_admin_team_id admin_team_id ,fr.patient,fr.idcard " +
                    " from wlyy_sign_family_renew_log fr " +
                    " where " +
                    " fr.apply_date<'"+ tomorrow+"' and  fr.sign_year= '" + Constant.getNowYearByDate(tomorrow) + "' and fr.admin_team_id!=fr.old_admin_team_id and fr.hospital!=fr.old_hospital and LEFT(fr.hospital,6)!=LEFT(fr.old_hospital,6)  and LENGTH(fr.hospital)=10 and LENGTH(fr.old_hospital)=10 ";

+ 13 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1322,12 +1322,20 @@ public class StatisticsESService {
        return returnMap;
    }
    /**
     *
     * @param level    level1_type等级 5:团队 4社区机构 3区级 2市级
     * @param area
     * @param lowLevel
     * @return
     * @throws Exception
     */
    public String getAvgAllInfo(int level, String area, String lowLevel) throws Exception {
        JSONObject returnJo = new JSONObject();
        JSONArray ja = new JSONArray();
        //市级
        if (level == 2) {
            if (StringUtils.isBlank(lowLevel)) {
            if ("3".equals(lowLevel)) {
                List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "3");
                esModelList.forEach(one -> {
                    JSONObject jo = new JSONObject();
@ -1336,8 +1344,8 @@ public class StatisticsESService {
                    jo.put("avgCount", getRangeDouuble(one.getResult1(), one.getResult2().intValue(), 2));
                    ja.put(jo);
                });
            } else {
                List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "2");
            } else if("4".equals(lowLevel)) {
                List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "4");
                esModelList.forEach(one -> {
                    JSONObject jo = new JSONObject();
                    jo.put("name", one.getHospitalName());
@ -1347,7 +1355,7 @@ public class StatisticsESService {
                });
            }
        } else if (level == 3) {
            List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "2");
            List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "3");
            esModelList.forEach(one -> {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getHospitalName());
@ -1357,7 +1365,7 @@ public class StatisticsESService {
            });
        } else if (level == 4) {
            List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "1");
            List<SaveModel> esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(DateUtil.dateToStrShort(new Date()), area, level, "28", SaveModel.timeLevel_DDL, "5");
            esModelList.forEach(one -> {
                JSONObject jo = new JSONObject();
                jo.put("name", one.getTeam());

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -868,6 +868,7 @@ public class ElasticsearchUtil {
    /**
     * 将参数转换成需要的SaveModel里的标识
     * @param level 等级  4 市  3区  2社区 1团队
     *  转换后的level  等级  2 市  3区  4社区 5团队
     * @return
     * @author zhangdan
     * @time 2017-10-18

+ 2 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -31,7 +31,7 @@ import java.util.TreeMap;
 * Created by chenweida on 2017/10/13.
 */
@Controller
@RequestMapping(value = "/esstatistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = {RequestMethod.GET, RequestMethod.POST})
@Api(description = "ES统计查询")
public class EsStatisticsController extends BaseController {
@ -789,7 +789,7 @@ public class EsStatisticsController extends BaseController {
    /**
     * 获取得分平均数
     *
     * http://172.19.103.11:9092/wlyy//statistics/getAVGSocre?level=4&area=350200
     * @param level
     * @param area
     * @return
@ -798,7 +798,6 @@ public class EsStatisticsController extends BaseController {
    @ResponseBody
    public String getAVGSocre(@RequestParam(required = true) String level, @RequestParam(required = true) String area) {
        try {
            level = elasticsearchUtil.changeLevel(Integer.parseInt(level))+"";
            return write(200, "查询成功", "data", statisticsService.getAVGSocre(level, area));
        } catch (Exception e) {
            e.printStackTrace();
@ -818,7 +817,6 @@ public class EsStatisticsController extends BaseController {
                                     @RequestParam(required = true) String statDate,
                                     @RequestParam(required = true) String endDate) {
        try {
            level = elasticsearchUtil.changeLevel(Integer.parseInt(level))+"";
            return write(200, "查询成功", "data", statisticsESService.getAVGSocreByMonth(level, area, statDate, endDate));
        } catch (Exception e) {
            error(e);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -29,7 +29,7 @@ import java.util.*;
 * Created by lyr on 2016/08/16.
 */
@Controller
@RequestMapping(value = "/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@RequestMapping(value = "/old/statistics", produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = {RequestMethod.GET,RequestMethod.POST})
@Api(description = "统计")
public class StatisticsController extends BaseController {