护工获取默认部门信息

This commit is contained in:
ryoeiken 2020-12-30 10:57:17 +08:00
parent 339ea49928
commit f9a5efd406
6 changed files with 46 additions and 3 deletions

View File

@ -4,7 +4,9 @@ import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
import com.ruoyi.system.fantang.vo.FtDepartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -23,6 +25,9 @@ public class ClientPatientController extends BaseController {
@Autowired
private IFtPatientDaoService iFtPatientDaoService;
@Autowired
private IFtStaffInfoDaoService iFtStaffInfoDaoService;
@GetMapping("/getReportMealsToday/{patientId}")
public AjaxResult getReportMealsToday(@PathVariable("patientId") Long patientId) {
@ -51,4 +56,12 @@ public class ClientPatientController extends BaseController {
return AjaxResult.success(ftDepartVo);
}
@GetMapping("/getDepartInfo/{staffId}")
public AjaxResult getDepartInfo(@PathVariable("staffId") Long staffId) {
FtStaffInfoDao departInfo = iFtStaffInfoDaoService.getDepartInfo(staffId);
return AjaxResult.success(departInfo);
}
}

View File

@ -48,6 +48,12 @@ public class FtStaffInfoDao {
@TableField(exist = false)
private String departName;
/**
* 科室编号
*/
@TableField(exist = false)
private String departCode;
/**
* 姓名
*/

View File

@ -2,7 +2,7 @@ package com.ruoyi.system.fantang.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import java.util.List;
@ -20,4 +20,6 @@ public interface FtStaffInfoDaoMapper extends BaseMapper<FtStaffInfoDao> {
@Update("update ft_staff_info set token=#{token}, login_flag=1 where staff_id=#{staff_id}")
void updateLoginStatus(FtStaffInfoDao dao);
FtStaffInfoDao getDepartInfo(@Param("staffId") Long staffId);
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.fantang.domain.FtDepartDao;
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
import java.util.List;
@ -19,4 +20,6 @@ public interface IFtStaffInfoDaoService extends IService<FtStaffInfoDao> {
AjaxResult login(String tel, String password);
AjaxResult logout(Long staffId);
FtStaffInfoDao getDepartInfo(Long staffId);
}

View File

@ -57,4 +57,9 @@ public class FtStaffInfoDaoServiceImpl extends ServiceImpl<FtStaffInfoDaoMapper,
return AjaxResult.error("更新退出状态失败");
return AjaxResult.success(dao);
}
@Override
public FtStaffInfoDao getDepartInfo(Long staffId) {
return this.baseMapper.getDepartInfo(staffId);
}
}

View File

@ -26,8 +26,22 @@
<select id="selectStaffInfoWithDepart" parameterType="FtStaffInfoDao"
resultType="FtStaffInfoDao">
SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where staff_type = 1 and a.flag = 1
SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where
staff_type = 1 and a.flag = 1
<if test="departId != null">and b.depart_id = #{departId}</if>
</select>
<select id="getDepartInfo" resultType="FtStaffInfoDao">
SELECT a.staff_id,
a.`name`,
a.corp_name,
a.picture_url,
b.depart_id,
b.depart_name,
b.depart_code
FROM ft_staff_info a
LEFT JOIN ft_depart b ON a.dept_list = b.depart_id
WHERE a.staff_id = #{staffId}
</select>
</mapper>