Browse Source

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

liubing 3 years ago
parent
commit
6a13e4186b

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/handover/BaseDayHandoverDao.java

@ -13,8 +13,8 @@ import java.util.List;
public interface BaseDayHandoverDao extends PagingAndSortingRepository<BaseDayHandover, String>, JpaSpecificationExecutor<BaseDayHandover> {
    @Query("select h from BaseDayHandover h where h.createUser = ?1 order by h.createTime DESC")
    List<BaseDayHandover> findByCreateUser(String code);
    @Query("select h from BaseDayHandover h where h.createUser = ?1 and h.createTime >= ?2 and h.createTime <= ?3 order by h.createTime DESC")
    List<BaseDayHandover> findByCreateUser(String code,String staterDate,String endDate);
    @Query("select h from BaseDayHandover h where h.id = ?1")
    BaseDayHandover findById(String id);

+ 12 - 3
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorDayHandoverController.java

@ -46,7 +46,12 @@ public class DoctorDayHandoverController extends BaseController {
            if (null == baseDayHandover) {
                return write(-1, "参数错误!");
            }
            return write(200, "成功", "data", dayHandoverService.saveDayHandover(baseDayHandover));
            BaseDayHandover result = dayHandoverService.saveDayHandover(baseDayHandover);
            if (null==result){
                return write(400,"提交人与交接人不能是同一个人!");
            }
            return write(200, "成功", "data",result);
        } catch (Exception e) {
            error(e);
            return errorResult(e);
@ -56,7 +61,11 @@ public class DoctorDayHandoverController extends BaseController {
    @PostMapping("/getDayHandoverList")
    @ApiOperation(value = "获取交接列表")
    public String getDayHandoverList(@ApiParam(name = "doctor")
                                     @RequestParam(value = "doctor") String doctor) {
                                     @RequestParam(value = "doctor") String doctor,
                                     @ApiParam(name = "staterDate")
                                     @RequestParam(value = "staterDate")String staterDate,
                                     @ApiParam(name = "endDate")
                                     @RequestParam(value = "endDate")String endDate) {
        try {
            JSONObject param = new JSONObject();
@ -68,7 +77,7 @@ public class DoctorDayHandoverController extends BaseController {
                return write(-1, "该操作仅支持社工");
            }
            return write(200, "成功", "data", dayHandoverService.getDayHandoverList(doctor));
            return write(200, "成功", "data", dayHandoverService.getDayHandoverList(doctor,staterDate,endDate));
        } catch (Exception e) {
            error(e);

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -923,6 +923,16 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            doorConclusion.setDoctor(doctorDO.getId());
            doorConclusion.setDoctorName(doctorDO.getName());
        }
        BaseEmergencyWarnLogDO logTypeDO = new BaseEmergencyWarnLogDO();
        logTypeDO.setUserCode(doctor);
        logTypeDO.setUserName(doctorDO.getName());
        logTypeDO.setOrderId(orderId);
        logTypeDO.setUserType(2);
        logTypeDO.setCreateTime(new Date());
        logTypeDO.setContent("完成服务小结");
        logTypeDO.setType(5);
        logDao.save(logTypeDO);
        doorConclusion.setEmergencyReason(emergency_reason);
        doorConclusion.setEmergencyTreatmentStatus(treatment_status);
        doorConclusion.setConclusion(conclusion);

+ 7 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/DayHandoverService.java

@ -6,6 +6,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.care.handover.BaseDayHandover;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -29,12 +30,16 @@ public class DayHandoverService {
    //保存日常交接
    public BaseDayHandover saveDayHandover(BaseDayHandover baseDayHandover) {
        if (baseDayHandover.getHandoverUser().equals(baseDayHandover.getCreateUser())){
            return null;
        }
        return baseDayHandoverDao.save(baseDayHandover);
    }
    //获取交接列表
    public List<BaseDayHandover> getDayHandoverList(String doctor) {
        return baseDayHandoverDao.findByCreateUser(doctor);
    public List<BaseDayHandover> getDayHandoverList(String doctor,String staterDate,String endDate) {
        String sql ="SELECT * from base_day_handover WHERE create_user ='"+doctor+"' AND create_time >= '"+staterDate+"' AND create_time <= '"+endDate+"' ORDER BY create_time DESC";
        return jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BaseDayHandover.class));
    }
    //获取团队成员