Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

yeshijie 4 years ago
parent
commit
35f7608fe2

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -136,4 +136,21 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.updatePatientPw)
    @ApiOperation(value = "修改居民账号密码")
    public Envelop updateDoctorPw(@ApiParam(name = "id", value = "居民ID")
                                  @RequestParam(value = "id", required = true)String id,
                                  @ApiParam(name = "pw", value = "密码")
                                  @RequestParam(value = "pw", required = true)String pw,
                                  @ApiParam(name = "orgPw", value = "原密码")
                                  @RequestParam(value = "orgPw", required = false)String orgPw)throws Exception{
        Boolean isSuccess = patientService.updatePatientPw(id,pw,orgPw);
        if (isSuccess){
            return success(isSuccess);
        }else {
            return failed("修改失败,请检查原密码是否正确");
        }
    }
}

+ 20 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -16,6 +16,8 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
@ -141,6 +143,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
//        patientBrief.setCityName(patientDetail.getCityName());
//        patientBrief.setTownCode(patientDetail.getTownCode());
//        patientBrief.setTownName(patientDetail.getTownName());
        patientBrief.setPhoto(patientDetail.getPhoto());
        patientBrief.setLiveProvinceCode(patientDetail.getLiveProvinceCode());
        patientBrief.setLiveProvinceName(patientDetail.getLiveProvinceName());
        patientBrief.setLiveCityCode(patientDetail.getLiveCityCode());
@ -186,4 +189,21 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        }
        patientLabelDao.save(labelDOList);
    }
    public Boolean updatePatientPw(String id,String pw,String orgPw){
        BasePatientDO patientDO = patientDao.findOne(id);
        String orgPwMd5 = MD5.md5Hex(orgPw + "{" + patientDO.getSalt() + "}");
        if(!orgPwMd5.equals(patientDO.getPassword())){
            return false;
        }
        String salt = randomString(5);
        patientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
        patientDO.setSalt(salt);
        patientDao.save(patientDO);
        /*//设置更新时间
        saveDoctorPwlimitDate(id);*/
        return true;
    }
}

+ 2 - 2
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -378,8 +378,8 @@ public class SpecialistService{
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByNameOrIdCard(String doctor, String filter,String teamCode, Integer page, Integer size){
        String sql ="SELECT " +
                " p.code AS code,r.patient_name as patientName " +
//                " p.`name` AS name, " +
                " p.code AS code,p.code patient,r.patient_name as patientName, " +
                " p.name AS name " +
                " ,p.photo, " +
                " IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age, " +
                " p.sex ," +