hzp 8 rokov pred
rodič
commit
3b0c353223

+ 10 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/followup/Followup.java

@ -51,7 +51,8 @@ public class Followup extends IdEntity {
	private String followupContentPhone;
	//创建时间
	private Date createTime;
	//创建者
	private String creater;
	public String getFollowupNo() {
		return followupNo;
@ -191,4 +192,12 @@ public class Followup extends IdEntity {
	public void setFollowupContentPhone(String followupContentPhone) {
		this.followupContentPhone = followupContentPhone;
	}
	public String getCreater() {
		return creater;
	}
	public void setCreater(String creater) {
		this.creater = creater;
	}
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/followup/FollowUpDao.java

@ -20,4 +20,7 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
    @Query("select a from Followup a where a.doctorCode = ?1 and a.followupDate between ?2 and ?3 and a.status <> '0'")
    List<Followup> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest) throws Exception;
    @Query("select a from Followup a where a.creater = ?1 and a.followupDate between ?2 and ?3 and a.status <> '0'")
    List<Followup> findByCreater(String creater, Date begin, Date end, Pageable pageRequest) throws Exception;
}

+ 56 - 26
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.app.followup;
import javax.transaction.Transactional;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -66,38 +67,66 @@ public class FollowUpService extends BaseService {
	}
	/**
	 *新增随访计划(简单)
	 * 获取医生随访列表(创建者)
	 */
	public void addFollowupPlan(String doctorCode,String patientCode,String date) throws Exception {
	public List<Followup> getListByCreater(String doctorCode,String startTime,String endTime,String page,String pageSize) throws Exception
	{
		// 排序
		Sort sort = new Sort(Sort.Direction.ASC, "followupDate");
		// 分页信息
		int pageInt = Integer.valueOf(page)-1;
		int pageSizeInt =  Integer.valueOf(pageSize);
		Pageable pageRequest = new PageRequest(pageInt, pageSizeInt, sort);
		return followupDao.findByCreater(doctorCode,DateUtil.strToDate(startTime),DateUtil.strToDate(endTime),pageRequest);
	}
		//获取医生信息
		Doctor doctor = doctorDao.findByCode(doctorCode);
		if(doctor==null)
	/**
	 *新增随访计划(批量)
	 */
	@Transactional
	public void addFollowupPlan(String doctorCode,String patientCode,String data) throws Exception {
		//批量随访计划
		JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, Map.class);
		List<Map<String,String>> list = objectMapper.readValue(data,javaType);
		if(list!=null && list.size()>0)
		{
			throw new Exception("not exit doctor:"+doctorCode+".\r\n");
		}
			//获取患者信息
			Patient patient = patientDao.findByCode(patientCode);
			if(patient==null)
			{
				throw new Exception("not exit patient:"+patientCode+".\r\n");
			}
		//获取患者信息
		Patient patient = patientDao.findByCode(patientCode);
		if(patient==null)
		{
			throw new Exception("not exit patient:"+patientCode+".\r\n");
		}
			List<Followup> followupPlan = new ArrayList<>();
			for(Map<String,String> map : list)
			{
				//获取医生信息
				Doctor doctor = doctorDao.findByCode(map.get("doctor"));
				if(doctor==null)
				{
					throw new Exception("not exit doctor:"+doctorCode+".\r\n");
				}
		Followup followup = new Followup();
		followup.setFollowupDate(DateUtil.strToDate(date));
		followup.setDoctorCode(doctorCode);
		followup.setDoctorName(doctor.getName());
		followup.setOrgCode(doctor.getHospital());
		followup.setOrgName(doctor.getHospitalName());
		followup.setPatientCode(patientCode);
		followup.setPatientName(patient.getName());
		followup.setIdcard(patient.getIdcard());
		followup.setDataFrom("2");//数据来源 1基卫 2APP
		followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
		followup.setCreateTime(new Date());
				Followup followup = new Followup();
				followup.setFollowupType(map.get("type"));
				followup.setFollowupDate(DateUtil.strToDate(map.get("date")));
				followup.setDoctorCode(doctor.getCode());
				followup.setDoctorName(doctor.getName());
				followup.setOrgCode(doctor.getHospital());
				followup.setOrgName(doctor.getHospitalName());
				followup.setPatientCode(patientCode);
				followup.setPatientName(patient.getName());
				followup.setIdcard(patient.getIdcard());
				followup.setDataFrom("2");//数据来源 1基卫 2APP
				followup.setStatus("2");     //状态 0取消 1已完成 2未开始 3进行中
				followup.setCreateTime(new Date());
				followup.setCreater(doctorCode);
				followupPlan.add(followup);
			}
		followupDao.save(followup);
			followupDao.save(followupPlan);
		}
	}
	/**
@ -155,6 +184,7 @@ public class FollowUpService extends BaseService {
		followup.setDataFrom("2");//数据来源 1基卫 2APP
		followup.setStatus("3");     //状态 0取消 1已完成 2未开始 3进行中
		followup.setCreateTime(new Date());
		followup.setCreater(doctorCode);
		followupDao.save(followup);
		re = String.valueOf(followup.getId());

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -813,7 +813,7 @@ public class FamilyContractService extends BaseService {
        sf.setDoctorHealth(doctorHealth);
        sf.setDoctorHealthName(doctorHealthName);
        sf.setExpensesType(StringUtils.isEmpty(expenses) ? "01" : expenses);
        sf.setFamilyCode(createSignCode(doctor, hospital));
        //sf.setFamilyCode(createSignCode(doctor, hospital));
        sf.setEmerMobile(emerMobile);
        sf.setEnd(DateUtil.strToDateShort(DateUtil.getNextYear(DateUtil.getNowDateShort(), 1)));
        sf.setName(name);
@ -1054,7 +1054,7 @@ public class FamilyContractService extends BaseService {
            sf.setSignYear(year);//设置签约年度
            sf.setApplyDate(new Date());
            Doctor doc = doctorDao.findByCode(sf.getDoctor());
            sf.setFamilyCode(createSignCode(sf.getDoctor(), doc.getHospital()));
            //sf.setFamilyCode(createSignCode(sf.getDoctor(), doc.getHospital()));
            //建立团队
            DoctorTeam doctorTeam = new DoctorTeam();
            String doctorTeamCode = getCode();

+ 7 - 7
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/system/SystemDictController.java

@ -4,6 +4,8 @@ import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -11,6 +13,7 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@ -26,14 +29,11 @@ public class SystemDictController extends BaseController {
    @Autowired
    private SystemDictService systemDictService;
    /**
     * 根據dictname查找DictName
     * @param name
     * @return
     */
    @ApiOperation("根據dictname查找字典数据")
    @RequestMapping(value = "/getDictByDictName", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
    @ResponseBody
    @RequestMapping(value = "/getDictByDictName")
    public String getDictByDictName(String name){
    public String getDictByDictName(@ApiParam(name="name",value="字典名",defaultValue = "")
                                        @RequestParam(value="name",required = true) String name){
        try {
            List<SystemDict> list=systemDictService.getDictByDictName(name);
            JSONArray ja=new JSONArray();

+ 24 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/followup/DoctorFollowUpController.java

@ -59,15 +59,35 @@ public class DoctorFollowUpController extends BaseController {
		}
	}
	@ApiOperation("新增随访计划(简单)")
	@ApiOperation("获取随访列表(创建者)")
	@RequestMapping(value = "/createrList", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
	@ResponseBody
	public String getCreaterList(@ApiParam(name="startTime",value="开始时间",defaultValue = "2016-12-07 00:00:00")
						  @RequestParam(value="startTime",required = true) String startTime,
						  @ApiParam(name="endTime",value="结束时间",defaultValue = "2016-12-14 00:00:00")
						  @RequestParam(value="endTime",required = true) String endTime,
						  @ApiParam(name="page",value="第几页",defaultValue = "1")
						  @RequestParam(value="page",required = true) String page,
						  @ApiParam(name="pageSize",value="每页几行",defaultValue = "10")
						  @RequestParam(value="pageSize",required = true) String pageSize) {
		try {
			List<Followup> result = followUpService.getListByCreater(getUID(),startTime,endTime,page,pageSize);     //"64de9952-5b15-11e6-8344-fa163e8aee56"
			return write(200, "获取随访列表成功!", "data", result);
		} catch (Exception e) {
			return invalidUserException(e, -1, "获取随访列表失败!"+e.getMessage());
		}
	}
	@ApiOperation("新增随访计划(批量)")
	@RequestMapping(value = "/addFollowupPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
	@ResponseBody
	public String addFollowupPlan(@ApiParam(name="patient",value="患者代码",defaultValue = "443a196ef8744536a531260eb26c05d7")
						  @RequestParam(value="patient",required = true) String patient,
						  @ApiParam(name="date",value="下次随访时间",defaultValue = "2016-12-14 20:00:00")
						  @RequestParam(value="date",required = true) String date) {
						  @ApiParam(name="data",value="随访计划列表json",defaultValue = "[{\"date\":\"2016-12-16 20:00:00\",\"type\":\"10\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"},{\"date\":\"2016-12-17 15:00:00\",\"type\":\"3\",\"doctor\":\"64de9952-5b15-11e6-8344-fa163e8aee56\"}]")
						  @RequestParam(value="data",required = true) String data) {
		try {
			followUpService.addFollowupPlan(getUID(),patient,date);
			followUpService.addFollowupPlan(getUID(),patient,data);
			return write(200, "新增随访计划成功!");
		} catch (Exception e) {