病患报餐统计导出,修复定时任务默认插入用餐日期

This commit is contained in:
ryoeiken 2021-01-29 09:28:40 +08:00
parent d80646eb51
commit a425c40b21
8 changed files with 66 additions and 51 deletions

View File

@ -169,10 +169,17 @@ public class FtReportMealsDaoController extends BaseController {
@Log(title = "报餐管理", businessType = BusinessType.EXPORT) @Log(title = "报餐管理", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(FtReportMealsDao ftReportMealsDao) { public AjaxResult export(FtReportMealsDao ftReportMealsDao) {
LambdaQueryWrapper<FtReportMealsDao> lqw = new LambdaQueryWrapper<FtReportMealsDao>(ftReportMealsDao); Date createAt = ftReportMealsDao.getCreateAt();
List<FtReportMealsDao> list = iFtReportMealsDaoService.list(lqw);
ExcelUtil<FtReportMealsDao> util = new ExcelUtil<FtReportMealsDao>(FtReportMealsDao.class); if (createAt != null) {
return util.exportExcel(list, "meals"); ftReportMealsDao.setBeginOfDay(createAt);
ftReportMealsDao.setEndOfDay(createAt);
}
List<FtReportMealsDao> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
ExcelUtil<FtReportMealsDao> util = new ExcelUtil<>(FtReportMealsDao.class);
return util.exportExcel(list, "病患报餐统计");
} }
@ -228,7 +235,7 @@ public class FtReportMealsDaoController extends BaseController {
@GetMapping("/listPatientReportMeals") @GetMapping("/listPatientReportMeals")
public TableDataInfo listPatientReportMeals(FtReportMealVo ftReportMealsDao) { public TableDataInfo listPatientReportMeals(FtReportMealsDao ftReportMealsDao) {
startPage(); startPage();
Date createAt = ftReportMealsDao.getCreateAt(); Date createAt = ftReportMealsDao.getCreateAt();
@ -237,7 +244,7 @@ public class FtReportMealsDaoController extends BaseController {
ftReportMealsDao.setEndOfDay(createAt); ftReportMealsDao.setEndOfDay(createAt);
} }
List<FtReportMealVo> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao); List<FtReportMealsDao> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -38,6 +38,34 @@ public class FtReportMealsDao implements Serializable {
@TableId(value = "id") @TableId(value = "id")
private Long id; private Long id;
/**
* 科室名
*/
@TableField(exist = false)
@Excel(name = "部门名称")
private String departName;
/**
* 住院号
*/
@TableField(exist = false)
@Excel(name = "住院号")
private String hospitalId;
/**
* 床号
*/
@TableField(exist = false)
@Excel(name = "床号")
private String bedId;
/**
* 病人姓名
*/
@TableField(exist = false)
@Excel(name = "姓名")
private String name;
/** /**
* 报餐日期 * 报餐日期
*/ */
@ -48,7 +76,7 @@ public class FtReportMealsDao implements Serializable {
/** /**
* 报餐类型 * 报餐类型
*/ */
@Excel(name = "报餐类型") @Excel(name = "报餐类型", readConverterExp = "1=早餐,2=午餐,3=晚餐,4=加餐")
private Long type; private Long type;
/** /**
@ -59,19 +87,17 @@ public class FtReportMealsDao implements Serializable {
/** /**
* 报餐人 * 报餐人
*/ */
@Excel(name = "报餐人")
private Long createBy; private Long createBy;
/** /**
* 订单列表 * 订单列表
*/ */
@Excel(name = "订单列表")
private String foods; private String foods;
/** /**
* 正餐总价 * 正餐总价
*/ */
@Excel(name = "总价") @Excel(name = "正餐总价")
private BigDecimal price; private BigDecimal price;
/** /**
@ -86,36 +112,12 @@ public class FtReportMealsDao implements Serializable {
private String settlementBy; private String settlementBy;
/**
* 住院号
*/
@TableField(exist = false)
private String hospitalId;
/** /**
* 科室 id * 科室 id
*/ */
@TableField(exist = false) @TableField(exist = false)
private String departId; private String departId;
/**
* 科室名
*/
@TableField(exist = false)
private String departName;
/**
* 床号
*/
@TableField(exist = false)
private String bedId;
/**
* 病人姓名
*/
@TableField(exist = false)
private String name;
/** /**
* 营养餐 id * 营养餐 id
*/ */
@ -134,11 +136,13 @@ public class FtReportMealsDao implements Serializable {
/** /**
* 营养配餐价格 * 营养配餐价格
*/ */
@Excel(name = "营养配餐价格")
private BigDecimal nutritionFoodPrice; private BigDecimal nutritionFoodPrice;
/** /**
* 当前报餐总价 * 当前报餐总价
*/ */
@Excel(name = "当餐总价")
private BigDecimal totalPrice; private BigDecimal totalPrice;
private Boolean vegetables; private Boolean vegetables;
@ -166,9 +170,6 @@ public class FtReportMealsDao implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private Integer cateringUsage; private Integer cateringUsage;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date diningAt;
/** /**
* 用餐开始时间 * 用餐开始时间
*/ */
@ -184,5 +185,10 @@ public class FtReportMealsDao implements Serializable {
/** /**
* 用餐标志 * 用餐标志
*/ */
@Excel(name = "是否已用餐", readConverterExp = "1=是,0=否")
private Integer diningFlag; private Integer diningFlag;
@Excel(name = "用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date diningAt;
} }

View File

@ -31,8 +31,8 @@ public interface FtReportMealVoMapper extends BaseMapper<FtReportMealVo> {
// select d.*, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_food_demand d // select d.*, (select sum(price) from ft_food f where FIND_IN_SET(f.food_id,d.foods)) as price from ft_food_demand d
// 根据病患配餐表生成次日报餐记录并通过ft_food 菜品价格计算菜单总价 // 根据病患配餐表生成次日报餐记录并通过ft_food 菜品价格计算菜单总价
@Insert("insert into ft_report_meals " + @Insert("insert into ft_report_meals " +
"(create_at, type, patient_id, foods, settlement_flag, dining_at, price, open_flag , nutrition_food_flag, nutrition_food_id) " + "(create_at, type, patient_id, foods, settlement_flag, price, open_flag , nutrition_food_flag, nutrition_food_id) " +
"select date_add(now(), interval 1 day), d.type, d.patient_id , d.foods, 0 , date_add(now(), interval 1 day), " + "select date_add(now(), interval 1 day), d.type, d.patient_id , d.foods, 0 , " +
"(select sum(price) from ft_food f " + "(select sum(price) from ft_food f " +
"where FIND_IN_SET(f.food_id,d.foods)) as price, d.open_flag, 0, d.nutrition_food_id from ft_food_demand d " + "where FIND_IN_SET(f.food_id,d.foods)) as price, d.open_flag, 0, d.nutrition_food_id from ft_food_demand d " +
"LEFT JOIN ft_patient p on p.patient_id = d.patient_id and p.off_flag = 0") "LEFT JOIN ft_patient p on p.patient_id = d.patient_id and p.off_flag = 0")

View File

@ -56,5 +56,5 @@ public interface FtReportMealsDaoMapper extends BaseMapper<FtReportMealsDao> {
ReportMealsPriceEntity sumAllTotalPrice(@Param("patientId") Long patientId); 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 // 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); List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao);
} }

View File

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

View File

@ -142,7 +142,7 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl<FtReportMealsDaoMap
} }
@Override @Override
public List<FtReportMealVo> listPatientReportMeals(FtReportMealVo ftReportMealsDao) { public List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao) {
return this.baseMapper.listPatientReportMeals(ftReportMealsDao); return this.baseMapper.listPatientReportMeals(ftReportMealsDao);
} }
} }

View File

@ -1,5 +1,6 @@
package com.ruoyi.system.fantang.vo; package com.ruoyi.system.fantang.vo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.domain.FtReportMealsDao;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -15,7 +16,7 @@ import lombok.experimental.Accessors;
*/ */
@Data @Data
@ToString @ToString
@EqualsAndHashCode @EqualsAndHashCode(callSuper = false)
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class FtReportMealVo extends FtReportMealsDao { public class FtReportMealVo extends FtReportMealsDao {
@ -31,6 +32,7 @@ public class FtReportMealVo extends FtReportMealsDao {
private String bedId; private String bedId;
@Excel(name = "部门名称")
private String departName; private String departName;
private String hospitalId; private String hospitalId;

View File

@ -260,42 +260,42 @@ export default {
return '晚餐'; return '晚餐';
if (row.type === 4) if (row.type === 4)
return '加餐'; return '加餐';
}, },
formatToRice(row) { formatToRice(row) {
if(row.rice) if (row.rice)
return '加饭'; return '加饭';
else else
return '-'; return '-';
}, },
formatToMeat(row) { formatToMeat(row) {
if(row.meat) if (row.meat)
return '加肉'; return '加肉';
else else
return '-'; return '-';
}, },
formatToVegetables(row) { formatToVegetables(row) {
if(row.vegetables) if (row.vegetables)
return '加菜'; return '加菜';
else else
return '-'; return '-';
}, },
formatToEgg(row) { formatToEgg(row) {
if(row.egg) if (row.egg)
return row.egg; return row.egg;
else else
return '-'; return '-';
}, },
formatToOpenFlag(row) { formatToOpenFlag(row) {
if(row.openFlag) if (row.openFlag)
return '是'; return '是';
else else
return '-'; return '-';
}, },
formatToReplace(row) { formatToReplace(row) {
if (row.openFlag) { if (row.openFlag) {
if(row.isReplaceFood) if (row.isReplaceFood)
return '替'; return '替';
else else
return '加'; return '加';
@ -318,7 +318,7 @@ export default {
}, },
formatToNutritionFoodFlag(row) { formatToNutritionFoodFlag(row) {
if (row.openFlag) { if (row.openFlag) {
if(row.nutritionFoodFlag) if (row.nutritionFoodFlag)
return '报'; return '报';
else else
return '停'; return '停';