窗口收费

This commit is contained in:
ryoeiken 2020-12-29 16:18:20 +08:00
parent a5bdb5072a
commit 418c8b6657
5 changed files with 131 additions and 37 deletions

View File

@ -0,0 +1,35 @@
package com.ruoyi.system.fantang.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.fantang.service.IFtPatientDaoService;
import com.ruoyi.system.fantang.vo.FtPatientVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/client_api/patient")
public class ClientPatientController extends BaseController {
@Autowired
private IFtPatientDaoService iFtPatientDaoService;
@GetMapping("/getReportMealsToday/{patientId}")
public AjaxResult getReportMealsToday(@PathVariable("patientId") Long patientId) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String createAt = sdf.format(new Date());
FtPatientVo reportMealsToday = iFtPatientDaoService.getReportMealsToday("2020-12-29", patientId);
return AjaxResult.success(reportMealsToday);
}
}

View File

@ -108,17 +108,6 @@ public class FtSettleDaoController extends BaseController {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 根据病人 id 查询预付费记录
QueryWrapper<FtPrepaymentDao> prepaymentWrapper = new QueryWrapper<>();
prepaymentWrapper.eq("patient_id", patientId);
FtPrepaymentDao prepaymentDao = iFtPrepaymentDaoService.getOne(prepaymentWrapper);
// 预付费扣费
// BigDecimal prepaid = prepaymentDao.getPrepaid();
// BigDecimal balance = prepaid.subtract(netPeceipt);
// prepaymentDao.setPrepaid(balance);
// iFtPrepaymentDaoService.updateById(prepaymentDao);
// 添加结算记录
FtSettleDao ftSettleDao = new FtSettleDao();
ftSettleDao.setReceipts(netPeceipt);
@ -128,6 +117,34 @@ public class FtSettleDaoController extends BaseController {
ftSettleDao.setOpera(userName);
ftSettleDao.setPayable(sumTotalPrice);
ftSettleDao.setReceipts(netPeceipt);
//支付方式
switch (settlement.getPayType()) {
case 1:
ftSettleDao.setType("现金");
break;
case 2:
// 根据病人 id 查询预付费记录
QueryWrapper<FtPrepaymentDao> prepaymentWrapper = new QueryWrapper<>();
prepaymentWrapper.eq("patient_id", patientId);
FtPrepaymentDao prepaymentDao = iFtPrepaymentDaoService.getOne(prepaymentWrapper);
// 预付费扣费
BigDecimal prepaid = prepaymentDao.getPrepaid();
BigDecimal balance = prepaid.subtract(netPeceipt);
prepaymentDao.setPrepaid(balance);
iFtPrepaymentDaoService.updateById(prepaymentDao);
ftSettleDao.setType("预付款");
break;
case 3:
ftSettleDao.setType("在线支付");
break;
}
iFtSettleDaoService.save(ftSettleDao);
// 修改报餐信息

View File

@ -63,4 +63,7 @@ public class SettleEntity {
// 正餐和营养餐总价
private BigDecimal sumTotalPrice;
// 付款方式
private Integer payType;
}

View File

@ -1,9 +1,11 @@
package com.ruoyi.system.fantang.mapper;
import com.ruoyi.system.fantang.domain.FtPatientDao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.fantang.domain.FtPatientDao;
import com.ruoyi.system.fantang.vo.FtPatientVo;
import com.ruoyi.system.fantang.vo.ftSyncConflictVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
@ -48,4 +50,6 @@ public interface FtPatientDaoMapper extends BaseMapper<FtPatientDao> {
@Select("select a.hospital_id, a.name, a.depart_name, a.bed_id, b.depart_id, c.hospital_id as old_hospital_id, c.name as old_name, a.depart_name as old_depart_name, c.bed_id as old_bed_id, c.depart_id as old_depart_id, c.patient_id as patient_id from ft_sync a LEFT JOIN ft_depart b on a.depart_name = b.depart_name LEFT JOIN ft_patient c on a.hospital_id = c.hospital_id where b.depart_id = c.depart_id and a.bed_id = c.bed_id and a.name = c.name and c.hospital_id!=a.hospital_id")
List<ftSyncConflictVo> syncConflictOtherAllEqual();
FtPatientVo getReportMealsToday(@Param("createAt") String createAt, @Param("patientId") Long patientId);
}

View File

@ -212,17 +212,34 @@
<el-form-item label="已收预付伙食费" prop="prepayment">
<el-input v-model="formAddNewSettlement.prepayment" :disabled="true"/>
</el-form-item>
<el-form-item label="结算日期" prop="selectBillingDate">
<el-date-picker
v-model="formAddNewSettlement.selectBillingDate"
align="right"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
@change="changeBillingDate"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="结算日期" prop="selectBillingDate">
<el-date-picker
v-model="formAddNewSettlement.selectBillingDate"
align="right"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
@change="changeBillingDate"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="支付方式" prop="payType">
<el-select v-model="formAddNewSettlement.payType" placeholder="请选择支付方式">
<el-option
v-for="item in payTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="实收" prop="netPeceipt">
<el-input v-model="formAddNewSettlement.netPeceipt" placeholder="请输入实收"/>
</el-form-item>
@ -303,6 +320,16 @@ export default {
components: {},
data() {
return {
payTypeOptions: [{
value: 1,
label: '现金'
}, {
value: 2,
label: '预付款'
}, {
value: 3,
label: '在线支付'
}],
sumTotalPrice: 0,
dinnerTotalPrice: 0,
nutritionTotalPrice: 0,
@ -354,7 +381,6 @@ export default {
name: null,
departName: null,
bedId: null,
price: null,
receivable: null,
//
@ -372,6 +398,7 @@ export default {
//
selectBillingDate: null,
opera: null,
payType: null,
},
//
@ -438,7 +465,16 @@ export default {
],
refund: [
{required: true, message: "退款总额不能为空", trigger: "blur"}
]
],
selectBillingDate: [{
required: true, message: "结算日期不能为空", trigger: "blur"
}],
payType: [{
required: true, message: "支付方式不能为空", trigger: "blur"
}],
netPeceipt: [{
required: true, message: "实收不能为空", trigger: "blur"
}]
}
};
},
@ -456,7 +492,7 @@ export default {
var dateSpan, iDays;
let sDate1 = Date.parse(this.formAddNewSettlement.lastBillingDate);
let sDate2 = Date.parse(value);
console.log("selectBillingDate", this.formAddNewSettlement.selectBillingDate)
// console.log("selectBillingDate", this.formAddNewSettlement.selectBillingDate)
dateSpan = sDate2 - sDate1;
if (dateSpan < 0) {
@ -488,14 +524,14 @@ export default {
this.userName = response.data.userName;
this.roleGroup = response.roleGroup;
this.postGroup = response.postGroup;
console.log(this.userName);
// console.log(this.userName);
});
},
//
clickAddNewSettlement(row) {
getLastSettlementDate(row.patientId).then(response => {
console.log("getLastBillingDateByPatientId-->", response);
// console.log("getLastBillingDateByPatientId-->", response);
if (response.data.settlementAt === null) {
this.lastBillFlag = false;
this.formAddNewSettlement.lastBillingDate = response.data.lastCreateDate;
@ -508,7 +544,7 @@ export default {
});
getPrepaymentByPatientId(row.patientId).then(response => {
console.log("row-->", response);
// console.log("row-->", response);
this.flagAddNewSettlementOpen = true;
this.flagAddPrepaymentShow = false;
this.formAddNewSettlement.hospitalId = row.hospitalId;
@ -532,7 +568,7 @@ export default {
//
selectSettlementFlag(value) {
console.log("value", value)
// console.log("value", value)
if (value === null) {
this.loading = true;
listAll(this.queryParams).then(response => {
@ -624,8 +660,8 @@ export default {
},
/** 提交按钮 */
submitForm() {
// this.$refs["formAddNewSettlement"].validate(valid => {
// if (valid) {
this.$refs["formAddNewSettlement"].validate(valid => {
if (valid) {
// if (this.form.settleId != null) {
// updateSettle(this.form).then(response => {
// this.msgSuccess("");
@ -633,7 +669,6 @@ export default {
// this.getList();
// });
// } else {
console.log(this.formAddNewSettlement);
this.formAddNewSettlement.opera = this.userName;
this.formAddNewSettlement.dinnerTotalPrice = this.dinnerTotalPrice;
this.formAddNewSettlement.nutritionTotalPrice = this.nutritionTotalPrice;
@ -645,12 +680,12 @@ export default {
this.flagAddNewSettlementOpen = false;
this.getList();
});
}else {
this.msgError("预付费余额不足");
} else {
this.msgError("预付费余额不足");
}
// }
// }
// });
}
});
},
/** 删除按钮操作 */
handleDelete(row) {