后端接口:获取指定病患明天的订餐记录,获取指定科室明天的报餐记录
This commit is contained in:
parent
d5195dfe9e
commit
48c922a3a9
@ -1,9 +1,11 @@
|
|||||||
package com.ruoyi.system.fantang.controller;
|
package com.ruoyi.system.fantang.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
|
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
|
||||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
import com.ruoyi.system.fantang.vo.FtDepartVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -12,7 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@ -30,4 +31,24 @@ public class ClientPatientController extends BaseController {
|
|||||||
|
|
||||||
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(createAt, patientId));
|
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(createAt, patientId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getReportMealsTomorrow/{patientId}")
|
||||||
|
public AjaxResult getReportMealsTomorrow(@PathVariable("patientId") Long patientId) {
|
||||||
|
|
||||||
|
DateTime tomorrow = DateUtil.tomorrow();
|
||||||
|
String formatDate = DateUtil.formatDate(tomorrow);
|
||||||
|
|
||||||
|
return AjaxResult.success(iFtPatientDaoService.getReportMealsToday(formatDate, patientId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getReportMealsByDepart/{departId}")
|
||||||
|
public AjaxResult getReportMealsByDepart(@PathVariable("departId") Long departId) {
|
||||||
|
|
||||||
|
DateTime tomorrow = DateUtil.tomorrow();
|
||||||
|
String formatDate = DateUtil.formatDate(tomorrow);
|
||||||
|
|
||||||
|
FtDepartVo ftDepartVo = iFtPatientDaoService.getReportMealsByDepart(departId, formatDate);
|
||||||
|
|
||||||
|
return AjaxResult.success(ftDepartVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.system.fantang.domain.FtPatientDao;
|
import com.ruoyi.system.fantang.domain.FtPatientDao;
|
||||||
|
import com.ruoyi.system.fantang.vo.FtDepartVo;
|
||||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
||||||
import com.ruoyi.system.fantang.vo.ftSyncConflictVo;
|
import com.ruoyi.system.fantang.vo.ftSyncConflictVo;
|
||||||
import org.apache.ibatis.annotations.Insert;
|
import org.apache.ibatis.annotations.Insert;
|
||||||
@ -52,4 +53,6 @@ public interface FtPatientDaoMapper extends BaseMapper<FtPatientDao> {
|
|||||||
List<ftSyncConflictVo> syncConflictOtherAllEqual();
|
List<ftSyncConflictVo> syncConflictOtherAllEqual();
|
||||||
|
|
||||||
List<FtPatientVo> getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
|
List<FtPatientVo> getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
|
||||||
|
|
||||||
|
FtDepartVo getReportMealsByDepart(@Param("departId") Long departId, @Param("createAt") String createAt);
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
package com.ruoyi.system.fantang.service;
|
package com.ruoyi.system.fantang.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.system.fantang.domain.FtPatientDao;
|
import com.ruoyi.system.fantang.domain.FtPatientDao;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.ruoyi.system.fantang.vo.FtDepartVo;
|
||||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 病人管理Service接口
|
* 病人管理Service接口
|
||||||
@ -16,4 +14,6 @@ import java.util.List;
|
|||||||
public interface IFtPatientDaoService extends IService<FtPatientDao> {
|
public interface IFtPatientDaoService extends IService<FtPatientDao> {
|
||||||
|
|
||||||
AjaxResult getReportMealsToday(String createAt, Long patientId);
|
AjaxResult getReportMealsToday(String createAt, Long patientId);
|
||||||
|
|
||||||
|
FtDepartVo getReportMealsByDepart(Long departId, String createAt);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.fantang.service.impl;
|
package com.ruoyi.system.fantang.service.impl;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.system.fantang.vo.FtDepartVo;
|
||||||
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
import com.ruoyi.system.fantang.vo.FtPatientVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -23,4 +24,9 @@ public class FtPatientDaoServiceImpl extends ServiceImpl<FtPatientDaoMapper, FtP
|
|||||||
public AjaxResult getReportMealsToday(String createAt, Long patientId) {
|
public AjaxResult getReportMealsToday(String createAt, Long patientId) {
|
||||||
return AjaxResult.success(this.baseMapper.getReportMealsToday(createAt, patientId));
|
return AjaxResult.success(this.baseMapper.getReportMealsToday(createAt, patientId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FtDepartVo getReportMealsByDepart(Long departId, String createAt) {
|
||||||
|
return this.baseMapper.getReportMealsByDepart(departId,createAt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.system.fantang.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.system.fantang.domain.FtDepartDao;
|
||||||
|
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class FtDepartVo extends FtDepartDao {
|
||||||
|
|
||||||
|
List<FtReportMealsDao> reportMealsList;
|
||||||
|
}
|
@ -15,7 +15,6 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@TableName(value="ft_patient",resultMap = "patientReportMealsResultMap")
|
|
||||||
public class FtPatientVo extends FtPatientDao {
|
public class FtPatientVo extends FtPatientDao {
|
||||||
|
|
||||||
List<FtReportMealsDao> reportMealsList;
|
List<FtReportMealsDao> reportMealsList;
|
||||||
|
@ -36,4 +36,36 @@ WHERE a.patient_id = #{patientId} and c.create_at = #{createAt}
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getReportMealsByDepart" resultMap="departReportMealsList">
|
||||||
|
SELECT
|
||||||
|
a.depart_id,
|
||||||
|
a.depart_name,
|
||||||
|
a.depart_code,
|
||||||
|
c.create_at,
|
||||||
|
c.foods,
|
||||||
|
c.id,
|
||||||
|
c.nutrition_food_id,
|
||||||
|
c.type
|
||||||
|
FROM
|
||||||
|
ft_depart a
|
||||||
|
LEFT JOIN ft_patient b ON a.depart_id = b.depart_id
|
||||||
|
LEFT JOIN ft_report_meals c ON c.patient_id = b.patient_id
|
||||||
|
WHERE
|
||||||
|
a.depart_id = #{departId}
|
||||||
|
AND c.create_at = #{createAt}
|
||||||
|
</select>
|
||||||
|
<resultMap id="departReportMealsList" type="com.ruoyi.system.fantang.vo.FtDepartVo">
|
||||||
|
<result property="departId" column="depart_id"></result>
|
||||||
|
<result property="departName" column="depart_name"></result>
|
||||||
|
<result property="departCode" column="depart_code"></result>
|
||||||
|
<collection property="reportMealsList" ofType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
|
||||||
|
<result property="id" column="id"></result>
|
||||||
|
<result property="createAt" column="create_at"></result>
|
||||||
|
<result property="type" column="type"></result>
|
||||||
|
<result property="foods" column="foods"></result>
|
||||||
|
<result property="nutritionFoodId" column="nutrition_food_id"></result>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
x
Reference in New Issue
Block a user