浏览代码

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

trick9191 8 年之前
父节点
当前提交
8ce9d673af

+ 69 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/address/Country.java

@ -0,0 +1,69 @@
package com.yihu.wlyy.entity.address;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2017/7/20.
 */
@Entity
@Table(name = "dm_country")
public class Country extends IdEntity {
    private String  id;
    private String  province;
    private String  city;
    private String  town;
    private String  street ;
    private String  code;
    private String  name;
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getTown() {
        return town;
    }
    public void setTown(String town) {
        this.town = town;
    }
    public String getStreet() {
        return street;
    }
    public void setStreet(String street) {
        this.street = street;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -598,7 +598,7 @@ public class FamilyContractService extends BaseService {
        sf.setExpensesStatus("0");   //扣费状态 【0未扣费 1已扣费 2已退费】
        sf.setBegin(DateUtil.stringToDate(DateUtil.getSignYear()+"-07-01 00:00:00","yyyy-MM-dd HH:mmm:ss"));
        sf.setEnd(DateUtil.stringToDate(DateUtil.getSignYear()+1+"-06-30 23:59:59","yyyy-MM-dd HH:mmm:ss"));
        sf.setSignYear(DateUtil.getSignYear()+"");
        SignFamily temp = signFamilyDao.save(sf);
        if (temp != null) {
@ -1030,7 +1030,7 @@ public class FamilyContractService extends BaseService {
        }else{
            sf.setRenewFlag("0");
        }
        sf.setSignYear(DateUtil.getSignYear()+"");
        signFamilyDao.save(sf);
        //添加团队成员
        //添加健康管理师

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

@ -130,7 +130,7 @@ public class SignWebService extends BaseService {
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,patient_apply_date,expenses_time,reason,begin from wlyy_sign_family where doctor = ?  and status = ? and type = 2" +
                (status == 3 ? " and expenses_status = '1'" : "") + " order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize;
                " where a.patient = b.code  order by applyDate desc limit " + page * pageSize + "," + pageSize;
        // 未缴费查询语句
        String sqlExpenses = "select " +
@ -153,9 +153,9 @@ public class SignWebService extends BaseService {
                "    ,b.openid" +
                "    ,a.renew_flag as renewFlag" +
                " from " +
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where doctor = ?  and status > ? and type = 2 order by begin desc ) a " +
                " ( select patient_apply_date,renew_flag,code,patient,doctor,status,id,apply_date,reason,begin,expenses_status,LENGTH(trim(ifnull(expenses_status,''))) len from wlyy_sign_family where doctor = ?  and status > ? and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) order by a.begin desc limit " + page * pageSize + "," + pageSize;
                " where a.patient = b.code and (a.expenses_status = '0' or a.len < 1) order by applyDate desc limit " + page * pageSize + "," + pageSize;
        // 已解约查询语句
        String surrSql = "select " +
@ -178,9 +178,9 @@ public class SignWebService extends BaseService {
                "    ,b.openid" +
                "    ,a.renew_flag as renewFlag" +
                " from " +
                " ( select renew_flag,code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where doctor = ?  and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ( select patient_apply_date,renew_flag,code,patient,doctor,status,id,apply_date,apply_unsign_date,reason,begin from wlyy_sign_family where doctor = ?  and ( status = ? or status = ? ) and type = 2 order by begin desc ) a " +
                " ,wlyy_patient b " +
                " where a.patient = b.code  order by a.begin desc limit " + page * pageSize + "," + pageSize;
                " where a.patient = b.code  order by applyDate desc limit " + page * pageSize + "," + pageSize;
        // 分页信息
        //PageRequest pageRequest = new PageRequest(page - 1, pageSize);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -1709,7 +1709,7 @@ public class StatisticsService extends BaseService {
    public JSONObject getAVGSocre(String level, String area) {
        String sql = "SELECT ifnull(ROUND(AVG(s.score),1),80) avgCount FROM wlyy_evaluate_score s ,wlyy_doctor d WHERE s.doctor = d.code ";
        String sql = "SELECT ifnull(ROUND(AVG(s.score),1),0) avgCount FROM wlyy_evaluate_score s ,wlyy_doctor d WHERE s.doctor = d.code ";
        //市级
        if ("4".equals(level)) {
            sql += " AND d.city = ? ";
@ -1737,7 +1737,7 @@ public class StatisticsService extends BaseService {
            throw new Exception("时间区间错误");
        }
        String sql = "SELECT DATE_FORMAT(t.czrq,'%Y-%m') mt,ifnull(ROUND(AVG(s.score),1),80)  as avgCount " +
        String sql = "SELECT DATE_FORMAT(t.czrq,'%Y-%m') mt,ifnull(ROUND(AVG(s.score),1),0)  as avgCount " +
                " FROM  wlyy_consult_team t " +
                "  LEFT JOIN wlyy_doctor d ON d.code = t.doctor" +
                "  LEFT JOIN wlyy_evaluate_score s ON s.doctor = t.doctor" +

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

@ -1,7 +1,11 @@
package com.yihu.wlyy.web.doctor.sign;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.address.StreetDao;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.sign.SignWebService;
@ -47,6 +51,14 @@ public class DoctorSignController extends WeixinBaseController {
    StringRedisTemplate redisTemplate;
    @Autowired
    private PatientService patientService;
    @Autowired
    private TownDao townDao;
    @Autowired
    private StreetDao streetDao;
    /**
     * 厦门市
     */
    public static String city ="350200";
    /**
     * 三师签约列表查询
     *
@ -689,4 +701,14 @@ public class DoctorSignController extends WeixinBaseController {
            return error(-1, "查询失败");
        }
    }
    public JSONArray getTownList(){
        List<Town> towns = townDao.findByCityCode(city);
        return new JSONArray(towns);
    }
    public JSONArray getStreetList(String town){
        Iterable<Street> streets = streetDao.findByTown(town);
        return new JSONArray(streets);
    }
//    public JSONArray get
}