新增病患报餐统计功能

This commit is contained in:
czx 2021-01-28 16:05:24 +08:00
parent c562ef36f9
commit 63485c1f7d
8 changed files with 81 additions and 25 deletions

View File

@ -226,8 +226,8 @@ public class ClientPatientController extends BaseController {
*/
@PostMapping("/tomorrowReport")
public AjaxResult tomorrowReport(@RequestBody JSONArray list){
System.out.println(list);
List<JSONObject> objects = list.toJavaList(JSONObject.class);
logger.info("送餐员报餐总数:{}", objects.size());
for (JSONObject object : objects) {
FtReportMealsDao dao = JSONObject.toJavaObject(object, FtReportMealsDao.class);
reportMealsDaoService.updateById(dao);

View File

@ -9,6 +9,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.fantang.domain.FtPrepaymentDao;
import com.ruoyi.system.fantang.domain.FtReportMealsDao;
@ -224,4 +225,20 @@ public class FtReportMealsDaoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(iFtReportMealsDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
}
@GetMapping("/listPatientReportMeals")
public TableDataInfo listPatientReportMeals(FtReportMealVo ftReportMealsDao) {
startPage();
Date createAt = ftReportMealsDao.getCreateAt();
if (createAt != null) {
ftReportMealsDao.setBeginOfDay(createAt);
ftReportMealsDao.setEndOfDay(createAt);
}
List<FtReportMealVo> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
return getDataTable(list);
}
}

View File

@ -54,4 +54,7 @@ public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
@Select("SELECT a.patient_id,sum(a.price) as dinner_total_price , sum(a.nutrition_food_price ) as nutrition_total_price , sum(a.total_price) as sum_total_price FROM ft_report_meals a where a.patient_id = #{patientId} AND a.settlement_flag = 0 AND a.dining_flag = 1")
ReportMealsPriceEntity sumAllTotalPrice(@Param("patientId") Long patientId);
// SELECT a.*, b.`name` , b.bed_id, b.hospital_id, c.depart_name from ft_report_meals a LEFT JOIN ft_patient b on a.patient_id = b.patient_id LEFT JOIN ft_depart c on b.depart_id =c.depart_id where a.patient_id in (7) and a.create_at = CURDATE() + 1
List<FtReportMealVo> listPatientReportMeals(FtReportMealVo ftReportMealsDao);
}

View File

@ -40,5 +40,7 @@ public interface IFtReportMealsDaoService extends IService<FtReportMealsDao> {
List<FtReportMealsDao> listAllNutrition(FtReportMealsDao ftReportMealsDao);
List<FtReportMealVo> getStatisticsFoods(Integer departId, Date day);
List<FtReportMealVo> listPatientReportMeals(FtReportMealVo ftReportMealsDao);
}

View File

@ -140,4 +140,9 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl<FtReportMealsDaoMap
return this.baseMapper.getStatisticsFoods(departId, DateUtil.beginOfDay(day), DateUtil.endOfDay(day));
}
@Override
public List<FtReportMealVo> listPatientReportMeals(FtReportMealVo ftReportMealsDao) {
return this.baseMapper.listPatientReportMeals(ftReportMealsDao);
}
}

View File

@ -117,5 +117,23 @@
<if test="type != null">and a.type = #{type}</if>
</where>
</select>
<select id="listPatientReportMeals" resultType="com.ruoyi.system.fantang.domain.FtReportMealsDao">
SELECT
a.*, b.`name`,
b.bed_id,
b.hospital_id,
c.depart_name
FROM
ft_report_meals a
LEFT JOIN ft_patient b ON a.patient_id = b.patient_id
LEFT JOIN ft_depart c ON b.depart_id = c.depart_id
<where>
<if test="name != null"> b.`name` like CONCAT('%',#{name},'%')</if>
<if test="bedId != null">and b.bed_id = #{bedId}</if>
<if test="departName != null">and b.depart_name = #{departName}</if>
<if test="beginOfDay != null">AND a.create_at BETWEEN #{beginOfDay}</if>
<if test="endOfDay != null">AND #{endOfDay}</if>
</where>
</select>
</mapper>

View File

@ -40,7 +40,7 @@ export function listPayoff(query) {
// 查询报餐管理列表
export function listMeals(query) {
return request({
url: '/fantang/meals/list',
url: '/fantang/meals/listPatientReportMeals',
method: 'get',
params: query
})

View File

@ -9,24 +9,10 @@
placeholder="选择报餐日期">
</el-date-picker>
</el-form-item>
<el-form-item label="报餐类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择报餐类型" clearable size="small">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item label="报餐人" prop="createBy">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.createBy"
placeholder="请输入报餐人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="总价" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入总价"
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
@ -86,16 +72,27 @@
<el-table v-loading="loading" :data="mealsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="总价" align="center" prop="id" v-if="false"/>
<el-table-column label="科室" align="center" prop="departName"/>
<el-table-column label="住院号" align="center" prop="HospitalId"/>
<el-table-column label="床号" align="center" prop="bedId"/>
<el-table-column label="姓名" align="center" prop="name"/>
<el-table-column label="类型" align="center" prop="type" :formatter="formatToDinner"/>
<el-table-column label="菜品" align="center" prop="foods"/>
<el-table-column label="加饭" align="center" prop="rice"/>
<el-table-column label="加菜" align="center" prop="vegetables"/>
<el-table-column label="加肉" align="center" prop="meat"/>
<el-table-column label="加蛋" align="center" prop="egg"/>
<el-table-column label="正餐价格" align="center" prop="price"/>
<el-table-column label="是否营养餐" align="center" prop="openFlag"/>
<el-table-column label="营养餐名称" align="center" prop="nutritionName"/>
<el-table-column label="营养餐方式" align="center" prop="isReplaceFood"/>
<el-table-column label="营养餐价格" align="center" prop="nutritionFoodPrice"/>
<el-table-column label="总价" align="center" prop="totalPrice"/>
<el-table-column label="报餐日期" align="center" prop="createAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="报餐类型" align="center" prop="type"/>
<el-table-column label="报餐人" align="center" prop="createBy"/>
<el-table-column label="订单列表" align="center" prop="foods"/>
<el-table-column label="总价" align="center" prop="price"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -161,7 +158,7 @@
</template>
<script>
import {addMeals, delMeals, exportMeals, getMeals, listMeals, updateMeals} from "@/api/fantang/meals";
import {addMeals, delMeals, exportMeals, getMeals, listMeals, updateMeals} from "../../../api/fantang/meals";
export default {
name: "Meals",
@ -190,6 +187,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
createAt: null,
type: null,
createBy: null,
@ -221,6 +219,19 @@ export default {
this.getList();
},
methods: {
//
formatToDinner(row) {
if (row.type === 1)
return '早餐';
if (row.type === 2)
return '午餐';
if (row.type === 3)
return '晚餐';
if (row.type === 4)
return '加餐';
},
/** 查询报餐管理列表 */
getList() {
this.loading = true;