Forráskód Böngészése

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

Conflicts:
	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
liuwenbin 7 éve
szülő
commit
3ce5adab37

+ 31 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/DispensaryTypeConvert.java

@ -0,0 +1,31 @@
package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.wlyy.entity.dimension.WlyyDimensionQuota;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.util.Contant;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
/**
 * 长处方疾病
 * Created by zhangdan on 2017/10/26.
 */
public class DispensaryTypeConvert implements Convert {
    public List<DataModel> convert(JdbcTemplate jdbcTemplate, List oneList, String slaveLevel, WlyyDimensionQuota temp ) {
        oneList.stream().forEach(one -> {
            try {
                Object value = DataModel.class.getMethod("get" + temp.getKey()).invoke(one);
                //获取到prescriptionCode,求长处方配送方式
                String sql ="SELECT dispensary_type FROM wlyy_prescription WHERE code=?";
                Object[] args = {value};
                String type=jdbcTemplate.queryForObject(sql,args,String.class);
                DataModel.class.getMethod("setSlaveKey" + slaveLevel, String.class).invoke(one, type);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        return oneList;
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -178,8 +178,8 @@ public class SwaggerConfig {
                        regex("/im_new/.*"),
                        regex("/version/.*"),
                        regex("/express/.*"),
                        regex("/doctorFeeback/.*"),
                        regex("/patientFeeback/.*"),
                        regex("/doctorFeedback/.*"),
                        regex("/patientFeedback/.*"),
                        regex("/esstatistics/.*")
                ))
                .build()

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/feedback/AppealService.java

@ -21,6 +21,8 @@ import org.springframework.data.domain.Sort.Direction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * Created by Reece on 2017/5/6.
 */
@ -75,6 +77,7 @@ public class AppealService extends BaseService {
                createrName = doctor.getName();
            }
        }
        appeal.setCreateTime(new Date());
        appeal.setCreaterName(createrName);
        appealDao.save(appeal);
    }

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/physicalExamination/PhysicalExaminationRemindService.java

@ -103,7 +103,7 @@ public class PhysicalExaminationRemindService extends BaseService {
     * @param teamCode
     * @return
     */
    public Integer isShowRemindBtns(long teamCode) {
    public Integer isShowRemindBtns(long teamCode,String doctor) {
        Integer re = 0;
        List<Map<String, Object>> signList = new ArrayList<>();
        String sql = "";
@ -116,7 +116,8 @@ public class PhysicalExaminationRemindService extends BaseService {
                " WHERE " +
                "     t1.status > 0 " +
                "    AND t1.admin_team_code = ? " +
                "    AND (YEAR(curdate()) -IF(length(idcard) = 18,substring(idcard, 7, 4),IF(length(idcard) = 15,concat('19', substring(idcard, 7, 2)),NULL)))>65 " +
                "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                "    AND (YEAR(curdate()) -IF(length(idcard) = 18,substring(idcard, 7, 4),IF(length(idcard) = 15,concat('19', substring(idcard, 7, 2)),NULL)))>=65 " +
                "    AND t1.idcard not in " +
                "       (SELECT DISTINCT s.idcard " +
                "           from wlyy_sign_family s," +
@ -170,7 +171,7 @@ public class PhysicalExaminationRemindService extends BaseService {
                "     t1.status > 0 " +
                "    AND t1.admin_team_code = ? " +
                "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                "    AND (YEAR(curdate()) -IF(length(idcard) = 18,substring(idcard, 7, 4),IF(length(idcard) = 15,concat('19', substring(idcard, 7, 2)),NULL)))>65 " +
                "    AND (YEAR(curdate()) -IF(length(idcard) = 18,substring(idcard, 7, 4),IF(length(idcard) = 15,concat('19', substring(idcard, 7, 2)),NULL)))>=65 " +
                "    AND t1.idcard not in " +
                "       (SELECT DISTINCT s.idcard " +
                "           from wlyy_sign_family s," +

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

@ -30,6 +30,7 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -2651,18 +2652,48 @@ public class StatisticsESService {
    public Map<String,Object> getPrescriptionCount(int level,String area,String disease) throws Exception{
        String index ="58";
        Map<String,Object> rs = new HashedMap();
        List<SaveModel> totalList = null;
        List<SaveModel> processingList = null;
        List<SaveModel> finishedList = null;
        List<SaveModel> canceledList = null;
        List<SaveModel> unPassList = null;
        List<SaveModel> otherList = null;
        //总数
        List<SaveModel> totalList =  elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        if(StringUtils.isNotBlank(disease)){
            totalList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }else{
            totalList = elasticsearchUtil.findListDateQuotaLevel0(null,area,level,index,"2",null);
        }
        //进行中
        List<SaveModel> processingList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"1");
        if(StringUtils.isNotBlank(disease)){
            processingList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"1");
        }else{
            processingList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }
        //已完成
        List<SaveModel> finishedList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"2");
        if(StringUtils.isNotBlank(disease)){
            finishedList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"2");
        }else{
            finishedList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }
        //已经取消
        List<SaveModel> canceledList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"3");
        if(StringUtils.isNotBlank(disease)){
            canceledList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"3");
        }else{
            canceledList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }
        //审核不通过
        List<SaveModel> unPassList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"4");
        if(StringUtils.isNotBlank(disease)){
            unPassList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"4");
        }else{
            unPassList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }
        //其他原因取消
        List<SaveModel> otherList =  elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"5");
        if(StringUtils.isNotBlank(disease)){
            otherList = elasticsearchUtil.findListDateQuotaLevel2(null,area,level,index,"2",null,disease,"5");
        }else{
            otherList = elasticsearchUtil.findListDateQuotaLevel1(null,area,level,index,"2",null,disease);
        }
        //总数
        if(totalList!=null && totalList.size()>0){
@ -2946,29 +2977,89 @@ public class StatisticsESService {
     * @param type 0.总量,1.进行中,2.已完成,3.居民取消,4.审核不通过,5.其他原因取消
     * @return
     */
    public List<SaveModel> getPrescriptionTotalLowLevel(int level,String lowlevel,String area,String disease,String type)throws Exception{
    public List<Map<String,Object>> getPrescriptionTotalLowLevel(int level,String lowlevel,String area,String disease,String type)throws Exception{
        String quotaDate = elasticsearchUtil.getQuotaTime();
        String index = "58";
        List<SaveModel> saveModels = new ArrayList<>();
        List<Map<String, Object>> rs = new ArrayList<>();
        //一级维度
        if (StringUtils.isNotBlank(disease)){
            //类型 0.总量,1.已完成,2.居民取消,3.审核不通过,4.进行中,5.其他原因取消
            if("1".equals(type)){
                saveModels = elasticsearchUtil.findListDateQuotaLevel0("",area,level,index,"2",lowlevel);
                saveModels = elasticsearchUtil.findListDateQuotaLevel0(quotaDate,area,level,index,"2",lowlevel);
            }else {
                saveModels = elasticsearchUtil.findListDateQuotaLevel1("",area,level,index,"2",lowlevel,type);
                saveModels = elasticsearchUtil.findListDateQuotaLevel1(quotaDate,area,level,index,"2",lowlevel,type);
            }
        }else{
            //类型0.总量,1.进行中,2.已完成,3.居民取消,4.审核不通过,5.其他原因取消
            if("1".equals(type)){
                saveModels = elasticsearchUtil.findListDateQuotaLevel1("",area,level,index,"2",lowlevel,disease);
                saveModels = elasticsearchUtil.findListDateQuotaLevel1(quotaDate,area,level,index,"2",lowlevel,disease);
            }else {
                saveModels = elasticsearchUtil.findListDateQuotaLevel2("",area,level,index,"2",lowlevel,disease,type);
                saveModels = elasticsearchUtil.findListDateQuotaLevel2(quotaDate,area,level,index,"2",lowlevel,disease,type);
            }
        }
        if ("5".equals(lowlevel)){
            translateTeamLeaderName2(saveModels);
        }
        return saveModels;
        Map<String, Object> map = null;
        if(saveModels.size()>0){
            for(SaveModel one:saveModels){
                map = new HashMap<>();
                if(Integer.parseInt(lowlevel)>=level){
                    lowlevel = String.valueOf(level+1);
                }
                if(SaveModel.townLevel.equals(lowlevel)){
                    map.put("code",one.getTown());
                    map.put("name",one.getTownName());
                }else if(SaveModel.OrgLevel.equals(lowlevel)){
                    map.put("code",one.getHospital());
                    map.put("name",one.getHospitalName());
                }else if(SaveModel.teamLevel.equals(lowlevel)){
                    map.put("code",one.getTeam());
                    map.put("name",one.getTeamName());
                }
                map.put("val",one.getResult2().longValue());
            }
        }else{
            //统计数据为空时,自建结果集
//            List<Map<String, Object>> resultList = new ArrayList<>();
//            resultList = getLowLevelMapKey(level, lowlevel, area);
            List<Town> townList = null;
            List<Hospital> hospitalList = null;
            List<AdminTeam> adminTeams = null;
            if(SaveModel.cityLevel.equals(level)){
                townList = townDao.findByCityCode(area);
                hospitalList = hospitalDao.findByCity(area);
                adminTeams = findAllTeam();
            }else if(SaveModel.townLevel.equals(level)){
                hospitalList = hospitalDao.findByTownCode(area);
                adminTeams = findAllTeam();
            }else if(SaveModel.OrgLevel.equals(level)){
                adminTeams = adminTeamDao.findByOrgCode(area);
            }
            if(SaveModel.townLevel.equals(lowlevel)){
                for(Town one : townList){
                    map.put("code",one.getCode());
                    map.put("name",one.getName());
                    map.put("val",0);
                }
            }else if(SaveModel.OrgLevel.equals(lowlevel)){
                for(Hospital one : hospitalList){
                    map.put("code",one.getCode());
                    map.put("name",one.getName());
                    map.put("val",0);
                }
            }else if(SaveModel.teamLevel.equals(lowlevel)){
                for(AdminTeam one : adminTeams){
                    map.put("code",one.getLeaderCode());
                    map.put("name",one.getName());
                    map.put("val",0);
                }
            }
        }
        rs.add(map);
        return rs;
    }
    public List<SaveModel> translateTeamLeaderName2(List<SaveModel> rs) {
@ -3028,6 +3119,52 @@ public class StatisticsESService {
        return map;
    }
    public Map<String,Object> getPrescriptionDispatchingTotal(int level,String area,String disease)throws Exception{
        List<SaveModel> seltList = null;//自取集合
        List<SaveModel> deliveryList = null;//物流配送集合
        List<SaveModel> healthDoctorList = null;//健管师配送集合
        if(StringUtils.isNotBlank(disease)){
            //自取
            seltList = elasticsearchUtil.findListDateQuotaLevel2("",area,level,"62","2","","1",disease);
            //物流配送
            deliveryList = elasticsearchUtil.findListDateQuotaLevel2("",area,level,"62","2","","2",disease);
            //健管师配送
            healthDoctorList = elasticsearchUtil.findListDateQuotaLevel2("",area,level,"62","2","","2",disease);
        }else{
            //自取
            seltList = elasticsearchUtil.findListDateQuotaLevel1("",area,level,"62","2","","1");
            //物流配送
            deliveryList = elasticsearchUtil.findListDateQuotaLevel1("",area,level,"62","2","","2");
            //健管师配送
            healthDoctorList = elasticsearchUtil.findListDateQuotaLevel1("",area,level,"62","2","","2");
        }
        Map<String,Object> rs = new HashedMap();
        //自取数目
        if(seltList!=null && seltList.size()>0){
            rs.put("seltTotal",seltList.get(0).getResult2());
        }else{
            rs.put("seltTotal",0);
        }
        //快递配送
        if(deliveryList!=null && deliveryList.size()>0){
            rs.put("deliveryTotal",deliveryList.get(0).getResult2());
        }else{
            rs.put("deliveryTotal",0);
        }
        //健管师配送
        if(healthDoctorList!=null && healthDoctorList.size()>0){
            rs.put("doctorTotal",healthDoctorList.get(0).getResult2());
        }else{
            rs.put("doctorTotal",0);
        }
        return rs;
    }
    /**
     * 获取下部部费用平均值或总数
     * @param level

+ 0 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwMaternalChildService.java

@ -12,7 +12,6 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2017/9/25.
@ -42,13 +41,6 @@ public class JwMaternalChildService {
        params.add(new BasicNameValuePair("idcard", idcard));
        params.add(new BasicNameValuePair("hospital", hospital));
        if(idcard.contains("352124761015122-")){
            String temp[] = idcard.split("-");
            String sql = "SELECT response FROM wlyy_zy_push_log_detail WHERE id = "+temp[1];
            List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
            return list.get(0).get("response").toString();
        }
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/feedback/DoctorAppealController.java

@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.*;
 */
@Controller
@RestController
@RequestMapping(value = "/doctorFeeback/feedback")
@RequestMapping(value = "/doctorFeedback/feedback")
@Api(description = "医生端账号申诉")
public class DoctorAppealController extends BaseController{
    @Autowired

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PyhsicExamRemindController.java

@ -38,8 +38,7 @@ public class PyhsicExamRemindController extends BaseController{
        try {
            page = page==null?0:page;
            pagesize = pagesize==null?10:pagesize;
            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,"3782f16386f211e6b394fa163e424525",page,pagesize);
//            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,getUID(),page,pagesize);
            JSONArray list = physicalExaminationRemindService.getOldPatientByTeamCode(adminTeamCode,getUID(),page,pagesize);
            return write(200, "查询成功", "data", list);
        } catch (Exception e) {
            e.printStackTrace();
@ -52,7 +51,7 @@ public class PyhsicExamRemindController extends BaseController{
    public String isShowRemindBtns(@ApiParam(name = "adminTeamCode", value = "行政团队编码", defaultValue = "485")
                                   @RequestParam(value = "adminTeamCode", required = true) Long adminTeamCode){
        try {
            Integer re = physicalExaminationRemindService.isShowRemindBtns(adminTeamCode);
            Integer re = physicalExaminationRemindService.isShowRemindBtns(adminTeamCode,getUID());
            return write(200, "查询成功", "data", re);
        } catch (Exception e) {
            e.printStackTrace();

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

@ -1678,6 +1678,20 @@ public class EsStatisticsController extends BaseController {
        }
    }
    @RequestMapping("/getPrescriptionCount")
    @ResponseBody
    @ApiOperation("订单统计-顶部总数获取")
    public String getPrescriptionCount(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                       @ApiParam(name="area", value="级别对应编码") @RequestParam(required = true)String area,
                                       @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionCount(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getPrescriptionTotalHistogram")
    @ResponseBody
    @ApiOperation("订单统计-中部树状图获取")
@ -1709,6 +1723,7 @@ public class EsStatisticsController extends BaseController {
        }
    }
    @RequestMapping("/getPrescriptionCostLowLevel")
    @ResponseBody
    @ApiOperation("费用统计-下部列表接口")
@ -1744,6 +1759,20 @@ public class EsStatisticsController extends BaseController {
        }
    }
    @RequestMapping("/getPrescriptionDispatchingTotal")
    @ResponseBody
    @ApiOperation("配送统计-头部总数接口")
    public String getPrescriptionDispatchingTotal(@ApiParam(name="level", value="级别") @RequestParam(required = true)String level,
                                                  @ApiParam(name="area", value="级别编码") @RequestParam(required = true)String area,
                                                  @ApiParam(name="disease", value="疾病") @RequestParam(required = false)String disease){
        try{
            return write(200, "查询成功", "data", statisticsESService.getPrescriptionDispatchingTotal(elasticsearchUtil.changeLevel(Integer.valueOf(level)),area,disease));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    @RequestMapping("/getPrescriptionDispatchingLowLevel")
    @ResponseBody
    @ApiOperation("配送统计-下部条形图")