diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java index 8e4c05057..2be16f083 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettleDaoController.java @@ -75,7 +75,27 @@ public class FtSettleDaoController extends BaseController { ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumTotalPrice(patientId, lastBillingDate, selectBillingDate); - Map data = new HashMap<>(); + Map data = new HashMap<>(2); + data.put("reportMealsList", reportMealsList); + data.put("reportMealsPrice", reportMealsPrice); + + return AjaxResult.success(data); + } + + @GetMapping("/showAllMealsWithNoPay/{patientId}") + public AjaxResult showAllMealsWithNoPay(@PathVariable Long patientId) { + + // 查找该病人所有已用餐未结算记录 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("patient_id", patientId); + wrapper.eq("dining_flag",0); + wrapper.eq("settlement_flag",0); + + List reportMealsList = iFtReportMealsDaoService.list(wrapper); + + ReportMealsPriceEntity reportMealsPrice = iFtReportMealsDaoService.sumAllTotalPrice(patientId); + + Map data = new HashMap<>(2); data.put("reportMealsList", reportMealsList); data.put("reportMealsPrice", reportMealsPrice); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java index 499fb9957..038c9b913 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtInvoiceDao.java @@ -79,4 +79,9 @@ private static final long serialVersionUID=1L; * 开票类型 */ private Integer invoiceType; + + /** + * 开票金额 + */ + private BigDecimal invoiceAmount; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java index e6cdce086..114795bfd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettleDao.java @@ -106,4 +106,14 @@ public class FtSettleDao implements Serializable { @TableField(exist = false) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date selectBillingDate; + + /** + * 开票标志 + */ + private Boolean invoiceFlag; + + /** + * 发票 id + */ + private Long invoiceId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java index 73287baf0..9c435761b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReportMealsDaoMapper.java @@ -4,7 +4,6 @@ import cn.hutool.core.date.DateTime; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtReportMealsDao; import com.ruoyi.system.fantang.entity.ReportMealsPriceEntity; -import com.ruoyi.system.fantang.vo.FtReportMealVo; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; @@ -44,11 +43,6 @@ public interface FtReportMealsDaoMapper extends BaseMapper { List listAllNutrition(FtReportMealsDao ftReportMealsDao); - @Select("SELECT a.type, a.foods, count(a.foods) as count, b.depart_id,c.depart_name\n" + - "from ft_report_meals a \n" + - "LEFT JOIN ft_patient b on a.patient_id = b.patient_id\n" + - "LEFT JOIN ft_depart c on b.depart_id = c.depart_id \n" + - "where b.depart_id = #{departId} and a.dining_at BETWEEN #{beginOfDay} and #{endOfDay}\n" + - "GROUP BY a.type, foods") - List getStatisticsFoods(@Param("departId") Integer departId, @Param("beginOfDay") DateTime beginOfDay, @Param("endOfDay") DateTime endOfDay); + @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(Long patientId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java index 5fc817a55..aa0f69f91 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReportMealsDaoService.java @@ -31,6 +31,8 @@ public interface IFtReportMealsDaoService extends IService { ReportMealsPriceEntity sumTotalPrice(Long patientId, Date lastBillingDate, Date selectBillingDate); + ReportMealsPriceEntity sumAllTotalPrice(Long patientId); + FtReportMealsDao getLastReportMeals(Long patientId); List listNutrition(FtReportMealsDao ftReportMealsDao); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java index f238d85cc..676ab7936 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReportMealsDaoServiceImpl.java @@ -73,6 +73,11 @@ public class FtReportMealsDaoServiceImpl extends ServiceImpl + diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtSettleDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtSettleDaoMapper.xml index a4e72692c..40cbf6a69 100644 --- a/ruoyi-system/src/main/resources/mapper/fantang/FtSettleDaoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtSettleDaoMapper.xml @@ -16,6 +16,8 @@ + + diff --git a/ruoyi-ui/src/api/fantang/settle.js b/ruoyi-ui/src/api/fantang/settle.js index 94654c315..e92ab45cf 100644 --- a/ruoyi-ui/src/api/fantang/settle.js +++ b/ruoyi-ui/src/api/fantang/settle.js @@ -14,6 +14,13 @@ export function getLastBillingDateByPatientId(patientId) { }) } +// 查看该病人所有已用餐未结算的记录 +export function showAllMealsWithNoPay(patientId) { + return request({ + url: '/fantang/settle/showAllMealsWithNoPay/' + patientId, + method: 'get' + }) +} // 查询结算报列表 diff --git a/ruoyi-ui/src/views/fantang/settle/index.vue b/ruoyi-ui/src/views/fantang/settle/index.vue index 30d7de11c..cabb9a7f1 100644 --- a/ruoyi-ui/src/views/fantang/settle/index.vue +++ b/ruoyi-ui/src/views/fantang/settle/index.vue @@ -3,11 +3,11 @@ @@ -17,21 +17,21 @@ size="small" @keyup.enter.native="handleQuery"> + v-for="item in departOptions" + :key="item.departName" + :label="item.departName" + :value="item.departId"> @@ -56,11 +56,11 @@ 导出 @@ -78,19 +78,19 @@ @@ -98,11 +98,11 @@ @@ -134,11 +134,11 @@ + v-model="formAddNewSettlement.lastBillingDate" + align="right" + type="date" + value-format="yyyy-MM-dd" + :disabled="true"> @@ -161,13 +161,13 @@ + v-model="formAddNewSettlement.selectBillingDate" + align="right" + type="date" + placeholder="选择日期" + value-format="yyyy-MM-dd" + @change="changeBillingDate" + :picker-options="pickerOptions"> @@ -175,10 +175,10 @@ + v-for="item in payTypeOptions" + :key="item.value" + :label="item.label" + :value="item.value"> @@ -246,11 +246,11 @@ + v-model="leaveForm.lastBillingDate" + align="right" + type="date" + value-format="yyyy-MM-dd" + :disabled="true"> @@ -298,7 +298,14 @@