فهرست منبع

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

lyr 8 سال پیش
والد
کامیت
9d4a914c95
1فایلهای تغییر یافته به همراه34 افزوده شده و 28 حذف شده
  1. 34 28
      src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

+ 34 - 28
src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -97,8 +97,8 @@ public class FamilyContractService extends BaseService {
    @Autowired
    private DoctorAdminTeamDao doctorAdminTeamDao;
    public SignFamily findSignFamilyByCode(String code){
       return signFamilyDao.findByCodeAndType(code,2);
    public SignFamily findSignFamilyByCode(String code) {
        return signFamilyDao.findByCodeAndType(code, 2);
    }
    public SignFamily findByPatientByType(String patient, int type) {
@ -1652,24 +1652,24 @@ public class FamilyContractService extends BaseService {
    public String produceSignTeamCode() {
        StringBuffer sf=new StringBuffer();
        StringBuffer sf1=new StringBuffer();
        Long size=0L;
        StringBuffer sf = new StringBuffer();
        StringBuffer sf1 = new StringBuffer();
        Long size = 0L;
        //找出家庭签约中团队code是空的
        List<SignFamily> signFamilys= signFamilyDao.findBySignTypeAndTeamCode();
        sf.append("家庭签约中团队code是空的数据数:"+signFamilys.size());
        for(SignFamily signFamily:signFamilys){
        List<SignFamily> signFamilys = signFamilyDao.findBySignTypeAndTeamCode();
        sf.append("家庭签约中团队code是空的数据数:" + signFamilys.size());
        for (SignFamily signFamily : signFamilys) {
            //得到签约中的全科医生的团队
            String doctorCode=signFamily.getDoctor();
            Long id= doctorAdminTeamDao.findIdByLeaderCode(doctorCode);
            if(id!=null&&id>0){
            String doctorCode = signFamily.getDoctor();
            Long id = doctorAdminTeamDao.findIdByLeaderCode(doctorCode);
            if (id != null && id > 0) {
                size++;
                signFamily.setAdminTeamId(id);
            }else{
                sf1.append(",找不到医生所属的团队,医生code:"+doctorCode);
            } else {
                sf1.append(",找不到医生所属的团队,医生code:" + doctorCode);
            }
        }
        sf.append(",填充团队的签约数据数:"+size);
        sf.append(",填充团队的签约数据数:" + size);
        sf.append(sf1);
        return sf.toString();
    }
@ -1677,24 +1677,28 @@ public class FamilyContractService extends BaseService {
    /**
     * 分配健管师
     *
     * @param patient 患者code
     * @param patient      患者code
     * @param healthDoctor 健康管理师code
     * @return
     */
    public JSONObject updateSignInfo(String patient,String healthDoctor,String expensesType){
    public JSONObject updateSignInfo(String patient, String healthDoctor, String expensesType) {
        JSONObject result = new JSONObject();
        Doctor doctor = doctorDao.findByCode(healthDoctor);
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
        if(signFamily == null){
            result.put("status",-1);
            result.put("msg","居民不存在家庭签约");
        if (signFamily == null) {
            result.put("status", -1);
            result.put("msg", "居民不存在家庭签约");
            return result;
        }
        if(doctor == null){
            result.put("status",-2);
            result.put("msg","医生不存在");
        if (doctor == null) {
            result.put("status", -2);
            result.put("msg", "医生不存在");
            return result;
        }
        if(StringUtils.isNotEmpty(healthDoctor)) {
        // 健管师更新
        if (StringUtils.isNotEmpty(healthDoctor)) {
            if (StringUtils.isNotEmpty(signFamily.getDoctorHealth())) {
                // 取消原有健康管理师的家庭签约分组,并新增分组
                List<DoctorPatientGroupInfo> groups = doctorPatientGroupInfoDao.findGroupInfoByPatientAndDoctor(signFamily.getDoctorHealth(), patient);
@ -1792,17 +1796,19 @@ public class FamilyContractService extends BaseService {
            signFamily.setCzrq(new Date());
        }
        if(StringUtils.isNotEmpty(expensesType)){
        // 补贴类型更新
        if (StringUtils.isNotEmpty(expensesType)) {
            if (StringUtils.isNotEmpty(signFamily.getMedicalInsuranceNum())) {
                result.put("status", -3);
                result.put("msg","数据已上传社保,不能修改补贴类型");
            }else{
                result.put("msg", "数据已上传社保,不能修改补贴类型");
                return result;
            } else {
                signFamily.setExpensesType(expensesType);
            }
        }
        result.put("status",1);
        result.put("msg","更新成功");
        result.put("status", 1);
        result.put("msg", "更新成功");
        return result;
    }