浏览代码

续签流程

trick9191 8 年之前
父节点
当前提交
9539a953e1

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/RenewToSignJob.java

@ -24,7 +24,7 @@ public class RenewToSignJob implements Job {
            Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR)-1;
            int month = cal.get(Calendar.MONTH)+1;
            if(month <=7){
            if(month >=7){
                //设置已过期
                String sql = "UPDATE wlyy_sign_family t SET t.status = -4 WHERE t.status>=0 AND t.sign_year='"+year+"' AND t.expenses_status='1'";
                //数据迁移

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -209,9 +209,9 @@ public class SignPatientLabelInfoService extends BaseService {
        String timeKey = DateUtil.dateToStr(new Date(),"yyyyMMdd");
        String flag = redisTemplate.opsForValue().get("renew:"+timeKey+":"+patient);
        if(StringUtils.isNotBlank(flag)){
            json.put("isRemainRenew","1");
            json.put("isRemindRenew","1");
        }else{
            json.put("isRemainRenew","0");
            json.put("isRemindRenew","0");
        }
        String sql = "SELECT t.czrq FROM wlyy_sign_family_renew t WHERE t.status>=0 AND t.is_valid =0";
        List<Map<String,Object>> renews =  jdbcTemplate.queryForList(sql);

+ 8 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -963,8 +963,8 @@ public class SignWebService extends BaseService {
     * @return
     */
    public JSONObject getRenewYearCount(Long teamCode){
        StringBuffer sql = new StringBuffer("SELECT t.sign_year labelCode,COUNT(1) amount " +
                "FROM  wlyy_sign_family t WHERE t.admin_team_code ='"+teamCode+"' AND t.end <=NOW() AND t.status=-4 AND sign_year IS NOT NULL GROUP BY t.sign_year DESC");
        StringBuffer sql = new StringBuffer("SELECT t.sign_year labelCode,t.sign_year labelName,COUNT(1) amount " +
                "FROM  wlyy_sign_family t WHERE t.admin_team_code ="+teamCode+"  AND t.status=-4 AND sign_year IS NOT NULL GROUP BY t.sign_year DESC");
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql.toString());
        JSONObject json = new JSONObject();
        json.put("result",rs);
@ -975,12 +975,13 @@ public class SignWebService extends BaseService {
     * 获取用户信息
     * @return
     */
    public JSONObject getOverDuePatients(String year,String doctorCode,Integer page,Integer pageSize){
    public JSONObject getOverDuePatients(String year,Long teamCode,Integer page,Integer pageSize){
        StringBuffer sql = new StringBuffer("SELECT IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age," +
                "p.code,p.idcard,p.name,p.mobile,p.openid,p.phone,p.photo," +
                "p.ssc,t.sign_type,p.sex,t.emer_mobile,t.expenses_time,t.expenses_status " +
                "FROM wlyy_sign_family t ,wlyy_patient p " +
                "WHERE t.patient = p.code AND t.doctor ='"+doctorCode+"' AND t.sign_year ='"+year+"' LIMIT "+page*pageSize+","+pageSize+";");
                "t.patient code,t.idcard,t.name,t.mobile,t.openid," +
                "t.ssc,t.sign_type signType,p.sex " +
                " FROM wlyy_sign_family t " +
                " LEFT JOIN wlyy_patient p ON t.patient = p.code " +
                " WHERE t.admin_team_code ="+teamCode+" AND t.sign_year ='"+year+"' AND t.status =-4 LIMIT "+page*pageSize+","+pageSize);
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql.toString());
        JSONObject json = new JSONObject();
        json.put("result",rs);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -427,7 +427,7 @@ public class PatientService extends TokenService {
            }
            List<SignFamily> signFamilys2 = jdbcTemplate.queryForList(oldSignSql, SignFamily.class);
            if (signFamilys1 != null && signFamilys1.size() > 0) {
                rs.put("mes", ",可以续签(已到期)");
                rs.put("mes", "可以续签(已到期)");
                rs.put("code", "2");
                return rs;
            } else {
@ -439,7 +439,7 @@ public class PatientService extends TokenService {
    }
    public JSONObject checkRenewData(String sqlRenew,JSONObject rs){
        List<SignFamilyRenew> renews = jdbcTemplate.queryForList(sqlRenew, SignFamilyRenew.class);
        List<Map<String,Object>> renews = jdbcTemplate.queryForList(sqlRenew);
        //如果续签表没有数据,则可以续签,有数据提示已经续签
        if (renews != null && renews.size() > 0) {
            rs.put("mes", "已经提交续签");

+ 6 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -137,7 +137,11 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patients_by_label")
    public String getPatientInfoByLabel(String labelCode, String labelType, Long teamCode, int page, int pagesize) {
    public String getPatientInfoByLabel(@RequestParam(required = false) String labelCode,
                                        @RequestParam(required = false) String labelType,
                                        @RequestParam(required = false)Long teamCode,
                                        @RequestParam(required = false)int page,
                                        @RequestParam(required = false)int pagesize) {
        try {
            if (StringUtils.isEmpty(labelCode)) {
                return error(-1, "标签cdoe不能为空");
@ -151,7 +155,7 @@ public class SignPatientLabelInfoController extends BaseController {
            page = page - 1;
            if(labelType.equals("9")){
                JSONObject jsonObject = signWebService.getOverDuePatients(labelCode,getUID(),page,pagesize);
                JSONObject jsonObject = signWebService.getOverDuePatients(labelCode,teamCode,page,pagesize);
                return write(200, "查询成功", "data", jsonObject);
            }

+ 23 - 23
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -458,27 +458,27 @@ public class DoctorSignController extends WeixinBaseController {
        }
    }
    /**
     * 获取用户详情列表
     * @param year
     * @param page
     * @param pageSize
     * @return
     */
    @RequestMapping("/getOverDuePatients")
    @ApiOperation(value = "获取用户详情列表")
    public String getOverDuePatients(@RequestParam(required = true)String year,
                                     @RequestParam(required = true)Integer page,
                                     @RequestParam(required = true)Integer pageSize){
        try{
            JSONObject rs =signWebService.getOverDuePatients(year,getUID(),page,pageSize);
            //JSONObject rs =signWebService.getOverDuePatients(year,"64de930c-5b15-11e6-8344-fa163e8aee56",page,pageSize);
            return write(200, "操作成功!", "data", rs);
        }catch (Exception e){
            return error(-1, "请求失败");
        }
    }
//    /**
//     * 获取用户详情列表
//     * @param year
//     * @param page
//     * @param pageSize
//     * @return
//     */
//    @RequestMapping("/getOverDuePatients")
//    @ApiOperation(value = "获取用户详情列表")
//    public String getOverDuePatients(@RequestParam(required = true)String year,
//                                     @RequestParam(required = true)Integer page,
//                                     @RequestParam(required = true)Integer pageSize){
//        try{
//            JSONObject rs =signWebService.getOverDuePatients(year,getUID(),page,pageSize);
//            //JSONObject rs =signWebService.getOverDuePatients(year,"64de930c-5b15-11e6-8344-fa163e8aee56",page,pageSize);
//
//            return write(200, "操作成功!", "data", rs);
//        }catch (Exception e){
//            return error(-1, "请求失败");
//        }
//    }
    /**
     *
@ -515,9 +515,9 @@ public class DoctorSignController extends WeixinBaseController {
        }
    }
    @RequestMapping("/remainPatientRenew")
    @RequestMapping("/remindPatientRenew")
    @ApiOperation(value = "提醒居民续签")
    public String remainPatientRenew(@RequestParam(required = true)String patient){
    public String remindPatientRenew(@RequestParam(required = true)String patient){
        try{
            int rs =signWebService.remainPatientRenew(getAccessToken(),patient,getUID());
            if(rs==-1){