Explorar o código

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

LAPTOP-KB9HII50\70708 hai 11 meses
pai
achega
cdaf2f7feb

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/rehabilitation/ServiceItemPlanDao.java

@ -18,6 +18,10 @@ public interface ServiceItemPlanDao extends PagingAndSortingRepository<ServiceIt
    @Query("from ServiceItemPlanDO w where w.planId =?1 ")
    List<ServiceItemPlanDO> findByPlanId(String planId);
    ServiceItemPlanDO findByRelationCode(String relationCode);
    ServiceItemPlanDO findByPlanIdAndPlanDetailIdAndPlanTime(String planId,String planDetailId,String planTime);
    ServiceItemPlanDO findByRelationCodeAndRelationType(String relationCode,String relationType);
    @Query("from ServiceItemPlanDO w where w.planDetailId =?1 and w.status=?2")

+ 3 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/controller/DoctorFollowUpController.java

@ -189,12 +189,12 @@ public class DoctorFollowUpController extends BaseController {
                                @RequestParam(value = "followupClass", required = true) String followupClass,
                                @ApiParam(name = "followupManagerStatus", value = "随访管理状态【字典FOLLOWUP_MANAGER_STATUS】", defaultValue = "1")
                                @RequestParam(value = "followupManagerStatus", required = false) String followupManagerStatus,
                                @ApiParam(name = "plandate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                                @RequestParam(value = "plandate", required = false) String plandate,
                                @ApiParam(name = "planDate", value = "下次随访时间", defaultValue = "2016-12-14 20:00:00")
                                @RequestParam(value = "planDate", required = false) String planDate,
                                @ApiParam(name = "prescriptioncode", value = "续方CODE", defaultValue = "")
                                    @RequestParam(value = "prescriptioncode", required = false) String prescriptioncode) {
        try {
            Followup followup = followUpService.startFollowup( id, followupNo, date, followupType, followupClass, followupManagerStatus,plandate,prescriptioncode);
            Followup followup = followUpService.startFollowup( id, followupNo, date, followupType, followupClass, followupManagerStatus,planDate,prescriptioncode);
//            followUpService.getNotStartFollowup(getUID(), followup.getFollowupPlanDate());
            return write(200, "开始随访记录成功!");
        } catch (ServiceException se) {

+ 16 - 54
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java

@ -25,6 +25,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.task.PushMsgTask;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
@ -83,24 +84,16 @@ public class FollowUpService {
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
//    @Autowired
//    private DrHealthTeamService drHealthTeamService;
    @Autowired
    private SystemMessageDao messageDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private BasePatientService patientService;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private FollowupDrugsDao followupDrugsDao;
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
@ -655,61 +648,30 @@ public class FollowUpService {
    public Followup startFollowup(String id, String followupNo, String date, String followupType, String followupClass, String followupManagerStatus, String plandate, String prescriptioncode) throws Exception {
        Followup followup = followupDao.findById(Long.valueOf(id)).orElse(null);
        if (followup != null) {
            ServiceItemPlanDO itemPlanDO = serviceItemPlanDao.findByRelationCode(id);
            System.out.println("22222222222222222"+JSON.toJSONString(itemPlanDO));
            ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findByPlanIdAndPlanDetailIdAndPlanTime(itemPlanDO.getPlanId(), itemPlanDO.getPlanDetailId(), DateUtil.dateToStrLong(followup.getFollowupNextDate()));
            System.out.println("111111111111111111"+JSON.toJSONString(serviceItemPlanDO));
            if (StringUtils.isNoneBlank(plandate)) {
                followup.setFollowupNextDate(DateUtil.strToDate(plandate));
                Followup nextFollowup = followupDao.findById(Long.valueOf(serviceItemPlanDO.getRelationCode())).orElse(null);
                System.out.println("333333333333333333"+JSON.toJSONString(nextFollowup));
                nextFollowup.setFollowupDate(DateUtil.strToDateLong(plandate));
                nextFollowup.setFollowupPlanDate(DateUtil.strToDateLong(plandate));
                serviceItemPlanDO.setPlanTime(plandate);
                followupDao.save(nextFollowup);
                serviceItemPlanDao.save(serviceItemPlanDO);
            }
            if (followup.getStatus().compareTo("2") == 0) {
                followup.setFollowupNo(followupNo);
                followup.setFollowupDate(DateUtil.strToDate(date));
                //计划下次随访时间--huangwenjie.2017.10.19
                if (StringUtils.isNoneBlank(plandate)) {
                    followup.setFollowupNextDate(DateUtil.strToDate(plandate));
                    Followup nextFollowup = new Followup();
                    nextFollowup.setDataFrom(followup.getDataFrom());
                    nextFollowup.setStatus("2");
                    nextFollowup.setFollowupType(followupType);
                    nextFollowup.setFollowupNo(followup.getFollowupNo());
                    nextFollowup.setFollowupDate(DateUtil.strToDate(plandate));
                    nextFollowup.setFollowupPlanDate(DateUtil.strToDate(plandate));
                    nextFollowup.setJwdoctorCode(followup.getJwdoctorCode());
                    nextFollowup.setJworgCode(followup.getJworgCode());
                    nextFollowup.setOrgCode(followup.getOrgCode());
                    nextFollowup.setOrgName(followup.getOrgName());
                    nextFollowup.setCreater(followup.getCreater());
                    nextFollowup.setSignCode(followup.getSignCode());
                    nextFollowup.setAdminTeamCode(followup.getAdminTeamCode());
                    nextFollowup.setFollowupClass(followupClass);
                    nextFollowup.setFollowupManagerStatus(followupManagerStatus);
                    nextFollowup.setPatientName(followup.getPatientName());
                    nextFollowup.setPatientCode(followup.getPatientCode());
                    nextFollowup.setCreateTime(new Date());
                    nextFollowup.setUpdateTime(new Date());
                    nextFollowup.setDoctorCode(followup.getDoctorCode());
                    nextFollowup.setDoctorName(followup.getDoctorName());
                    nextFollowup.setIdcard(followup.getIdcard());
                    nextFollowup.setSignType(followup.getSignType());
                    nextFollowup.setType(1);
                    //获取随访医生角色类型
//                    List<DoctorMapping> doctorMapping = doctorMappingDao.findListByDoctorCode(followup.getDoctorCode());
//                    if (doctorMapping.size() == 1 && StringUtils.isNotBlank(doctorMapping.get(0).getJwDoctorWorkType())) {
//                        nextFollowup.setJwDoctorWorkType(doctorMapping.get(0).getJwDoctorWorkType());
//                    }
                    followupDao.save(nextFollowup);
                }
                followup.setFollowupType(followupType);
                followup.setFollowupClass(followupClass);
                followup.setFollowupManagerStatus(followupManagerStatus);
                followup.setStatus("3");  //状态 0取消 1已完成 2未开始 3进行中
                followup.setPrescriptionCode(prescriptioncode);
//                if (StringUtils.isNoneBlank(prescriptioncode)) {
//                    try {
//                        Prescription prescription = prescriptionDao.findByCode(prescriptioncode);
////                        prescription.setViewSuifang(1);
//                        prescriptionDao.save(prescription);
//                    } catch (Exception e) {
//                        logger.info(e.getMessage());
//                    }
//                }
                Followup f = followupDao.save(followup);
                System.out.println("随访状态status" + f.getStatus());
                return f;

+ 1 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DoctorRehabilitaionInfoController.java

@ -64,7 +64,7 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
            @ApiParam(name = "downPatientId", value = "下转表id", required = false) @RequestParam(value = "downPatientId", required = false) String downPatientId,
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "idcard", value = "检索-身份证或者姓名", required = false) @RequestParam(value = "idcard", required = false) String idcard,
            @ApiParam(name = "status", value = "", defaultValue = "0", required = false) @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "status", value = "",  required = false) @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "page", value = "起始页", required = false) @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
            @ApiParam(name = "pagesize", value = "每页显示数据条数", required = false) @RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize
    ) {

+ 6 - 6
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationInfoService.java

@ -966,9 +966,9 @@ public class RehabilitationInfoService {
            //wlyy_rehabilitation_patient_info的id
            filterSql += " and d.id='" + downPatientId + "' ";
        }
        if (StringUtils.isBlank(doctorId)) {
        if (StringUtils.isBlank(status)) {
            //看全部数据
            filterSql += "	AND (d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  ) ) " +
            filterSql += "	AND (d.create_user = '" + doctorId + "'  OR q.plan_doctor='" + doctorId + "' OR ISNULL(  d.create_user  ) ) " +
                    "	    AND ( ISNULL( d.type ) OR d.type = 2 ) ORDER BY d.create_time DESC ";
            detailSql += filterSql + limitSql;
            countSql += filterSql;
@ -979,7 +979,7 @@ public class RehabilitationInfoService {
        if (StringUtils.isNotBlank(status)) {
            if ("0".equals(status)) {
                //未下转的人
                filterSql += "	AND (d.create_user = '" + doctorId + "'  OR ISNULL(d.create_user)) AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                filterSql += "	AND (d.create_user = '" + doctorId + "' OR q.plan_doctor='" + doctorId + "'  OR ISNULL(d.create_user)) AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                        " and d.status='0' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
@ -990,7 +990,7 @@ public class RehabilitationInfoService {
            }
            if ("1".equals(status)) {
                //待分配的人
                filterSql += "	AND (d.create_user = '" + doctorId + "' OR ISNULL( d.create_user) )AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                filterSql += "	AND (d.create_user = '" + doctorId + "' OR q.plan_doctor='" + doctorId + "' OR ISNULL( d.create_user) )AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                        "   and d.status='1' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
@ -1002,7 +1002,7 @@ public class RehabilitationInfoService {
            if ("7".equals(status)) {
                //已经分配医生
                filterSql += "	AND ( d.create_user = '" + doctorId + "'  OR ISNULL(  d.create_user  ) )   " +
                filterSql += "	AND ( d.create_user = '" + doctorId + "' OR q.plan_doctor='" + doctorId + "'  OR ISNULL(  d.create_user  ) )   " +
                        "	AND ( ISNULL( d.type ) OR d.type = 2 ) and d.status='7' ";
                filterSql += " ORDER BY d.create_time DESC ";
                detailSql += filterSql + limitSql;
@ -1296,7 +1296,7 @@ public class RehabilitationInfoService {
                "	LEFT JOIN wlyy_rehabilitation_plan_detail pd ON pd.plan_id = q.id " +
                "WHERE " +
                "	1 = 1  " +
                " 	AND ( d.create_user = '" + doctorId + "'  OR q.plan_doctor='" + doctorId + "' OR ISNULL( d.create_user ) or pd.doctor='" + doctorId + "' )  " +
                " 	AND ( d.create_user = '" + doctorId + "'  OR q.plan_doctor='" + doctorId + "' OR ISNULL( d.create_user )  )  " +
                "	AND ( ISNULL( d.type ) OR d.type = 2 ) " +
                "	GROUP BY d.`status`";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);