From 629e81c177dcb0b72f3188ee60cc71b559b50812 Mon Sep 17 00:00:00 2001 From: ryoeiken <754264374@qq.com> Date: Mon, 4 Jan 2021 14:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=EF=BC=8C=E5=9B=9E=E6=AC=BE=E7=99=BB=E8=AE=B0=20CRUD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FtInvoiceDaoController.java | 115 ++++-- .../controller/FtReturnDaoController.java | 100 +++++ .../controller/FtSettlementDaoController.java | 92 +++-- .../system/fantang/domain/FtInvoiceDao.java | 22 +- .../system/fantang/domain/FtReturnDao.java | 72 ++++ .../fantang/domain/FtSettlementDao.java | 65 +++- .../fantang/mapper/FtReturnDaoMapper.java | 14 + .../fantang/mapper/FtSettlementDaoMapper.java | 3 + .../fantang/service/IFtReturnDaoService.java | 19 + .../service/IFtSettlementDaoService.java | 3 + .../service/impl/FtReturnDaoServiceImpl.java | 50 +++ .../impl/FtSettlementDaoServiceImpl.java | 10 +- .../mapper/fantang/FtInvoiceDaoMapper.xml | 28 +- .../mapper/fantang/FtReturnDaoMapper.xml | 19 + .../mapper/fantang/FtSettlementDaoMapper.xml | 39 +- ruoyi-ui/src/api/fantang/invoice.js | 61 +++ ruoyi-ui/src/api/fantang/invoiceReturn.js | 53 +++ .../src/views/fantang/invoiceReturn/index.vue | 353 ++++++++++++++++++ .../src/views/fantang/settlement/index.vue | 241 +++++++----- 19 files changed, 1122 insertions(+), 237 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReturnDaoMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReturnDaoService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReturnDaoServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/fantang/FtReturnDaoMapper.xml create mode 100644 ruoyi-ui/src/api/fantang/invoice.js create mode 100644 ruoyi-ui/src/api/fantang/invoiceReturn.js create mode 100644 ruoyi-ui/src/views/fantang/invoiceReturn/index.vue diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java index 7a213cc64..8340a6d47 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtInvoiceDaoController.java @@ -1,52 +1,49 @@ package com.ruoyi.system.fantang.controller; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; - -import java.util.List; -import java.util.Arrays; - import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ruoyi.common.utils.StringUtils; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.fantang.domain.FtInvoiceDao; -import com.ruoyi.system.fantang.service.IFtInvoiceDaoService; -import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.fantang.domain.FtInvoiceDao; +import com.ruoyi.system.fantang.domain.FtReturnDao; +import com.ruoyi.system.fantang.service.IFtInvoiceDaoService; +import com.ruoyi.system.fantang.service.IFtReturnDaoService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Date; +import java.util.List; /** * 财务收费开票Controller - * + * * @author ft * @date 2020-12-08 */ @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController -@RequestMapping("/fantang/invoice" ) +@RequestMapping("/fantang/invoice") public class FtInvoiceDaoController extends BaseController { private final IFtInvoiceDaoService iFtInvoiceDaoService; + + private final IFtReturnDaoService iFtReturnDaoService; /** * 查询财务收费开票列表 */ @PreAuthorize("@ss.hasPermi('fantang:invoice:list')") @GetMapping("/list") - public TableDataInfo list(FtInvoiceDao ftInvoiceDao) - { + public TableDataInfo list(FtInvoiceDao ftInvoiceDao) { startPage(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftInvoiceDao); List list = iFtInvoiceDaoService.list(lqw); @@ -56,30 +53,30 @@ public class FtInvoiceDaoController extends BaseController { /** * 导出财务收费开票列表 */ - @PreAuthorize("@ss.hasPermi('fantang:invoice:export')" ) - @Log(title = "财务收费开票" , businessType = BusinessType.EXPORT) - @GetMapping("/export" ) + @PreAuthorize("@ss.hasPermi('fantang:invoice:export')") + @Log(title = "财务收费开票", businessType = BusinessType.EXPORT) + @GetMapping("/export") public AjaxResult export(FtInvoiceDao ftInvoiceDao) { LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftInvoiceDao); List list = iFtInvoiceDaoService.list(lqw); - ExcelUtil util = new ExcelUtil(FtInvoiceDao. class); - return util.exportExcel(list, "invoice" ); + ExcelUtil util = new ExcelUtil(FtInvoiceDao.class); + return util.exportExcel(list, "invoice"); } /** * 获取财务收费开票详细信息 */ - @PreAuthorize("@ss.hasPermi('fantang:invoice:query')" ) - @GetMapping(value = "/{id}" ) - public AjaxResult getInfo(@PathVariable("id" ) Long id) { + @PreAuthorize("@ss.hasPermi('fantang:invoice:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(iFtInvoiceDaoService.getById(id)); } /** * 新增财务收费开票 */ - @PreAuthorize("@ss.hasPermi('fantang:invoice:add')" ) - @Log(title = "财务收费开票" , businessType = BusinessType.INSERT) + @PreAuthorize("@ss.hasPermi('fantang:invoice:add')") + @Log(title = "财务收费开票", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody FtInvoiceDao ftInvoiceDao) { return toAjax(iFtInvoiceDaoService.save(ftInvoiceDao) ? 1 : 0); @@ -88,8 +85,8 @@ public class FtInvoiceDaoController extends BaseController { /** * 修改财务收费开票 */ - @PreAuthorize("@ss.hasPermi('fantang:invoice:edit')" ) - @Log(title = "财务收费开票" , businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('fantang:invoice:edit')") + @Log(title = "财务收费开票", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody FtInvoiceDao ftInvoiceDao) { return toAjax(iFtInvoiceDaoService.updateById(ftInvoiceDao) ? 1 : 0); @@ -98,10 +95,50 @@ public class FtInvoiceDaoController extends BaseController { /** * 删除财务收费开票 */ - @PreAuthorize("@ss.hasPermi('fantang:invoice:remove')" ) - @Log(title = "财务收费开票" , businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}" ) + @PreAuthorize("@ss.hasPermi('fantang:invoice:remove')") + @Log(title = "财务收费开票", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(iFtInvoiceDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0); } + + @PostMapping("/addToInvoice") + public AjaxResult addToInvoice(@RequestBody JSONObject params) { + System.out.println(params); + + // 应收 + BigDecimal payable = params.getBigDecimal("payable"); + // 实收 + BigDecimal receipts = params.getBigDecimal("receipts"); + // 收款方式 + String type = params.getString("type"); + // 发票号 + String invoiceNum = params.getString("invoiceNum"); + // 发票名 + String invoiceName = params.getString("invoiceName"); + // 税号 + String taxId = params.getString("taxId"); + // 开票类型 + Integer invoiceType = params.getInteger("invoiceType"); + + FtInvoiceDao invoiceDao = new FtInvoiceDao(); + Date today = new Date(); + invoiceDao.setCreateAt(today); + invoiceDao.setPayable(payable); + invoiceDao.setReceipts(receipts); + invoiceDao.setCollectionType(type); + invoiceDao.setInvoiceNum(invoiceNum); + invoiceDao.setInvoiceName(invoiceName); + invoiceDao.setTaxId(taxId); + invoiceDao.setInvoiceType(invoiceType); + iFtInvoiceDaoService.save(invoiceDao); + + if (invoiceType == 2) { + FtReturnDao ftReturnDao = new FtReturnDao(); + ftReturnDao.setInvoiceId(invoiceDao.getId()); + iFtReturnDaoService.save(ftReturnDao); + } + + return AjaxResult.success("已开票"); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java new file mode 100644 index 000000000..e696f5942 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtReturnDaoController.java @@ -0,0 +1,100 @@ +package com.ruoyi.system.fantang.controller; + +import java.util.List; +import java.util.Arrays; + +import lombok.RequiredArgsConstructor; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.fantang.domain.FtReturnDao; +import com.ruoyi.system.fantang.service.IFtReturnDaoService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 回款登记Controller + * + * @author ft + * @date 2021-01-04 + */ +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/fantang/invoiceReturn" ) +public class FtReturnDaoController extends BaseController { + + private final IFtReturnDaoService iFtReturnDaoService; + + /** + * 查询回款登记列表 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:list')") + @GetMapping("/list") + public TableDataInfo list(FtReturnDao ftReturnDao) { + startPage(); + List list = iFtReturnDaoService.queryList(ftReturnDao); + return getDataTable(list); + } + + /** + * 导出回款登记列表 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:export')" ) + @Log(title = "回款登记" , businessType = BusinessType.EXPORT) + @GetMapping("/export" ) + public AjaxResult export(FtReturnDao ftReturnDao) { + List list = iFtReturnDaoService.queryList(ftReturnDao); + ExcelUtil util = new ExcelUtil(FtReturnDao.class); + return util.exportExcel(list, "invoiceReturn" ); + } + + /** + * 获取回款登记详细信息 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:query')" ) + @GetMapping(value = "/{id}" ) + public AjaxResult getInfo(@PathVariable("id" ) Long id) { + return AjaxResult.success(iFtReturnDaoService.getById(id)); + } + + /** + * 新增回款登记 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:add')" ) + @Log(title = "回款登记" , businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody FtReturnDao ftReturnDao) { + return toAjax(iFtReturnDaoService.save(ftReturnDao) ? 1 : 0); + } + + /** + * 修改回款登记 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:edit')" ) + @Log(title = "回款登记" , businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody FtReturnDao ftReturnDao) { + return toAjax(iFtReturnDaoService.updateById(ftReturnDao) ? 1 : 0); + } + + /** + * 删除回款登记 + */ + @PreAuthorize("@ss.hasPermi('fantang:invoiceReturn:remove')" ) + @Log(title = "回款登记" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}" ) + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(iFtReturnDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java index 881f7a3d4..cb7dda99c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java @@ -2,40 +2,32 @@ package com.ruoyi.system.fantang.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; - -import java.util.List; -import java.util.Arrays; - -import com.ruoyi.common.utils.StringUtils; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; 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.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.fantang.domain.FtSettlementDao; import com.ruoyi.system.fantang.service.IFtSettlementDaoService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; /** * 结算管理Controller - * + * * @author ft * @date 2020-12-25 */ @RequiredArgsConstructor(onConstructor_ = @Autowired) @RestController -@RequestMapping("/fantang/settlement" ) +@RequestMapping("/fantang/settlement") public class FtSettlementDaoController extends BaseController { private final IFtSettlementDaoService iFtSettlementDaoService; @@ -45,59 +37,59 @@ public class FtSettlementDaoController extends BaseController { */ @PreAuthorize("@ss.hasPermi('fantang:settlement:list')") @GetMapping("/list") - public TableDataInfo list(FtSettlementDao ftSettlementDao) - { + public TableDataInfo list(FtSettlementDao ftSettlementDao) { startPage(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftSettlementDao); - if (ftSettlementDao.getSettleAt() != null){ - lqw.eq(FtSettlementDao::getSettleAt ,ftSettlementDao.getSettleAt()); + if (ftSettlementDao.getSettleAt() != null) { + lqw.eq(FtSettlementDao::getSettleAt, ftSettlementDao.getSettleAt()); } - if (ftSettlementDao.getPrice() != null){ - lqw.eq(FtSettlementDao::getPrice ,ftSettlementDao.getPrice()); + if (ftSettlementDao.getPrice() != null) { + lqw.eq(FtSettlementDao::getPrice, ftSettlementDao.getPrice()); } - if (ftSettlementDao.getPayable() != null){ - lqw.eq(FtSettlementDao::getPayable ,ftSettlementDao.getPayable()); + if (ftSettlementDao.getPayable() != null) { + lqw.eq(FtSettlementDao::getPayable, ftSettlementDao.getPayable()); } - if (ftSettlementDao.getReceipts() != null){ - lqw.eq(FtSettlementDao::getReceipts ,ftSettlementDao.getReceipts()); + if (ftSettlementDao.getReceipts() != null) { + lqw.eq(FtSettlementDao::getReceipts, ftSettlementDao.getReceipts()); } - if (StringUtils.isNotBlank(ftSettlementDao.getType())){ - lqw.eq(FtSettlementDao::getType ,ftSettlementDao.getType()); + if (StringUtils.isNotBlank(ftSettlementDao.getType())) { + lqw.eq(FtSettlementDao::getType, ftSettlementDao.getType()); } - if (ftSettlementDao.getRefund() != null){ - lqw.eq(FtSettlementDao::getRefund ,ftSettlementDao.getRefund()); + if (ftSettlementDao.getRefund() != null) { + lqw.eq(FtSettlementDao::getRefund, ftSettlementDao.getRefund()); } - List list = iFtSettlementDaoService.list(lqw); +// List list = iFtSettlementDaoService.list(lqw); + List list = iFtSettlementDaoService.listWithPatient(ftSettlementDao); return getDataTable(list); } /** * 导出结算管理列表 */ - @PreAuthorize("@ss.hasPermi('fantang:settlement:export')" ) - @Log(title = "结算管理" , businessType = BusinessType.EXPORT) - @GetMapping("/export" ) + @PreAuthorize("@ss.hasPermi('fantang:settlement:export')") + @Log(title = "结算管理", businessType = BusinessType.EXPORT) + @GetMapping("/export") public AjaxResult export(FtSettlementDao ftSettlementDao) { LambdaQueryWrapper lqw = new LambdaQueryWrapper(ftSettlementDao); List list = iFtSettlementDaoService.list(lqw); - ExcelUtil util = new ExcelUtil(FtSettlementDao. class); - return util.exportExcel(list, "settlement" ); + ExcelUtil util = new ExcelUtil(FtSettlementDao.class); + return util.exportExcel(list, "settlement"); } /** * 获取结算管理详细信息 */ - @PreAuthorize("@ss.hasPermi('fantang:settlement:query')" ) - @GetMapping(value = "/{settleId}" ) - public AjaxResult getInfo(@PathVariable("settleId" ) Long settleId) { + @PreAuthorize("@ss.hasPermi('fantang:settlement:query')") + @GetMapping(value = "/{settleId}") + public AjaxResult getInfo(@PathVariable("settleId") Long settleId) { return AjaxResult.success(iFtSettlementDaoService.getById(settleId)); } /** * 新增结算管理 */ - @PreAuthorize("@ss.hasPermi('fantang:settlement:add')" ) - @Log(title = "结算管理" , businessType = BusinessType.INSERT) + @PreAuthorize("@ss.hasPermi('fantang:settlement:add')") + @Log(title = "结算管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody FtSettlementDao ftSettlementDao) { return toAjax(iFtSettlementDaoService.save(ftSettlementDao) ? 1 : 0); @@ -106,8 +98,8 @@ public class FtSettlementDaoController extends BaseController { /** * 修改结算管理 */ - @PreAuthorize("@ss.hasPermi('fantang:settlement:edit')" ) - @Log(title = "结算管理" , businessType = BusinessType.UPDATE) + @PreAuthorize("@ss.hasPermi('fantang:settlement:edit')") + @Log(title = "结算管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody FtSettlementDao ftSettlementDao) { return toAjax(iFtSettlementDaoService.updateById(ftSettlementDao) ? 1 : 0); @@ -116,9 +108,9 @@ public class FtSettlementDaoController extends BaseController { /** * 删除结算管理 */ - @PreAuthorize("@ss.hasPermi('fantang:settlement:remove')" ) - @Log(title = "结算管理" , businessType = BusinessType.DELETE) - @DeleteMapping("/{settleIds}" ) + @PreAuthorize("@ss.hasPermi('fantang:settlement:remove')") + @Log(title = "结算管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{settleIds}") public AjaxResult remove(@PathVariable Long[] settleIds) { return toAjax(iFtSettlementDaoService.removeByIds(Arrays.asList(settleIds)) ? 1 : 0); } 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 b9b833e4a..499fb9957 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 @@ -49,7 +49,7 @@ private static final long serialVersionUID=1L; private String drawer; /** 收款方式 */ - private Integer collectionType; + private String collectionType; /** 应收 */ private BigDecimal payable; @@ -59,4 +59,24 @@ private static final long serialVersionUID=1L; /** 凭证列表 */ private String voucherList; + + /** + * 发票号 + */ + private String invoiceNum; + + /** + * 发票名 + */ + private String invoiceName; + + /** + * 税号 + */ + private String taxId; + + /** + * 开票类型 + */ + private Integer invoiceType; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java new file mode 100644 index 000000000..ae4bdf680 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtReturnDao.java @@ -0,0 +1,72 @@ +package com.ruoyi.system.fantang.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; +import java.math.BigDecimal; + +/** + * 回款登记对象 ft_return + * + * @author ft + * @date 2021-01-04 + */ +@Data +@ToString +@EqualsAndHashCode +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ft_return") +public class FtReturnDao implements Serializable { + +private static final long serialVersionUID=1L; + + + /** id */ + @TableId(value = "id") + private Long id; + + /** 对应发票id */ + @Excel(name = "对应发票id") + private Long invoiceId; + + /** 回款日期 */ + @Excel(name = "回款日期" , width = 30, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date returnAt; + + /** 回款金额 */ + @Excel(name = "回款金额") + private BigDecimal returnPrice; + + /** 余额 */ + @Excel(name = "余额") + private BigDecimal balancePrice; + + /** 操作员 */ + @Excel(name = "操作员") + private String opera; + + /** 凭证的图片url */ + @Excel(name = "凭证的图片url") + private String voucherUrl; + + /** 是否完成回款标志 */ + @Excel(name = "是否完成回款标志") + private Integer returnFlag; + + @TableField(exist = false) + private Map params = new HashMap<>(); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java index d013a726e..d3823a84f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java @@ -1,23 +1,23 @@ package com.ruoyi.system.fantang.domain; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import lombok.ToString; import lombok.experimental.Accessors; -import com.ruoyi.common.annotation.Excel; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; + import java.io.Serializable; -import java.util.Date; import java.math.BigDecimal; -import com.ruoyi.common.core.domain.BaseEntity; +import java.util.Date; /** * 结算管理对象 ft_settle - * + * * @author ft * @date 2020-12-25 */ @@ -29,48 +29,73 @@ import com.ruoyi.common.core.domain.BaseEntity; @TableName("ft_settle") public class FtSettlementDao implements Serializable { -private static final long serialVersionUID=1L; + private static final long serialVersionUID = 1L; - /** 结算 id */ + /** + * 结算 id + */ @TableId(value = "settle_id") private Long settleId; - /** 病人 id */ + /** + * 病人 id + */ private Long patientId; - /** 结算日期 */ - @Excel(name = "结算日期" , width = 30, dateFormat = "yyyy-MM-dd") + /** + * 结算日期 + */ + @Excel(name = "结算日期", width = 30, dateFormat = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date settleAt; - /** 操作员 */ + /** + * 操作员 + */ private String opera; - /** 记录清单 */ + /** + * 记录清单 + */ @Excel(name = "记录清单") private String list; - /** 结算总价 */ + /** + * 结算总价 + */ @Excel(name = "结算总价") private BigDecimal price; - /** 应收 */ + /** + * 应收 + */ @Excel(name = "应收") private BigDecimal payable; - /** 实收 */ + /** + * 实收 + */ @Excel(name = "实收") private BigDecimal receipts; - /** 结算类型 */ + /** + * 结算类型 + */ @Excel(name = "结算类型") private String type; - /** 退押金标志 */ + /** + * 退押金标志 + */ private Integer flag; - /** 退款总额 */ + /** + * 退款总额 + */ @Excel(name = "退款总额") private BigDecimal refund; + + @TableField(exist = false) + private String name; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReturnDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReturnDaoMapper.java new file mode 100644 index 000000000..f18802eae --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtReturnDaoMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.fantang.mapper; + +import com.ruoyi.system.fantang.domain.FtReturnDao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 回款登记Mapper接口 + * + * @author ft + * @date 2021-01-04 + */ +public interface FtReturnDaoMapper extends BaseMapper { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSettlementDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSettlementDaoMapper.java index 78cabaa48..a4dc500da 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSettlementDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSettlementDaoMapper.java @@ -3,6 +3,8 @@ package com.ruoyi.system.fantang.mapper; import com.ruoyi.system.fantang.domain.FtSettlementDao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import java.util.List; + /** * 结算管理Mapper接口 * @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface FtSettlementDaoMapper extends BaseMapper { + List listWithPatient(FtSettlementDao ftSettlementDao); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReturnDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReturnDaoService.java new file mode 100644 index 000000000..b1a757b7c --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtReturnDaoService.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.fantang.service; + +import com.ruoyi.system.fantang.domain.FtReturnDao; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * 回款登记Service接口 + * + * @author ft + * @date 2021-01-04 + */ +public interface IFtReturnDaoService extends IService { + + /** + * 查询列表 + */ + List queryList(FtReturnDao ftReturnDao); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtSettlementDaoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtSettlementDaoService.java index 86fce30e7..ba7f17476 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtSettlementDaoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtSettlementDaoService.java @@ -3,6 +3,8 @@ package com.ruoyi.system.fantang.service; import com.ruoyi.system.fantang.domain.FtSettlementDao; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * 结算管理Service接口 * @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IFtSettlementDaoService extends IService { + List listWithPatient(FtSettlementDao ftSettlementDao); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReturnDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReturnDaoServiceImpl.java new file mode 100644 index 000000000..65575c1c3 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtReturnDaoServiceImpl.java @@ -0,0 +1,50 @@ +package com.ruoyi.system.fantang.service.impl; + +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.apache.commons.lang3.StringUtils; +import com.ruoyi.system.fantang.mapper.FtReturnDaoMapper; +import com.ruoyi.system.fantang.domain.FtReturnDao; +import com.ruoyi.system.fantang.service.IFtReturnDaoService; + +import java.util.List; +import java.util.Map; + +/** + * 回款登记Service业务层处理 + * + * @author ft + * @date 2021-01-04 + */ +@Service +public class FtReturnDaoServiceImpl extends ServiceImpl implements IFtReturnDaoService { + + @Override + public List queryList(FtReturnDao ftReturnDao) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + if (ftReturnDao.getInvoiceId() != null){ + lqw.eq(FtReturnDao::getInvoiceId ,ftReturnDao.getInvoiceId()); + } + if (ftReturnDao.getReturnAt() != null){ + lqw.eq(FtReturnDao::getReturnAt ,ftReturnDao.getReturnAt()); + } + if (ftReturnDao.getReturnPrice() != null){ + lqw.eq(FtReturnDao::getReturnPrice ,ftReturnDao.getReturnPrice()); + } + if (ftReturnDao.getBalancePrice() != null){ + lqw.eq(FtReturnDao::getBalancePrice ,ftReturnDao.getBalancePrice()); + } + if (StringUtils.isNotBlank(ftReturnDao.getOpera())){ + lqw.eq(FtReturnDao::getOpera ,ftReturnDao.getOpera()); + } + if (StringUtils.isNotBlank(ftReturnDao.getVoucherUrl())){ + lqw.eq(FtReturnDao::getVoucherUrl ,ftReturnDao.getVoucherUrl()); + } + if (ftReturnDao.getReturnFlag() != null){ + lqw.eq(FtReturnDao::getReturnFlag ,ftReturnDao.getReturnFlag()); + } + return this.list(lqw); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtSettlementDaoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtSettlementDaoServiceImpl.java index 0cc879420..5733ff0b9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtSettlementDaoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtSettlementDaoServiceImpl.java @@ -1,10 +1,12 @@ package com.ruoyi.system.fantang.service.impl; -import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ruoyi.system.fantang.mapper.FtSettlementDaoMapper; import com.ruoyi.system.fantang.domain.FtSettlementDao; +import com.ruoyi.system.fantang.mapper.FtSettlementDaoMapper; import com.ruoyi.system.fantang.service.IFtSettlementDaoService; +import org.springframework.stereotype.Service; + +import java.util.List; /** * 结算管理Service业务层处理 @@ -15,4 +17,8 @@ import com.ruoyi.system.fantang.service.IFtSettlementDaoService; @Service public class FtSettlementDaoServiceImpl extends ServiceImpl implements IFtSettlementDaoService { + @Override + public List listWithPatient(FtSettlementDao ftSettlementDao) { + return this.baseMapper.listWithPatient(ftSettlementDao); + } } diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtInvoiceDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtInvoiceDaoMapper.xml index fdc38d089..d0333be41 100644 --- a/ruoyi-system/src/main/resources/mapper/fantang/FtInvoiceDaoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtInvoiceDaoMapper.xml @@ -1,19 +1,23 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - + + + + + + + + + + + + + diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtReturnDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtReturnDaoMapper.xml new file mode 100644 index 000000000..551becd40 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtReturnDaoMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml index 23f30745a..8cb99005b 100644 --- a/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml @@ -1,22 +1,33 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/fantang/invoice.js b/ruoyi-ui/src/api/fantang/invoice.js new file mode 100644 index 000000000..0803085dd --- /dev/null +++ b/ruoyi-ui/src/api/fantang/invoice.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' + +// 查询财务收费开票列表 +export function listInvoice(query) { + return request({ + url: '/fantang/invoice/list', + method: 'get', + params: query + }) +} + +// 查询财务收费开票详细 +export function getInvoice(id) { + return request({ + url: '/fantang/invoice/' + id, + method: 'get' + }) +} + +// 新增财务收费开票 +export function addInvoice(data) { + return request({ + url: '/fantang/invoice', + method: 'post', + data: data + }) +} + +// 修改财务收费开票 +export function updateInvoice(data) { + return request({ + url: '/fantang/invoice', + method: 'put', + data: data + }) +} + +// 删除财务收费开票 +export function delInvoice(id) { + return request({ + url: '/fantang/invoice/' + id, + method: 'delete' + }) +} + +// 导出财务收费开票 +export function exportInvoice(query) { + return request({ + url: '/fantang/invoice/export', + method: 'get', + params: query + }) +} + +export function addToInvoice(data) { + return request({ + url: '/fantang/invoice/addToInvoice', + method: 'post', + data: data + }) +} diff --git a/ruoyi-ui/src/api/fantang/invoiceReturn.js b/ruoyi-ui/src/api/fantang/invoiceReturn.js new file mode 100644 index 000000000..94d8879bd --- /dev/null +++ b/ruoyi-ui/src/api/fantang/invoiceReturn.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询回款登记列表 +export function listInvoiceReturn(query) { + return request({ + url: '/fantang/invoiceReturn/list', + method: 'get', + params: query + }) +} + +// 查询回款登记详细 +export function getInvoiceReturn(id) { + return request({ + url: '/fantang/invoiceReturn/' + id, + method: 'get' + }) +} + +// 新增回款登记 +export function addInvoiceReturn(data) { + return request({ + url: '/fantang/invoiceReturn', + method: 'post', + data: data + }) +} + +// 修改回款登记 +export function updateInvoiceReturn(data) { + return request({ + url: '/fantang/invoiceReturn', + method: 'put', + data: data + }) +} + +// 删除回款登记 +export function delInvoiceReturn(id) { + return request({ + url: '/fantang/invoiceReturn/' + id, + method: 'delete' + }) +} + +// 导出回款登记 +export function exportInvoiceReturn(query) { + return request({ + url: '/fantang/invoiceReturn/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue b/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue new file mode 100644 index 000000000..6b0e39a7c --- /dev/null +++ b/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue @@ -0,0 +1,353 @@ + + + diff --git a/ruoyi-ui/src/views/fantang/settlement/index.vue b/ruoyi-ui/src/views/fantang/settlement/index.vue index 9d6c355b2..a35b58971 100644 --- a/ruoyi-ui/src/views/fantang/settlement/index.vue +++ b/ruoyi-ui/src/views/fantang/settlement/index.vue @@ -3,44 +3,44 @@ + v-model="queryParams.settleAt" + type="date" + value-format="yyyy-MM-dd" + placeholder="选择结算日期"> - - - - - - + + + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + 搜索 重置 @@ -48,15 +48,16 @@ - - 新增 - + + + + + + + + + + 修改 + >开票 + 删除 + >删除 + 导出 + >导出 + - + - + + + + + - - - - - - @@ -134,26 +138,51 @@ - - - - - - + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + +