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

Merge branch 'dev-1.3.7' of trick9191/patient-co-management into dev-1.3.7

trick9191 7 éve
szülő
commit
8f31123b4e

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/EncodingFilter.java

@ -38,7 +38,6 @@ public class EncodingFilter implements Filter {
            for (int i = 0; i < values.length; i++) {
                String value = values[i];
                newRequest.removeAttribute(key);
                System.out.println("key:"+key+"value:"+value+" reqURL:"+request.getRequestURI());
//                解决%、+后中文以英文编码传入URLDecoder异常
                value = CodeFomat.dateToChinese(value);
                newRequest.addParameter(key, URLDecoder.decode((value),"utf-8"));

+ 14 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -70,8 +70,6 @@ public class PatientInfoService extends BaseService {
    @Autowired
    private TblBasicDao tblBasicDao;
    @Autowired
    private SocialSecurityInfoDao socialSecurityInfoDao;
    @Autowired
    SMSService smsService;
    @Autowired
    SignFamilyDao signFamilyDao;
@ -93,6 +91,8 @@ public class PatientInfoService extends BaseService {
    JdbcTemplate jdbcTemplate;
    @Autowired
    RSAUtils rsaUtils;
    @Autowired
    SocialSecurityInfoDao socialSecurityInfoDao;
    /**
     * 患者更换手机号
@ -359,7 +359,19 @@ public class PatientInfoService extends BaseService {
        String doctor = doctorCode;
        String response = jwArchivesService.saveSickArchiveRecord(json.toString(),doctor);
        if("0".equals(response)){
            return -1;
        }
        //保存建档记录
        SocialSecurityInfo info = new SocialSecurityInfo();
        info.setXming0(p.getName());
        info.setXbie00(p.getSex()+"");
        info.setSfzh18(p.getIdcard());
        info.setId0000(p.getIdcard());
        info.setCardno(p.getSsc());
        info.setCard16(p.getSsc());
        socialSecurityInfoDao.save(info);
        return 1;
    }

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

@ -74,7 +74,8 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            precriptionSql += " and p1.status = ? ";
            params.add(status);
        }else {
            precriptionSql += " and p1.status in (?,?,?,?,?)" ;
            precriptionSql += " and p1.status in (?,?,?,?,?,?)" ;
            params.add(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
            params.add(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
            params.add(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            params.add(PrescriptionLog.PrescriptionLogStatus.expressageJGS.getValue());

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

@ -661,8 +661,8 @@ public class PrescriptionInfoService extends BaseService {
    public void setSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size) {
        if (teamCode != null && teamCode > 0) {
            pre_sql.append(" AND pr.admin_team_id =?");
            params.add(teamCode);
        }
        params.add(teamCode);
        if (StringUtils.isNotBlank(state)) {
            pre_sql.append(" AND pr.status IN (" + state + ") ");
@ -805,6 +805,20 @@ public class PrescriptionInfoService extends BaseService {
            PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code);
            if ("1".equals(state)) {
                if(StringUtils.isNotBlank(dept)){
                    String sql = "SELECT t.dept_name AS deptName FROM zy_iv_dept_dict t WHERE t.dept_code = '"+dept+"'" ;
                    List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
                    if(list!=null&&list.size()>0){
                        String name = (String)list.get(0).get("deptName");
                        p.setDeptName(name);
                        p.setDept(dept);
                    }else{
                        throw new RuntimeException("科室不能为空");
                    }
                }else{
                    throw new RuntimeException("科室不能为空");
                }
                //审核通过,前往智业开方
                p.setStatus(PrescriptionLog.PrescriptionLogStatus.adding.getValue());
                p.setReviewedTime(new Date());

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

@ -19,6 +19,7 @@ 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.apache.commons.collections.map.HashedMap;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -936,6 +937,59 @@ public class StatisticsAllService extends BaseService {
        return resultList;
    }
    /**
     * 获取过去某个日期某个区域一级指标的下级统计(单条记录)
     *
     * @param date
     * @param area
     * @param level
     * @param index
     * @return
     */
    public Map<String, Object> getTodayBeforeLowLevelTotalSingle(String date, String area, int level, String index) throws Exception {
        Map<String, Object> map = new HashedMap();
        List<Map<String, Object>> resultList = new ArrayList<>();
        String areaField = "";
        String lowLevelField = "";
        String lowLevelName = "";
        if (level == 4) {
            // 市级别
            areaField = "city";
            lowLevelField = "city";
            lowLevelName = "city_name";
        } else if (level == 3) {
            // 区、城镇级别
            areaField = "town";
            lowLevelField = "town";
            lowLevelName = "town_name";
        } else if (level == 2) {
            // 机构级别
            areaField = "org_code";
            lowLevelField = "org_code";
            lowLevelName = "org_name";
        } else if (level == 1) {
            throw new Exception("param level error");
        }
        // 查询语句
        String sql = " select " +
                "     ifnull(" + lowLevelField + ",'') code " +
                "     ,ifnull(" + lowLevelName + ",'') 'name' " +
                "     ,ifnull(result,'0') amount" +
                " from  " +
                "     wlyy_quota_result " +
                " where " +
                "     quato_code = '" + index + "' " +
                "   and level1_type = ? and del = '1'" +
                "   and quota_date = ? " +
                "   and " + areaField + " = ? ";
        resultList = jdbcTemplate.queryForList(sql,level, date, area);
        return resultList.get(0);
    }
    /**
     * 获取今天及以后某个区域一级指标的下级统计
@ -1027,6 +1081,38 @@ public class StatisticsAllService extends BaseService {
        return resultList;
    }
    /**
     * 获取今天某个区域一级指标的下级统计(单条记录)
     *
     * @param area
     * @param level
     * @param index
     * @return
     */
    public Map<String, Object> getTodayLowLevelTotalSingle(String area, int level, String index) throws Exception {
        Map<String, Object> data = new HashMap<>();
        String redisData = "";
        try {
            redisData = redisTemplate.opsForValue().get("quota:" + index + ":" + level + ":" + area  + ":" + getQuotaTimeStamp());
        } catch (Exception e) {
            redisData = "";
        }
        if (!StringUtils.isEmpty(redisData)) {
                JSONObject json = new JSONObject(redisData);
                data.put("code", String.valueOf(json.get("code")));
                data.put("name", String.valueOf(json.get("name")));
                data.put("amount", Long.valueOf(String.valueOf(json.get("num"))));
        } else {
            Calendar today = Calendar.getInstance();
            today.add(Calendar.DATE, -1);
            String preDate = new SimpleDateFormat("yyyy-MM-dd").format(today.getTime());
            data = getTodayBeforeLowLevelTotalSingle(preDate, area, level, index);
        }
        return data;
    }
    /**
     * 获取今天某个区域一级指标的下级统计
     *
@ -2455,6 +2541,36 @@ public class StatisticsAllService extends BaseService {
        }
    }
    /**
     * 查询某个级别的某个指标到达量(单条记录)
     *
     * @param date
     * @param area
     * @param level
     * @return
     * @throws Exception
     */
    public JSONObject getLowLevelTotalSingle2(String date, String area, int level) throws Exception {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //获取微信关注的未交费
        Map<String, Object> expenseStatus0 = getByIndexSingle(date, area, level, "49",dateFormat);
        //获取微信关注的已交费
        Map<String, Object> expenseStatus1 = getByIndexSingle(date, area, level, "50",dateFormat);
        //获取已缴费的签约数
        Map<String, Object> expenseStatus1Sigjn = getByIndexSingle(date, area, level, "1",dateFormat);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", expenseStatus1Sigjn.get("name"));
        jsonObject.put("code", area);
        Long  weChatAmount0 =  (Long) expenseStatus0.get("amount");
        Long  weChatAmount1 =  (Long) expenseStatus1.get("amount");
        jsonObject.put("weChatAmount0", weChatAmount0);//微信关注未交费数
        jsonObject.put("weChatAmount1", weChatAmount1);//微信关注已交费数
        jsonObject.put("bindRate", getRangeDouuble(weChatAmount0.intValue(), weChatAmount1.intValue(), 2));//微信关注率
        return jsonObject;
    }
    /**
     * 获取某个指标某一天某一level的值   到达量
     *
@ -2484,6 +2600,27 @@ public class StatisticsAllService extends BaseService {
        return returnMap;
    }
    /**
     * 获取某个指标某一天某一level的值 到达量(单条记录)
     *
     * @param date
     * @param area
     * @param level
     * @param index
     * @param dateFormat
     * @return
     * @throws Exception
     */
    private Map<String,Object> getByIndexSingle(String date, String area, int level, String index, SimpleDateFormat dateFormat) throws Exception {
        Map<String,Object> map ;
        if (date.compareTo(dateFormat.format(new Date())) >= 0) {
            map = getTodayLowLevelTotalSingle(area, level, index);
        } else {
            map = getTodayBeforeLowLevelTotalSingle(date, area, level, index);
        }
        return map;
    }
    /**
     * 查询签约人数
     *

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java

@ -148,7 +148,7 @@ public class DoctorGuidanceTempService extends BaseService {
        } else {
            String[] images = imagesUrl.split(",");
            for (String image : images) {
                if (image.contains("http://")) {
                if (image.contains("group1")) {
                    imageUrls += image + ",";
                } else {
                    try {
@ -158,7 +158,6 @@ public class DoctorGuidanceTempService extends BaseService {
                    }
                }
            }
            imagesUrl = imageUrls + imageRow;
            imagesUrl = imagesUrl.substring(0, imagesUrl.length() - 1);
        }

+ 12 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -207,18 +207,18 @@ public class PatientInfoController extends BaseController {
                return error(-1, "请输入正确的身份证号");
            }
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            if (socialSecurityInfo != null) {
                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
                    return error(-1, "身份证号与姓名不一致,请检查后重新输入");
                }
                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0 && ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
                    return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
                }
            } else {
                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
            }
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
//
//            if (socialSecurityInfo != null) {
//                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
//                    return error(-1, "身份证号与姓名不一致,请检查后重新输入");
//                }
//                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0 && ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
//                    return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
//                }
//            } else {
//                return error(-1, "未查询到建档记录");
//            }
            Patient patient = patientDao.findByIdcard(idcard);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/express/SFExpressController.java

@ -186,7 +186,7 @@ public class SFExpressController extends BaseController {
            vo.setExpressName("顺丰速递");
            if(100 == prescription.getStatus()){
                vo.setExpressStatus("已收件");
                vo.setExpressStatus("已签收");
            }else{
                if(StringUtils.isBlank(sfexpress_obj.getMailno())){
                    vo.setExpressStatus("待发货");

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

@ -9,6 +9,7 @@ import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ValueComparator;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -1561,4 +1562,17 @@ public class StatisticsController extends BaseController {
            return error(-1, "查询失败");
         }
    }
    @RequestMapping("/getLevelTotalSingle")
    @ResponseBody
    public String getLevelTotalSingle(@ApiParam(name="date", value="日期标识") @RequestParam(required = true)String date,
                                      @ApiParam(name="area", value="区域code") @RequestParam(required = true)String area,
                                      @ApiParam(name="level", value="级别") @RequestParam(required = true)int level){
        try{
            return write(200, "查询成功", "data", statisticsAllService.getLowLevelTotalSingle2(date,area,level));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
}