浏览代码

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

chenweida 8 年之前
父节点
当前提交
c2ef3d44ab

+ 13 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -14,6 +14,7 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.statistics.PopulationBaseDao;
import com.yihu.wlyy.repository.statistics.WlyyQuotaResultDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.util.DateUtil;
import org.json.JSONArray;
import org.json.JSONObject;
@ -52,6 +53,8 @@ public class StatisticsAllService extends BaseService {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private WlyyQuotaResultDao wlyyQuotaResultDao;
    @Autowired
    private SystemDictService systemDictService;
    /**
     * 获取时间戳
@ -562,7 +565,7 @@ public class StatisticsAllService extends BaseService {
                }
            }
            if ((level == 4 && "1".equals(lowLevel)) || (level == 2)||(level == 3 && "1".equals(lowLevel))) {
            if ((level == 4 && "1".equals(lowLevel)) || (level == 2) || (level == 3 && "1".equals(lowLevel))) {
                translateTeamLeaderName(resultList);
            }
@ -615,12 +618,16 @@ public class StatisticsAllService extends BaseService {
        if (resultList == null || resultList.size() < 1) {
            resultList = getLowLevelMapKey(level, low_level, area);
        }
        //获取目标量和团队的调控量
        String signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM", year);//目标量
        String signRegulationNum = systemDictService.getDictValueNoRedis("SIGN_TEAM_REGULATION_NUM", year);//调控量
        if (resultList != null) {
            DecimalFormat df = new DecimalFormat("0.0000");
            for (int i = 0; i < resultList.size(); i++) {
                Map<String, Object> map = resultList.get(i);
                map.put("amount", map.get("amount") != null ? Long.valueOf(map.get("amount").toString()) : 0L);
                map.put("signTaskNum",signTaskNum);//目标量
                map.put("signRegulationNum",signRegulationNum);//调控量
                if (!low_level.equals("1")) {
                    String code = map.get("code").toString();
@ -2524,7 +2531,7 @@ public class StatisticsAllService extends BaseService {
        if (rs != null && rs.size() > 0) {
            for (Map<String, Object> r : rs) {
                String id = (String) r.get("code");
                    String name = getTeamLeaderNameByTeamCode(leaders, Integer.parseInt(id));
                String name = getTeamLeaderNameByTeamCode(leaders, Integer.parseInt(id));
                if (org.apache.commons.lang3.StringUtils.isNotBlank(name)) {
                    r.put("name", name);
                }
@ -2734,11 +2741,11 @@ public class StatisticsAllService extends BaseService {
            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());
                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());
                if (one != null) {
                    signNum = Integer.valueOf(one.getResult());
                }
                map.put("rate", getRange(renewNum, signNum, 2));//续签率是 续签量/去年的签约数
                map.put("signNum", signNum);

+ 26 - 32
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/system/SystemDictService.java

@ -23,46 +23,44 @@ public class SystemDictService {
        return systemDictDao.findByDictName(name);
    }
    private String dictName =  "SYSTEM_PARAMS";
    private String dictName = "SYSTEM_PARAMS";
    public String getDictValueNoRedis(String dictName, String code) {
        String re = systemDictDao.findByDictNameAndCode(dictName, code);
        return re;
    }
    /**
     * 字典转译
     *
     * @param dictName
     * @param code
     * @return
     */
    public String getDictValue(String dictName,String code){
    public String getDictValue(String dictName, String code) {
        String re = "";
        try {
            if(!StringUtils.isEmpty(code))
            {
            if (!StringUtils.isEmpty(code)) {
                //判断该字典redis是否存在
                String exit = redisTemplate.opsForValue().get("systemDict:"+dictName);
                if(!StringUtils.isEmpty(exit))
                {
                    re =  redisTemplate.opsForValue().get("systemDict:"+dictName+":"+code);
                }
                else{
                String exit = redisTemplate.opsForValue().get("systemDict:" + dictName);
                if (!StringUtils.isEmpty(exit)) {
                    re = redisTemplate.opsForValue().get("systemDict:" + dictName + ":" + code);
                } else {
                    List<SystemDict> list = systemDictDao.findByDictName(dictName);
                    if(list!=null && list.size()>0)
                    {
                        redisTemplate.opsForValue().set("systemDict:"+dictName,"1");
                        for(SystemDict item:list)
                        {
                            redisTemplate.opsForValue().set("systemDict:"+dictName+":"+item.getCode(),item.getValue());
                            if(code.equals(item.getCode()))
                            {
                    if (list != null && list.size() > 0) {
                        redisTemplate.opsForValue().set("systemDict:" + dictName, "1");
                        for (SystemDict item : list) {
                            redisTemplate.opsForValue().set("systemDict:" + dictName + ":" + item.getCode(), item.getValue());
                            if (code.equals(item.getCode())) {
                                re = item.getValue();
                            }
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
        } catch (Exception ex) {
            ex.printStackTrace();
            re = systemDictDao.findByDictNameAndCode(dictName,code);
            re = systemDictDao.findByDictNameAndCode(dictName, code);
        }
        return re;
    }
@ -70,22 +68,18 @@ public class SystemDictService {
    /************************************** 其他参数 ****************************************/
    /**
     * http_log是否记录成功消息
     *
     * @return
     */
    public Boolean getSaveSuccessLog()
    {
        try{
    public Boolean getSaveSuccessLog() {
        try {
            String re = systemDictDao.findByDictNameAndCode(dictName, "SAVE_SUCCESS_LOG");
            if("1".equals(re))
            {
            if ("1".equals(re)) {
                return true;
            }
            else{
            } else {
                return false;
            }
        }
        catch (Exception ex)
        {
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }

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

@ -528,8 +528,10 @@ public class StatisticsController extends BaseController {
                    } else if ( index.equals("21")) {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotal2(date, area, level, idx, sort, lowLevel));
                    } else if (idx.equals("28")) {
                        //level=4&area=350200&sort=1&index=28&date=undefined&lowLevel=2
                        result.put("index_" + idx, statisticsService.getAvgAllInfo(level, area, lowLevel));
                    } else if (idx.equals("13")) {
                        // sort=1&date=2017-07-13&level=4&index=13&area=350200&lowCode=
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel,year));
                    } else {
                        result.put("index_" + idx, statisticsAllService.getLowLevelTotal(date, area, level, idx, sort, lowLevel,year));