Переглянути джерело

Merge branch 'dev' of liuwenbin/wlyy2.0 into dev

huangwenjie 6 роки тому
батько
коміт
80f41cfb61

+ 18 - 18
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamDO.java

@ -18,34 +18,34 @@ import java.util.Date;
public class BaseTeamDO extends UuidIdentityEntityWithOperator {
    /**
	 * 机构id
	 */
	private String orgId;
	* 机构id
	*/
    private String orgId;
    /**
	 * 团队名称
	 */
	private String name;
	* 团队名称
	*/
    private String name;
    /**
	 * 领导医生标识
	 */
	private String leaderId;
	* 领导医生标识
	*/
    private String leaderId;
    /**
	 * 团队人数
	 */
	private String teamNum;
	* 团队人数
	*/
    private String teamNum;
    /**
	 * 团队二维码
	 */
	private String qrcode;
	* 团队二维码
	*/
    private String qrcode;
    /**
	 * 作废标识,1正常,0作废
	 */
	private String del;
	* 作废标识,1正常,0作废
	*/
    private String del;
	@Column(name = "org_id")

+ 13 - 13
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamMemberDO.java

@ -10,7 +10,7 @@ import java.util.Date;
/**
* 团队成员实体
*
* @author Administrator on  2018年09月05日
* @author litaohong on  2018年08月31日
*
*/
@Entity
@ -18,24 +18,24 @@ import java.util.Date;
public class BaseTeamMemberDO extends UuidIdentityEntityWithOperator {
    /**
	 * 团队ID
	 */
	private String teamId;
	* 团队ID
	*/
    private String teamId;
    /**
	 * 机构标识
	 */
	private String orgId;
	* 机构标识
	*/
    private String orgId;
    /**
	 * 医生标识,多个医生以逗号分开
	 */
	private String doctorId;
	* 医生标识,多个医生以逗号分开
	*/
    private String doctorId;
    /**
	 * 作废标识,1正常,0作废
	 */
	private String del;
	* 作废标识,1正常,0作废
	*/
    private String del;
	@Column(name = "team_id")

+ 101 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/team/baseTeamDO.java

@ -0,0 +1,101 @@
package com.yihu.jw.entity.base.team;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 团队信息实体
*
* @author litaohong on  2018年08月31日
*
*/
@Entity
@Table(name = "base_team")
public class BaseTeamDO extends UuidIdentityEntityWithOperator {
    /**
	* 机构id
	*/
    private String orgId;
    /**
	* 团队名称
	*/
    private String name;
    /**
	* 领导医生标识
	*/
    private String leaderId;
    /**
	* 团队人数
	*/
    private String teamNum;
    /**
	* 团队二维码
	*/
    private String qrcode;
    /**
	* 作废标识,1正常,0作废
	*/
    private String del;
	@Column(name = "org_id")
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "leader_id")
    public String getLeaderId() {
        return leaderId;
    }
    public void setLeaderId(String leaderId) {
        this.leaderId = leaderId;
    }
	@Column(name = "team_num")
    public String getTeamNum() {
        return teamNum;
    }
    public void setTeamNum(String teamNum) {
        this.teamNum = teamNum;
    }
	@Column(name = "qrcode")
    public String getQrcode() {
        return qrcode;
    }
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 4 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -106,7 +106,7 @@ public class RehabilitationManageController {
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                         @RequestParam(value = "status", required = false)Integer status,
                                         @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                         @RequestParam(value = "doctorCode", required = true)String doctorCode){
                                         @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            return rehabilitationManageService.calendarPlanDetailList(planId,searchTask,status,doctorCode,executeStartTime,executeEndTime);
        }catch (Exception e){
@ -146,8 +146,8 @@ public class RehabilitationManageController {
    @ApiOperation(value = "康复管理-保存指导留言")
    public Envelop saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)
                                       @RequestParam(value = "messageId", required = true)String messageId,
                                       @ApiParam(name = "patientCode", value = "居民code", required = true)
                                       @RequestParam(value = "patientCode", required = true)String patientCode,
//                                       @ApiParam(name = "patientCode", value = "居民code", required = true)
//                                       @RequestParam(value = "patientCode", required = true)String patientCode,
                                       @ApiParam(name = "doctorCode", value = "医生code", required = true)
                                       @RequestParam(value = "doctorCode", required = true)String doctorCode,
                                       @ApiParam(name = "doctorType", value = "医生类型(1、专科医生,2、家庭医生)", required = true)
@ -157,7 +157,7 @@ public class RehabilitationManageController {
                                       @ApiParam(name = "planDetailId", value = "服务项目id", required = true)
                                       @RequestParam(value = "planDetailId", required = true)String planDetailId){
        try {
            return rehabilitationManageService.saveGuidanceMessage(messageId,patientCode,doctorCode,doctorType,content,planDetailId);
            return rehabilitationManageService.saveGuidanceMessage(messageId,doctorCode,doctorType,content,planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 3 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailDao.java

@ -62,4 +62,7 @@ public interface RehabilitationDetailDao extends PagingAndSortingRepository<Reha
    @Modifying
    @Query("update RehabilitationDetailDO t set t.status = ?1 where t.id=?2 ")
    int updateStatusById(Integer status,String id);
    @Query(value ="select p.patient from wlyy_rehabilitation_plan_detail d left join wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.id=?1",nativeQuery = true)
    List<Map<String,Object>> findPatientById(String planDetailId);
}

+ 25 - 14
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -299,7 +299,7 @@ public class RehabilitationManageService {
        resultMap.put("sex","1".equals(sex)?"男":("2".equals(sex)?"女":"未知"));
        resultMap.put("patientName",signFamilyMap.get("name"));
        //疾病类型
        String diseaseSql = " select s.* from "+basedb+".wlyy_patient_disease_server s where s.del=1 and s.patient='"+patientCode+"' ";
        String diseaseSql = " select s.* from "+basedb+".wlyy_patient_disease_server s where s.del=1 and s.patient='"+patientCode+"' and s.specialist_relation_code='"+specialistMap.get("id")+"' ";
        List<Map<String,Object>> diseaseList = jdbcTemplate.queryForList(diseaseSql);
        List<String> disease = new ArrayList<>();
        for(Map<String,Object> one2:diseaseList){
@ -441,20 +441,23 @@ public class RehabilitationManageService {
                }
            }
            //myTaskFlag,1:有自己任务,0:没有自己任务
            if(m.containsKey("myTaskFlag")){
                if((Integer)m.get("myTaskFlag")==0){
            if(StringUtils.isNotEmpty(doctorCode)){
                if(m.containsKey("myTaskFlag")){
                    if((Integer)m.get("myTaskFlag")==0){
                        if(doctorCode.equals(one.get("doctor").toString())){
                            m.put("myTaskFlag",1);
                        }else{
                            m.put("myTaskFlag",0);
                        }
                    }
                }else{
                    if(doctorCode.equals(one.get("doctor").toString())){
                        m.put("myTaskFlag",1);
                    }else{
                        m.put("myTaskFlag",0);
                    }
                }
            }else{
                if(doctorCode.equals(one.get("doctor").toString())){
                    m.put("myTaskFlag",1);
                }else{
                    m.put("myTaskFlag",0);
                }
            }
            if(m.containsKey("planDetailIds")){
                m.put("planDetailIds",m.get("planDetailIds")+","+one.get("id"));
@ -506,7 +509,7 @@ public class RehabilitationManageService {
            planDetailList +=",'"+one+"'";
        }
        String planDetailResult = StringUtils.isNotEmpty(planDetailList)?planDetailList.substring(1):"";
        String sql = "select i.title,i.content,i.type,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor," +
        String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type as detailType,d.expense,d.doctor as specialistDoctor," +
                " d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
@ -524,6 +527,8 @@ public class RehabilitationManageService {
                executeDoctorList.add(one.get("create_user_name")+"");
            }
            executeDoctorList.add(one.get("specialistDoctorName")+"");
            resultMap.put("specialistDoctorCode",one.get("create_user")+"");//专科医生code
            resultMap.put("specialistDoctorName",one.get("create_user_name")+"");//专科医生名字
            resultMap.put("executeDoctorList",executeDoctorList);
            resultMap.put("title",one.get("title"));//项目标题
            resultMap.put("planDetaiId",one.get("id"));//计划服务项目id
@ -554,7 +559,8 @@ public class RehabilitationManageService {
            }
            resultMap.put("messageList",messageMapList);//指导与汇报记录
            resultMap.put("patient",one.get("patient"));
            resultMap.put("type",one.get("type"));
            resultMap.put("itemType",one.get("itemType"));
            resultMap.put("detaiType",one.get("detaiType"));
            resultMap.put("status",status);//状态
            //是否完成任务
            List<RehabilitationOperateRecordsDO> operateList = rehabilitationOperateRecordsDao.findByRehabilitationDetailId(one.get("id").toString());
@ -575,10 +581,11 @@ public class RehabilitationManageService {
     * @param planDetailId
     * @return
     * @throws Exception
     *
     */
    public ObjEnvelop serviceItem(String planDetailId) throws Exception{
        String sql = "select i.title,i.content,i.type as itemType,i.reserve,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as specialistDoctor, " +
                " d.doctor_name as specialistDoctorName,p.patient ,p.create_user ,p.create_user_name " +
                " d.doctor_name as specialistDoctorName,p.patient ,p.name as patientName,p.create_user ,p.create_user_name " +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_specialist.wlyy_service_item i on i.id = h.service_item_id " +
@ -625,6 +632,7 @@ public class RehabilitationManageService {
        Integer itemType = (Integer) one.get("itemType");
        resultMap.put("messageList",messageMapList);//指导与汇报记录
        resultMap.put("patient",one.get("patient"));
        resultMap.put("patientName",one.get("patientName"));
        resultMap.put("type",itemType);//1扫码、0上传附件、2、健康教育,3、健康指导,4、随访
        //是否完成任务
@ -736,6 +744,7 @@ public class RehabilitationManageService {
                case 2:planTypeName="(转)社区医院" ;break;
                case 3:planTypeName="(转)转家庭病床" ;break;
            }
            map.put("planId",one.getId());
            map.put("planTypeName",planTypeName);
            String statusName = "";
            Integer status = one.getStatus();
@ -892,12 +901,14 @@ public class RehabilitationManageService {
    /**
     * 保存康复管理指导留言信息
     * @param messageId
     * @param patient
     * @param doctor
     * @param doctorType 1、专科医生,2、家庭医生
     */
    @Transactional
    public Envelop saveGuidanceMessage(String messageId,String patient,String doctor,Integer doctorType,String content,String planDetailId) throws Exception{
    public Envelop saveGuidanceMessage(String messageId,String doctor,Integer doctorType,String content,String planDetailId) throws Exception{
        List<Map<String,Object>> patientList = rehabilitationDetailDao.findPatientById(planDetailId);
        String patient = patientList.size()>0?patientList.get(0).get("patient")+"":"";
        GuidanceMessageLogDO guidanceMessageLogDO = new GuidanceMessageLogDO();
        guidanceMessageLogDO.setMessageId(messageId);
        guidanceMessageLogDO.setPlanDetailId(planDetailId);