Browse Source

代码修改

yeshijie 8 years ago
parent
commit
864d320894

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -13,19 +13,19 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
    Consult findByCode(String code);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1'and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatient(String patient, String title, long id, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' order by a.czrq desc")
    Page<Object> findByPatient(String patient, Pageable pageRequest);
    // 查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1'order by a.czrq desc")
    Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
    @Query("select count(a) from Consult a,ConsultTeamDoctor b  where a.code = b.consult and a.patient=?1 and b.to=?2 and b.from is null")

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/SignFamilyDao.java

@ -305,6 +305,9 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
    SignFamily findByPatient(String patient);
    @Query("select a from SignFamily a where a.teamCode = ?1 and a.type =2 and a.status >= 0")
    SignFamily findByTeam(String teamCode);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
    List<SignFamily> findByPatients(String patient);
@ -395,4 +398,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
    @Query(value = " select a.*  from wlyy_sign_family a where a.patient = ?1  and a.status = -4 order by a.apply_date desc limit 0,1", nativeQuery = true)
    SignFamily findOutTimeSigningByPatient(String patient);
    @Query(value = " select a.*  from wlyy_sign_family a where a.patient = ?1  and a.status = -4 and a.team_code = ?2 order by a.apply_date desc limit 0,1", nativeQuery = true)
    SignFamily findOutTimeSigningByPatientAndTeamCode(String patient,String teamCode);
}

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -843,6 +843,7 @@ public class DoctorInfoService extends BaseService {
        JSONObject data = new JSONObject();
        if (StringUtils.isNotEmpty(oldDoctorCode)) {
            data.put("toUser", patient);
            data.put("represented",patient);//被代理人
            data.put("doctor", newD.getCode());
            data.put("doctorName", newD.getName());
            data.put("first", p.getName() + ",您好!因签约团队内分工调整,您的责任医生有变动," + oldDoctorHealthName +

+ 12 - 16
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -1,12 +1,14 @@
package com.yihu.wlyy.service.app.consult;
import java.util.Date;
import java.util.List;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.consult.*;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.SendPatientUtil;
import org.springframework.beans.factory.annotation.Autowired;
@ -14,22 +16,13 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.repository.consult.ConsultCommunicationDao;
import com.yihu.wlyy.repository.consult.ConsultCommunicationReplyDao;
import com.yihu.wlyy.repository.consult.ConsultDao;
import com.yihu.wlyy.repository.consult.ConsultMoViDao;
import com.yihu.wlyy.repository.consult.ConsultPublicDao;
import com.yihu.wlyy.repository.consult.ConsultPublicReplyDao;
import com.yihu.wlyy.repository.consult.ConsultTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
@Component
@Transactional
public class ConsultService extends BaseService {
@ -76,7 +69,10 @@ public class ConsultService extends BaseService {
		consult.setSymptoms(symptoms);
		consult.setImages(images);
		consult.setType(type);
		consult.setSignCode(patientService.getSignCodeByPatient(patient));
		SignFamily signFamily = signFamilyDao.findByPatient(patient);
		if(signFamily!=null){
			consult.setSignCode(signFamily.getCode());
		}
		return consultDao.save(consult);
	}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -103,6 +103,9 @@ public class ConsultController extends WeixinBaseController {
                    json.put("evaluate", result[9]);
                    //签约code
                    json.put("signCode", result[10]);
                    array.put(json);
                }
            }

+ 16 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignController.java

@ -4,6 +4,7 @@ import com.yihu.wlyy.entity.patient.SignWeb;
import com.yihu.wlyy.service.app.sign.SignWebService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -261,6 +262,21 @@ public class PatientSignController extends BaseController {
		}
	}
	@RequestMapping(value = "/consult_sign_doctor_info")
	@ResponseBody
	@ApiOperation(value = "获取咨询的服务团队")
	public String consult_sign_doctor(@RequestParam(required = true,value = "team")String teamCode,
									  @RequestParam(required = true)String code,@RequestParam(required = true)String consultCode){
		try{
			JSONObject resultObj =  signWebService.getConsultSignInfoOrRenewInfo(teamCode,code,getRepUID(),consultCode);
			return write(200, "查询成功!", "data", resultObj);
		}catch (Exception e){
			error(e);
			return error(-1, "签约状态查询失败!");
		}
	}
	@RequestMapping("/sign_service_info")
	public String getSignServiceInfo(@RequestParam(required = true,value = "team")String teamCode) {
		try {