Explorar el Código

Merge branch 'srdev' of http://192.168.1.220:10080/Amoy/patient-co-management into srdev

trick9191 hace 7 años
padre
commit
1e618e1f5c

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java


+ 48 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/concern/ConcernService.java

@ -4,13 +4,17 @@ import com.yihu.wlyy.entity.concern.ConcernDO;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.concern.ConcernDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.MessageType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
@ -37,6 +41,10 @@ public class ConcernService extends BaseService {
    private DoctorTeamMemberDao doctorTeamDoctorDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private PushMsgTask pushMsgTask;
    /**
     * 新增患者关注医生
@ -94,6 +102,27 @@ public class ConcernService extends BaseService {
        //更新医生关注人数+1
        Integer num=doctor.getConcernNum();
        doctor.setConcernNum(num+1);
        //消息
        String content = "您有一条新的关注消息!";
        Message message = new Message();
        message.setCzrq(new Date());
        message.setCreateTime(new Date());
        message.setRead(1);//设置未读
        message.setOver("1");
        message.setReceiver(doctorCode);
        message.setSender("system");
        message.setCode(getCode());
        message.setSenderName("系统");
        message.setTitle("居民"+patient.getName()+"关注了您");
        message.setContent(content);
        message.setType(14);
        message.setReadonly(1);//是否只读消息
        message.setDel("1");
        message.setRelationCode(patient.getCode());
        messageDao.save(message);
        pushMsgTask.put(doctorCode, MessageType.MESSAGE_TYPE_DOCTOR_ADD_CONCERN.D_CO_01.name(), MessageType.MESSAGE_TYPE_DOCTOR_ADD_CONCERN.关注医生.name(), content, patient.getCode());
        return true;
    }
@ -138,6 +167,25 @@ public class ConcernService extends BaseService {
        //更新医生关注人数-1
        doctor.setConcernNum(doctor.getConcernNum()-1);
        //消息
        String content = "您有一条新的居民取消关注消息!";
        Message message = new Message();
        message.setCzrq(new Date());
        message.setCreateTime(new Date());
        message.setRead(1);//设置未读
        message.setOver("1");
        message.setReceiver(doctorCode);
        message.setSender("system");
        message.setCode(getCode());
        message.setSenderName("系统");
        message.setTitle("居民"+concern.getName()+"取消关注您");
        message.setContent(content);
        message.setType(15);
        message.setReadonly(1);//是否只读消息
        message.setDel("1");
        message.setRelationCode(concern.getPatient());
        messageDao.save(message);
        pushMsgTask.put(doctorCode, MessageType.MESSAGE_TYPE_DOCTOR_SUB_CONCERN.D_CO_02.name(), MessageType.MESSAGE_TYPE_DOCTOR_SUB_CONCERN.取消关注.name(), content, concern.getPatient());
    }
    /**

+ 25 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/DoctorService.java

@ -98,6 +98,31 @@ public class DoctorService extends TokenService {
        }
    }
    /**
     * 分页查找已关注医生列表
     * @param hospitalCode
     * @param patient
     * @param page
     * @param pagesize
     * @return
     */
    public List<Doctor> findConcernDoctorLists(String hospitalCode,String patient, Integer page, Integer pagesize) {
        String sql = "SELECT d.* from wlyy_doctor d,wlyy_concern c WHERE c.patient = ? and c.`status` = 1 and c.concern_doctor_code = d.`code` and  d.del=1 and d.status=1 ";
        List<Object> args = new ArrayList<>();
        args.add(patient);
        if (!org.springframework.util.StringUtils.isEmpty(hospitalCode)) {
            sql += " and d.hospital = ? ";
            args.add(hospitalCode);
        }
        sql += " limit " + (page * pagesize) + "," + pagesize;
        List<Doctor> doctorList = jdbcTemplate.query(sql, args.toArray(), new BeanPropertyRowMapper(Doctor.class));
        return doctorList;
    }
    /**
     * 分页查找医生列表
     * @param hospitalCode

+ 10 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/MessageType.java

@ -177,4 +177,14 @@ public class MessageType {
		D_P_WRD, 续方消息, 待取药
	}
	// 关注
	public static enum MESSAGE_TYPE_DOCTOR_ADD_CONCERN {
		D_CO_01, 关注医生
	};
	// 取消关注
	public static enum MESSAGE_TYPE_DOCTOR_SUB_CONCERN {
		D_CO_02, 取消关注, 居民取消关注
	};
}

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

@ -561,6 +561,71 @@ public class ConsultController extends WeixinBaseController {
        }
    }
    /**
     * 已关注的医生列表
     *
     * @return
     */
    @RequestMapping(value = "concernDoctorList")
    @ResponseBody
    @ApiOperation("已关注的医生列表")
    public String concernDoctorList(
            @ApiParam(name = "hospitalCode", value = "医院code", defaultValue = "350200")
            @RequestParam(value = "hospitalCode", required = false) String hospitalCode,
            @ApiParam(name = "page", value = "第几页", defaultValue = "")
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "pagesize", value = "每页记录数", defaultValue = "")
            @RequestParam(value = "pagesize", required = false) Integer pagesize) {
        try {
            JSONArray array = new JSONArray();
            if(StringUtils.isEmpty(hospitalCode)){
                hospitalCode = defaultHospital;
            }
            page = page == null ? 0 : page - 1;
            pagesize = pagesize == null ? 10 : pagesize;
            List<Doctor> list = doctorService.findConcernDoctorLists(hospitalCode,getRepUID(), page, pagesize);
            if (list != null) {
                for (Doctor doctor : list) {
                    JSONObject json = new JSONObject();
                    json.put("id", doctor.getId());
                    // 医生标识
                    json.put("code", doctor.getCode());
                    // 医生性别
                    json.put("sex", doctor.getSex());
                    // 医生姓名
                    json.put("name", doctor.getName());
                    // 所在医院名称
                    json.put("hospital", doctor.getHospital());
                    // 所在医院名称
                    json.put("hospital_name", doctor.getHospitalName());
                    // 科室名称
                    json.put("dept_name", (doctor.getDeptName() == null ||
                            StringUtils.isEmpty(doctor.getDeptName().toString())) ? " " : doctor.getDeptName());
                    // 职称名称
                    json.put("job_name", (doctor.getJobName() == null ||
                            StringUtils.isEmpty(doctor.getJobName().toString())) ? " " : doctor.getJobName());
                    // 头像
                    json.put("photo", doctor.getPhoto());
                    // 简介
                    json.put("introduce", doctor.getIntroduce());
                    // 专长
                    json.put("expertise", doctor.getExpertise());
                    //关注数
                    json.put("concernNum", doctor.getConcernNum());
                    //咨询数
                    json.put("consultNum", doctor.getConsultNum());
                    //文章数
                    json.put("articleNum", doctor.getArticleNum());
                    array.put(json);
                }
            }
            return write(200, "获取医院医生列表成功!", "list", array);
        } catch (Exception e) {
            error(e);
            return error(-1, "获取医院医生列表失败!");
        }
    }
    /**
     * 医生列表
     *
@ -582,6 +647,11 @@ public class ConsultController extends WeixinBaseController {
            @RequestParam(value = "pagesize", required = false) Integer pagesize) {
        try {
            JSONArray array = new JSONArray();
            if(StringUtils.isEmpty(hospitalCode)){
                hospitalCode = defaultHospital;
            }
            page = page == null ? 0 : page - 1;
            pagesize = pagesize == null ? 10 : pagesize;
            List<Doctor> list = doctorService.findDoctorLists(hospitalCode,name,dept, page, pagesize);
            if (list != null) {
                for (Doctor doctor : list) {
@ -609,6 +679,12 @@ public class ConsultController extends WeixinBaseController {
                    json.put("introduce", doctor.getIntroduce());
                    // 专长
                    json.put("expertise", doctor.getExpertise());
                    //关注数
                    json.put("concernNum", doctor.getConcernNum());
                    //咨询数
                    json.put("consultNum", doctor.getConsultNum());
                    //文章数
                    json.put("articleNum", doctor.getArticleNum());
                    array.put(json);
                }
            }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -28,7 +28,7 @@ doctorAssistant:
  target_url: home/html/unreadMessageStatistic.html
wlyy:
  hospital: 3502030400 # 默认医院code
  hospital: 3502050100 # 默认医院code
im:
  im_list_get: http://172.19.103.88:3000/

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -34,7 +34,7 @@ im:
  data_base_name: im_new
wlyy:
  hospital: 3502030400 # 默认医院code
  hospital: 3502050100 # 默认医院code
#物联网配置
iot:

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -25,7 +25,7 @@ doctorAssistant:
  target_url: home/html/unreadMessageStatistic.html
wlyy:
  hospital: 3502030400 # 默认医院code
  hospital: 3502050100 # 默认医院code
im:
  im_list_get: http://172.19.103.88:3000/