Преглед изворни кода

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

yeshijie пре 7 година
родитељ
комит
5e12208299

+ 6 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -518,12 +518,14 @@ public class PrescriptionInfoService extends BaseService {
            object = prescriptionService.checkRecipeNoPay(2,code);
            String status = object.getString("status");
            if("200".equals(status)){
                //-1操作失败 0新开 1待执行 5已执行 9作废 404没有找到对应的数据
                rs.put("zyStatus",object.getString("code"));
                //-1操作失败 0新开 1待执行 5已执行 9作废 404没有找到对应的数据.
                String jwCode = object.getString("code");
                if("9".equals(jwCode)){
                    prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.pay_cancle.getValue());
                }
                rs.put("jwStatus",object.getString("code"));
            }else{
                rs.put("zyStatus",status);
            }
            rs.put("zyMsg",object.getString("message"));
        }
        if (prescriptionAdjusts != null && prescriptionAdjusts.size() > 0) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -427,7 +427,7 @@ public class PrescriptionService extends BaseService {
                    //如果基卫返回回来的处方状态为“作废”,code为9的时候,修改本地数据库
                    //处方状态为“线下取消”
                    if("9".equals(code)){
                        prescriptionDao.updateStatus(prescriptionCode,-5);
                        prescriptionDao.updateStatus(prescriptionCode,PrescriptionLog.PrescriptionLogStatus.pay_cancle.getValue());
                        statusObj.put("status",200);
                        statusObj.put("code",9);
                        statusObj.put("message","基卫处方为作废,已修改本地数据库该处方为线下取消");

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

@ -2135,7 +2135,7 @@ public class StatisticsESService {
    /**
     * 去年的签约量,续签量和续签率 列表
     * @param area
     * @param level 等级 1(5):团队 2(4)社区机构 3()3区级 4(2)市级
     * @param level 等级 1(5):团队 2(4)社区机构 (3)3区级 4(2)市级
     * @param index
     * @param sort
     * @param lowLevel
@ -2178,74 +2178,74 @@ public class StatisticsESService {
        //自建结果集
        resultList = getLowLevelMapKey(level, low_level, area);
//        if (resultList != null) {
//            DecimalFormat df = new DecimalFormat("0.0000");
//            //查询去年的签约转map
//            if (StringUtils.isBlank(lowCode)) {
//                yearsYear = findQuotaResultList(lastDate, Integer.valueOf(low_level), "1");
//            } else {
//                if ("3".equals(lowCode)) {
//                    //老年人
//                    yearsYear = findQuotaResultsWithLevelType1AndLevelType2(lastDate, Integer.valueOf(low_level), "17", "3");
//                } else if ("4".equals(lowCode)) {
//                    //高血压
//                    yearsYear = findQuotaResultsWithLevelType1AndLevelType2(lastDate, Integer.valueOf(low_level), "17", "1");
//                } else if ("5".equals(lowCode)) {
//                    //糖尿病
//                    yearsYear = findQuotaResultsWithLevelType1AndLevelType2(lastDate, Integer.valueOf(low_level), "17", "2");
//                } else {
//                }
//            }
//
//            Map<String, WlyyQuotaResult> resultMap = new HashMap<>();
//            yearsYear.stream().forEach(one -> {
//                if ("1".equals(low_level)) {
//                    resultMap.put(one.getQkdoctorCode(), one);
//                } else if ("2".equals(low_level)) {
//                    resultMap.put(one.getOrgCode(), one);
//                } else if ("3".equals(low_level)) {
//                    resultMap.put(one.getTown(), one);
//                }
//            });
//
//            for (Map<String, Object> map : resultList) {
//                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
//                //获取去年签约的人数 默认是上个年度的最后一天
//                WlyyQuotaResult one = resultMap.get(map.get("code").toString());
//                int signNum = 0;
//                int renewNum = renewMap.get(map.get("code").toString());
//                if (one != null) {
//                    signNum = Integer.valueOf(one.getResult());
//                }
//                map.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
//                map.put("signNum", signNum);
//                map.put("renewNum", renewNum);
//
//            }
//
//            if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
//                translateTeamLeaderName(resultList);
//            }
//            //对结果进行排序
//            Collections.sort(resultList, new Comparator<Map<String, Object>>() {
//                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
//                    int map1value = (int) o1.get("renewNum");
//                    int map2value = (int) o2.get("renewNum");
//
//                    if (map1value - map2value > 0) {
//                        return sort == 1 ? -1 : 1;
//                    } else if (map1value - map2value < 0) {
//                        return sort == 1 ? 1 : -1;
//                    } else {
//                        return 0;
//                    }
//                }
//            });
//
//            return new JSONArray(resultList);
//        } else {
//            return new JSONArray();
//        }
        return null;
        if (resultList != null) {
            DecimalFormat df = new DecimalFormat("0.0000");
            //查询去年的签约转map
            List<SaveModel> yearsList = new ArrayList();
            if (StringUtils.isBlank(lowCode)) {
                yearsList = elasticsearchUtil.findListDateQuotaLevel0(lastDate,"",Integer.valueOf(low_level),"1","2","");
            } else {
                if ("3".equals(lowCode)) {
                    //老年人
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate,"",Integer.valueOf(low_level),"17","2","","3");
                } else if ("4".equals(lowCode)) {
                    //高血压
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate,"",Integer.valueOf(low_level),"17","2","","1");
                } else if ("5".equals(lowCode)) {
                    //糖尿病
                    yearsList = elasticsearchUtil.findListDateQuotaLevel1(lastDate,"",Integer.valueOf(low_level),"17","2","","2");
                } else {
                }
            }
            Map<String, SaveModel> resultMap = new HashMap<>();
            yearsList.stream().forEach(one -> {
                if ("5".equals(low_level)) {
                    resultMap.put(one.getTeam(), one);
                } else if ("4".equals(low_level)) {
                    resultMap.put(one.getHospital(), one);
                } else if ("3".equals(low_level)) {
                    resultMap.put(one.getTown(), one);
                }
            });
            for (Map<String, Object> map : resultList) {
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                //获取去年签约的人数 默认是上个年度的最后一天
                SaveModel one = resultMap.get(map.get("code").toString());
                int signNum = 0;
                int renewNum = renewMap.get(map.get("code").toString());
                if (one != null) {
                    signNum = Integer.valueOf(one.getResult2());
                }
                map.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
                map.put("signNum", signNum);
                map.put("renewNum", renewNum);
            }
            if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
                translateTeamLeaderName(resultList);
            }
            //对结果进行排序
            Collections.sort(resultList, new Comparator<Map<String, Object>>() {
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    int map1value = (int) o1.get("renewNum");
                    int map2value = (int) o2.get("renewNum");
                    if (map1value - map2value > 0) {
                        return sort == 1 ? -1 : 1;
                    } else if (map1value - map2value < 0) {
                        return sort == 1 ? 1 : -1;
                    } else {
                        return 0;
                    }
                }
            });
            return new JSONArray(resultList);
        } else {
            return new JSONArray();
        }
    }
}

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

@ -1563,7 +1563,7 @@ public class EsStatisticsController extends BaseController {
                lowLevel = level - 1 + "";
            }
            result.put("index_" + index, statisticsESService.getLevelTwoLowLevelTotalSignAndRenew(area,elasticsearchUtil.changeLevel(level), index, sort, String.valueOf(elasticsearchUtil.changeLevel(Integer.valueOf(lowLevel))), year, lowCode));
//            result.put("index_" + index, statisticsAllService.getLevelTwoLowLevelTotalSignAndRenew(area, changeLevel(level), index, sort, String.valueOf(changeLevel(Integer.valueOf(lowLevel))), year, lowCode));
            return write(200, "查询成功", "data", result);

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

@ -1594,6 +1594,7 @@ public class StatisticsController extends BaseController {
     */
    @RequestMapping("/lowlevel_all_sign_renew")
    @ResponseBody
    @Deprecated
    public String getIndexLowLevelTotalSignAndRenew(
            @RequestParam(required = true) String index,
            @RequestParam(required = true) String area,