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

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)
@GetMapping("/export")
public AjaxResult export(FtReportMealsDao ftReportMealsDao) {
LambdaQueryWrapper<FtReportMealsDao> lqw = new LambdaQueryWrapper<FtReportMealsDao>(ftReportMealsDao);
List<FtReportMealsDao> list = iFtReportMealsDaoService.list(lqw);
ExcelUtil<FtReportMealsDao> util = new ExcelUtil<FtReportMealsDao>(FtReportMealsDao.class);
return util.exportExcel(list, "meals");
Date createAt = ftReportMealsDao.getCreateAt();
if (createAt != null) {
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")
public TableDataInfo listPatientReportMeals(FtReportMealVo ftReportMealsDao) {
public TableDataInfo listPatientReportMeals(FtReportMealsDao ftReportMealsDao) {
startPage();
Date createAt = ftReportMealsDao.getCreateAt();
@ -237,7 +244,7 @@ public class FtReportMealsDaoController extends BaseController {
ftReportMealsDao.setEndOfDay(createAt);
}
List<FtReportMealVo> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
List<FtReportMealsDao> list = iFtReportMealsDaoService.listPatientReportMeals(ftReportMealsDao);
return getDataTable(list);
}

View File

@ -38,6 +38,34 @@ public class FtReportMealsDao implements Serializable {
@TableId(value = "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;
/**
@ -59,19 +87,17 @@ public class FtReportMealsDao implements Serializable {
/**
* 报餐人
*/
@Excel(name = "报餐人")
private Long createBy;
/**
* 订单列表
*/
@Excel(name = "订单列表")
private String foods;
/**
* 正餐总价
*/
@Excel(name = "总价")
@Excel(name = "正餐总价")
private BigDecimal price;
/**
@ -86,36 +112,12 @@ public class FtReportMealsDao implements Serializable {
private String settlementBy;
/**
* 住院号
*/
@TableField(exist = false)
private String hospitalId;
/**
* 科室 id
*/
@TableField(exist = false)
private String departId;
/**
* 科室名
*/
@TableField(exist = false)
private String departName;
/**
* 床号
*/
@TableField(exist = false)
private String bedId;
/**
* 病人姓名
*/
@TableField(exist = false)
private String name;
/**
* 营养餐 id
*/
@ -134,11 +136,13 @@ public class FtReportMealsDao implements Serializable {
/**
* 营养配餐价格
*/
@Excel(name = "营养配餐价格")
private BigDecimal nutritionFoodPrice;
/**
* 当前报餐总价
*/
@Excel(name = "当餐总价")
private BigDecimal totalPrice;
private Boolean vegetables;
@ -166,9 +170,6 @@ public class FtReportMealsDao implements Serializable {
@TableField(exist = false)
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;
@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
// 根据病患配餐表生成次日报餐记录并通过ft_food 菜品价格计算菜单总价
@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) " +
"select date_add(now(), interval 1 day), d.type, d.patient_id , d.foods, 0 , date_add(now(), interval 1 day), " +
"(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 , " +
"(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 " +
"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);
// 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> listPatientReportMeals(FtReportMealVo ftReportMealsDao);
List<FtReportMealsDao> listPatientReportMeals(FtReportMealsDao ftReportMealsDao);
}

View File

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

View File

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