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 new file mode 100644 index 000000000..881f7a3d4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtSettlementDaoController.java @@ -0,0 +1,125 @@ +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.enums.BusinessType; +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; + +/** + * 结算管理Controller + * + * @author ft + * @date 2020-12-25 + */ +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/fantang/settlement" ) +public class FtSettlementDaoController extends BaseController { + + private final IFtSettlementDaoService iFtSettlementDaoService; + + /** + * 查询结算管理列表 + */ + @PreAuthorize("@ss.hasPermi('fantang:settlement:list')") + @GetMapping("/list") + public TableDataInfo list(FtSettlementDao ftSettlementDao) + { + startPage(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(ftSettlementDao); + if (ftSettlementDao.getSettleAt() != null){ + lqw.eq(FtSettlementDao::getSettleAt ,ftSettlementDao.getSettleAt()); + } + if (ftSettlementDao.getPrice() != null){ + lqw.eq(FtSettlementDao::getPrice ,ftSettlementDao.getPrice()); + } + if (ftSettlementDao.getPayable() != null){ + lqw.eq(FtSettlementDao::getPayable ,ftSettlementDao.getPayable()); + } + if (ftSettlementDao.getReceipts() != null){ + lqw.eq(FtSettlementDao::getReceipts ,ftSettlementDao.getReceipts()); + } + if (StringUtils.isNotBlank(ftSettlementDao.getType())){ + lqw.eq(FtSettlementDao::getType ,ftSettlementDao.getType()); + } + if (ftSettlementDao.getRefund() != null){ + lqw.eq(FtSettlementDao::getRefund ,ftSettlementDao.getRefund()); + } + List list = iFtSettlementDaoService.list(lqw); + return getDataTable(list); + } + + /** + * 导出结算管理列表 + */ + @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" ); + } + + /** + * 获取结算管理详细信息 + */ + @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) + @PostMapping + public AjaxResult add(@RequestBody FtSettlementDao ftSettlementDao) { + return toAjax(iFtSettlementDaoService.save(ftSettlementDao) ? 1 : 0); + } + + /** + * 修改结算管理 + */ + @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); + } + + /** + * 删除结算管理 + */ + @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/controller/FtStaffInfoDaoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java index 8b8f9af28..b19a2f55b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/controller/FtStaffInfoDaoController.java @@ -136,7 +136,7 @@ public class FtStaffInfoDaoController extends BaseController { } // 判断密码是否为空 - if (ftStaffInfoDao.getPassword() == null) { + if (ftStaffInfoDao.getPassword() == null || ftStaffInfoDao.getPassword().equals("")) { ftStaffInfoDao.setPassword("123456"); } 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 new file mode 100644 index 000000000..d013a726e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/domain/FtSettlementDao.java @@ -0,0 +1,76 @@ +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 java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 结算管理对象 ft_settle + * + * @author ft + * @date 2020-12-25 + */ +@Data +@ToString +@EqualsAndHashCode +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ft_settle") +public class FtSettlementDao implements Serializable { + +private static final long serialVersionUID=1L; + + + /** 结算 id */ + @TableId(value = "settle_id") + private Long settleId; + + /** 病人 id */ + private Long patientId; + + /** 结算日期 */ + @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; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java index b1fb4d982..9688db1f1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtPatientDaoMapper.java @@ -39,6 +39,9 @@ public interface FtPatientDaoMapper extends BaseMapper { @Update("update ft_patient a inner join ft_sync b on a.hospital_id = b.hospital_id and a.sync_flag = 2 set a.depart_id = (select depart_id from ft_depart c where b.depart_name = c.depart_name )") public int updateDepartIDToNewPatient(); + @Update("update ft_patient a inner join ft_sync b on a.hospital_id = b.hospital_id and a.sync_flag = 2 set a.depart_id = (select depart_id from ft_depart c where b.depart_name = c.depart_name )") + public int updateDepartIDToPatient(); + @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") List syncConflictOnlyHospitalEqual(); 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 new file mode 100644 index 000000000..78cabaa48 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSettlementDaoMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.fantang.mapper; + +import com.ruoyi.system.fantang.domain.FtSettlementDao; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * 结算管理Mapper接口 + * + * @author ft + * @date 2020-12-25 + */ +public interface FtSettlementDaoMapper extends BaseMapper { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSyncPatientDaoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSyncPatientDaoMapper.java index bfd7078aa..76c572630 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSyncPatientDaoMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/mapper/FtSyncPatientDaoMapper.java @@ -2,8 +2,11 @@ package com.ruoyi.system.fantang.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ruoyi.system.fantang.domain.FtRemotePatientDao; +import org.apache.ibatis.annotations.Delete; import org.springframework.stereotype.Repository; @Repository public interface FtSyncPatientDaoMapper extends BaseMapper { + @Delete("truncate table ft_sync") + void clearAll(); } 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 new file mode 100644 index 000000000..86fce30e7 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/IFtSettlementDaoService.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.fantang.service; + +import com.ruoyi.system.fantang.domain.FtSettlementDao; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 结算管理Service接口 + * + * @author ft + * @date 2020-12-25 + */ +public interface IFtSettlementDaoService extends IService { + +} 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 new file mode 100644 index 000000000..0cc879420 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/fantang/service/impl/FtSettlementDaoServiceImpl.java @@ -0,0 +1,18 @@ +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.service.IFtSettlementDaoService; + +/** + * 结算管理Service业务层处理 + * + * @author ft + * @date 2020-12-25 + */ +@Service +public class FtSettlementDaoServiceImpl extends ServiceImpl implements IFtSettlementDaoService { + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SyncPatientServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SyncPatientServiceImpl.java index 7db404690..ed9ab6f41 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SyncPatientServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SyncPatientServiceImpl.java @@ -45,19 +45,25 @@ public class SyncPatientServiceImpl implements ISyncPatientService { @Transactional @Override public Integer insertToLocalSync(List remotePatientDaoList) { + System.out.println("开始同步................"); StringBuilder syncMessage = new StringBuilder(); syncMessage.append("同步信息:"); // 清空本地中间表数据,准备接收同步数据 - syncPatientDaoMapper.delete(null); + syncPatientDaoMapper.clearAll(); // 遍历数据源,逐条插入本地中间表 for (FtRemotePatientDao dao : remotePatientDaoList) { syncPatientDaoMapper.insert(dao); } + // 为记录填入对应的科室id + patientDaoMapper.updateDepartIDToNewPatient(); + + System.out.println("完成遍历数据源,逐条插入本地中间表.."); // 初始化本地病患表准备同步,将标志位置“0” int ret = patientDaoMapper.initForSync(); syncMessage.append(String.format("本地初始化记录:%d 条", ret)); + System.out.println("完成 初始化本地病患表准备同步,将标志位置“0”.."); // 自动同步:住院号相同,姓名,科室,床号相同 // 同步逻辑1:更新住院号、科室、床号、姓名全部相同的记录,并标注flag=1 diff --git a/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml b/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml new file mode 100644 index 000000000..23f30745a --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/fantang/FtSettlementDaoMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-ui/src/api/fantang/settlement.js b/ruoyi-ui/src/api/fantang/settlement.js new file mode 100644 index 000000000..436079f74 --- /dev/null +++ b/ruoyi-ui/src/api/fantang/settlement.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询结算管理列表 +export function listSettlement(query) { + return request({ + url: '/fantang/settlement/list', + method: 'get', + params: query + }) +} + +// 查询结算管理详细 +export function getSettlement(settleId) { + return request({ + url: '/fantang/settlement/' + settleId, + method: 'get' + }) +} + +// 新增结算管理 +export function addSettlement(data) { + return request({ + url: '/fantang/settlement', + method: 'post', + data: data + }) +} + +// 修改结算管理 +export function updateSettlement(data) { + return request({ + url: '/fantang/settlement', + method: 'put', + data: data + }) +} + +// 删除结算管理 +export function delSettlement(settleId) { + return request({ + url: '/fantang/settlement/' + settleId, + method: 'delete' + }) +} + +// 导出结算管理 +export function exportSettlement(query) { + return request({ + url: '/fantang/settlement/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/fantang/catering/index.vue b/ruoyi-ui/src/views/fantang/catering/index.vue index 69b11f18f..ff6747498 100644 --- a/ruoyi-ui/src/views/fantang/catering/index.vue +++ b/ruoyi-ui/src/views/fantang/catering/index.vue @@ -185,9 +185,9 @@ + - @@ -491,7 +491,7 @@ export default { this.departOptions = response.rows; }) listNutritionFood().then(response => { - console.log("yyc----",response) + console.log("yyc----", response) this.numberOptions = response.rows; }) }, diff --git a/ruoyi-ui/src/views/fantang/settlement/index.vue b/ruoyi-ui/src/views/fantang/settlement/index.vue new file mode 100644 index 000000000..9d6c355b2 --- /dev/null +++ b/ruoyi-ui/src/views/fantang/settlement/index.vue @@ -0,0 +1,345 @@ + + +