瀏覽代碼

随访BUG修复

8 年之前
父節點
當前提交
71aba9cfca

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

@ -30,11 +30,11 @@ public class SignEndJob implements Job {
            String start = date + " 00:00:00";
            String end = date + " 23:59:59";
            String sql = "update wlyy_sign_family set status = -4,apply_unsign_date =SYSDATE() where end >= ? and end <= ? and status > 0";
            int sucess = jdbcTemplate.update(sql, start, end);
            String sqlT = "update wlyy_doctor_team set del = '0' where del = '1' and code in (select team_code from wlyy_sign_family where end >= ? and end <= ? and status > 0)";
            String sqlTm = "update wlyy_doctor_team_member set del = '0' where del = '1' and team in (select team_code from wlyy_sign_family where end >= ? and end <= ? and status > 0)";
            int sucessT = jdbcTemplate.update(sqlT, start, end);
            int sucessTm = jdbcTemplate.update(sqlTm, start, end);
            int sucess = jdbcTemplate.update(sql, start, end);
            System.out.println("sign end job end");
        } catch (Exception e) {
            e.printStackTrace();

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

@ -106,13 +106,13 @@ public class PatientInfoService extends BaseService {
        //if (pMobile != null && !pMobile.getCode().equals(patient)) {
        //    return -2;
        //}
        //需要添加成员关系
        if(relation==2){
            List<Patient> patients = patientDao.findByMobile(mobile);
            for(Patient pTemp :patients){
                familyMemberService.addMember(p,pTemp.getCode(),7);
            }
        }
        ////需要添加成员关系
        //if(relation==2){
        //    List<Patient> patients = patientDao.findByMobile(mobile);
        //    for(Patient pTemp :patients){
        //        familyMemberService.addMember(p,pTemp.getCode(),7);
        //    }
        //}
        p.setMobile(mobile);
        signFamilyDao.updatePatientMobile(p.getCode(), mobile);

+ 4 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -16,6 +16,7 @@ import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
@ -411,16 +412,16 @@ public class PatientDeviceService extends BaseService {
		return re;
	}
	public List<JSONObject> getDeviceByDeviceSn(String deviceSn,String type){
	public JSONArray getDeviceByDeviceSn(String deviceSn,String type){
		List<PatientDevice> list =patientDeviceDao.findByDeviceSnAndCategoryCodeAndDel(deviceSn,type,0);
		List<JSONObject> objects = new ArrayList<>();
		JSONArray objects = new JSONArray();
		for(PatientDevice patientDevice:list){
			JSONObject object = new JSONObject(patientDevice);
			Patient patient = patientDao.findByCode(patientDevice.getUser());
			if(patient!=null){
				object.put("userName",patient.getName());
			}
			objects.add(object);
			objects.put(object);
		}
		return objects;
	}

+ 16 - 23
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -194,8 +194,7 @@ public class WechatController extends WeixinBaseController {
                    return error(-2, "该身份证已被注册");
                }
            }
            List<Patient> patients = patientService.findByMobile(mobile);
            return write(200, "验证成功","data",patients);
            return write(200, "验证成功");
        } catch (Exception e) {
            return error(-1, "验证失败");
        }
@ -347,7 +346,6 @@ public class WechatController extends WeixinBaseController {
            @RequestParam(required = false) String mobile,
            @RequestParam(required = false) String captcha,
            @RequestParam(required = false) String password,
            @RequestParam(required = false) String patient,
            String openid) {
        System.out.println("login openid : " + openid);
        String errorMessage;
@ -358,19 +356,15 @@ public class WechatController extends WeixinBaseController {
        loginLog.setUserType("1");
        try {
            //账号登录 mobile可能是电话号也可能是身份证
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password) && !org.springframework.util.StringUtils.isEmpty(mobile)) {
                List<Patient> patients = patientService.findByMobile(mobile);
                Patient p =null;
                if (patients == null||patients.size()==0) {
                    p = patientService.findByIdcard(mobile);
                }else if(patients.size()==1){
                    p = patients.get(0);//只存在一个用户
                }else if(patients.size()>1&&StringUtils.isBlank(patient)){
                    //多个用户返回用户让患者选择
                    return write(1, "存在多个用户", "data", patients);
                }else if(patients.size()>1&&StringUtils.isNotBlank(patient)){
                    //传入登入者,一般只有多用户才有此操作
                    p = patientService.findByCode(patient);
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password)) {
                Patient p = patientService.findByIdcard(mobile);
                if(p==null){
                    List<Patient> patients = patientService.findByMobile(mobile);
                    if(patients.size()>1){
                        return error(-1,"此手机号码存在多个用户,请用身份证进行登录!");
                    }else if(patients.size()==1){
                        p = patients.get(0);
                    }
                }
                loginLog.setLoginType("2");
                if (p == null) {
@ -441,6 +435,10 @@ public class WechatController extends WeixinBaseController {
            }
            //短信登录
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(captcha)) {
                List<Patient> patients = patientService.findByMobile(mobile);
                if(patients.size()>1){
                    return error(-1,"此手机存在多个用户,请用身份证和密码登录!");
                }
                // 对验证码进行校验
                int res = smsService.check(mobile, 4, captcha);
                switch (res) {
@ -463,7 +461,7 @@ public class WechatController extends WeixinBaseController {
                        return error(-1, errorMessage);
                    }
                }
                List<Patient> patients = patientService.findByMobile(mobile);
                loginLog.setLoginType("1");
                if (patients == null||patients.size()==0) {
                    if (mobile.length() == 11) {
@ -474,16 +472,11 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                }else if(patients.size()>1&&StringUtils.isBlank(patient)) {
                    return write(1, "存在多个用户", "data", patients);
                }else{
                    Patient p = null;
                    if(patients.size()==1){
                        p  = patients.get(0);
                    }else if(StringUtils.isNotBlank(patient)){
                        p = patientService.findByCode(patient);
                    }
                    if (p.getStatus() == 0) {
                    }if (p.getStatus() == 0) {
                        if (mobile.length() == 11) {
                            errorMessage = "该手机号已被禁止使用!";
                        } else {

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -11,6 +11,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -211,7 +212,7 @@ public class DoctorDeviceController extends BaseController {
									@RequestParam(value="type",required = true) String type,
									@ApiParam(name="deviceSn",value="设备SN码",defaultValue = "15L000002")
									@RequestParam(value="deviceSn",required = true) String deviceSn){
			List<JSONObject> objects = patientDeviceService.getDeviceByDeviceSn(deviceSn,type);
			JSONArray objects = patientDeviceService.getDeviceByDeviceSn(deviceSn,type);
			return write(200, "获取设备成功!", "data",objects);
	}
}

+ 1 - 8
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -272,8 +272,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            String signDoctorCode,//簽約人code
            String signDoctorName,//簽約人銘
            String signDoctorLevel,//簽約人等级
            long adminTeamCode, //行政团队
            int relation//存在多个用户的时候是否成为家庭成员
            long adminTeamCode //行政团队
    ) {
        try {
            if (StringUtils.isEmpty(idcard)) {
@ -340,12 +339,6 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                try {
                    Patient p = patientService.findByIdcard(idcard);
                    BusinessLogs.info(BusinessLogs.BusinessType.register, getUID(), p.getCode(), new JSONObject(p));
                    if(relation==1){
                        List<Patient> patients = patientService.findByMobile(mobile);
                        for(Patient patient1 :patients){
                            familyMemberService.addMember(p,patient1.getCode(),7);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }

+ 3 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/account/PatientController.java

@ -736,15 +736,9 @@ public class PatientController extends WeixinBaseController {
            if (type != 1 && type != 2) {
                return error(-1, "操作类型参数错误");
            }
            if(relation==0){
                int smsCheck = smsService.check(mobile, type == 1 ? 8 : 9, captcha);
                if (smsCheck != 1) {
                    return error(-1, "验证码错误");
                }
                List<Patient> patients = patientService.findByMobile(mobile);
                if(patients!=null&&patients.size()>0){
                    return write(1, "新手机存在多个用户","data",patients);
                }
            int smsCheck = smsService.check(mobile, type == 1 ? 8 : 9, captcha);
            if (smsCheck != 1) {
                return error(-1, "验证码错误");
            }
            int result = patientInfoService.changeMobile(getUID(), mobile, captcha, type,relation);
            if (result == -1) {