人员管理,财务管理-补贴管理
This commit is contained in:
parent
7cdb38b7c9
commit
a35a2ff6f2
@ -2,6 +2,7 @@ package com.ruoyi.system.fantang.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -91,6 +92,9 @@ public class FtPatientDaoController extends BaseController {
|
||||
@Log(title = "病人管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtPatientDao ftPatientDao) {
|
||||
|
||||
ftPatientDao.setCreateAt(new Date());
|
||||
|
||||
return toAjax(iFtPatientDaoService.save(ftPatientDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
|
@ -1,33 +1,42 @@
|
||||
package com.ruoyi.system.fantang.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import java.util.Date;
|
||||
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.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.FtSubsidyDao;
|
||||
import com.ruoyi.system.fantang.service.IFtSubsidyDaoService;
|
||||
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;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 补贴管理Controller
|
||||
*
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/subsidy")
|
||||
@RequestMapping("/fantang/subsidy" )
|
||||
public class FtSubsidyDaoController extends BaseController {
|
||||
|
||||
private final IFtSubsidyDaoService iFtSubsidyDaoService;
|
||||
@ -37,26 +46,21 @@ public class FtSubsidyDaoController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtSubsidyDao ftSubsidyDao) {
|
||||
public TableDataInfo list(FtSubsidyDao ftSubsidyDao)
|
||||
{
|
||||
startPage();
|
||||
LambdaQueryWrapper<FtSubsidyDao> lqw = Wrappers.lambdaQuery(ftSubsidyDao);
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getType())) {
|
||||
lqw.eq(FtSubsidyDao::getType, ftSubsidyDao.getType());
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getType())){
|
||||
lqw.eq(FtSubsidyDao::getType ,ftSubsidyDao.getType());
|
||||
}
|
||||
if (ftSubsidyDao.getPrice() != null) {
|
||||
lqw.eq(FtSubsidyDao::getPrice, ftSubsidyDao.getPrice());
|
||||
if (ftSubsidyDao.getPrice() != null){
|
||||
lqw.eq(FtSubsidyDao::getPrice ,ftSubsidyDao.getPrice());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getRange())) {
|
||||
lqw.eq(FtSubsidyDao::getRange, ftSubsidyDao.getRange());
|
||||
if (ftSubsidyDao.getCreateAt() != null){
|
||||
lqw.eq(FtSubsidyDao::getCreateAt ,ftSubsidyDao.getCreateAt());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getCycle())) {
|
||||
lqw.eq(FtSubsidyDao::getCycle, ftSubsidyDao.getCycle());
|
||||
}
|
||||
if (ftSubsidyDao.getCreateAt() != null) {
|
||||
lqw.eq(FtSubsidyDao::getCreateAt, ftSubsidyDao.getCreateAt());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getCreateBy())) {
|
||||
lqw.eq(FtSubsidyDao::getCreateBy, ftSubsidyDao.getCreateBy());
|
||||
if (StringUtils.isNotBlank(ftSubsidyDao.getCreateBy())){
|
||||
lqw.eq(FtSubsidyDao::getCreateBy ,ftSubsidyDao.getCreateBy());
|
||||
}
|
||||
List<FtSubsidyDao> list = iFtSubsidyDaoService.list(lqw);
|
||||
return getDataTable(list);
|
||||
@ -65,40 +69,42 @@ public class FtSubsidyDaoController extends BaseController {
|
||||
/**
|
||||
* 导出补贴管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:export')")
|
||||
@Log(title = "补贴管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:export')" )
|
||||
@Log(title = "补贴管理" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(FtSubsidyDao ftSubsidyDao) {
|
||||
LambdaQueryWrapper<FtSubsidyDao> lqw = new LambdaQueryWrapper<FtSubsidyDao>(ftSubsidyDao);
|
||||
List<FtSubsidyDao> list = iFtSubsidyDaoService.list(lqw);
|
||||
ExcelUtil<FtSubsidyDao> util = new ExcelUtil<FtSubsidyDao>(FtSubsidyDao.class);
|
||||
return util.exportExcel(list, "subsidy");
|
||||
ExcelUtil<FtSubsidyDao> util = new ExcelUtil<FtSubsidyDao>(FtSubsidyDao. class);
|
||||
return util.exportExcel(list, "subsidy" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取补贴管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:query')")
|
||||
@GetMapping(value = "/{subsidyId}")
|
||||
public AjaxResult getInfo(@PathVariable("subsidyId") Long subsidyId) {
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:query')" )
|
||||
@GetMapping(value = "/{subsidyId}" )
|
||||
public AjaxResult getInfo(@PathVariable("subsidyId" ) Long subsidyId) {
|
||||
return AjaxResult.success(iFtSubsidyDaoService.getById(subsidyId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增补贴管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:add')")
|
||||
@Log(title = "补贴管理", businessType = BusinessType.INSERT)
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:add')" )
|
||||
@Log(title = "补贴管理" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtSubsidyDao ftSubsidyDao) {
|
||||
|
||||
ftSubsidyDao.setCreateAt(new Date());
|
||||
return toAjax(iFtSubsidyDaoService.save(ftSubsidyDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改补贴管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:edit')")
|
||||
@Log(title = "补贴管理", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:edit')" )
|
||||
@Log(title = "补贴管理" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtSubsidyDao ftSubsidyDao) {
|
||||
return toAjax(iFtSubsidyDaoService.updateById(ftSubsidyDao) ? 1 : 0);
|
||||
@ -107,9 +113,9 @@ public class FtSubsidyDaoController extends BaseController {
|
||||
/**
|
||||
* 删除补贴管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:remove')")
|
||||
@Log(title = "补贴管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{subsidyIds}")
|
||||
@PreAuthorize("@ss.hasPermi('fantang:subsidy:remove')" )
|
||||
@Log(title = "补贴管理" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{subsidyIds}" )
|
||||
public AjaxResult remove(@PathVariable Long[] subsidyIds) {
|
||||
return toAjax(iFtSubsidyDaoService.removeByIds(Arrays.asList(subsidyIds)) ? 1 : 0);
|
||||
}
|
||||
|
@ -1,24 +1,25 @@
|
||||
package com.ruoyi.system.fantang.domain;
|
||||
|
||||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 补贴管理对象 ft_subsidy
|
||||
*
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@ -28,54 +29,36 @@ import java.util.Date;
|
||||
@TableName("ft_subsidy")
|
||||
public class FtSubsidyDao implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/**
|
||||
* 补贴 id
|
||||
*/
|
||||
/** 补贴 id */
|
||||
@TableId(value = "subsidy_id")
|
||||
private Long subsidyId;
|
||||
|
||||
/**
|
||||
* 补贴类型
|
||||
*/
|
||||
/** 补贴类型 */
|
||||
@Excel(name = "补贴类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 范围
|
||||
*/
|
||||
@Excel(name = "范围")
|
||||
private String range;
|
||||
/** 范围 */
|
||||
private String subsidyRange;
|
||||
|
||||
/**
|
||||
* 周期
|
||||
*/
|
||||
@Excel(name = "周期")
|
||||
/** 周期 */
|
||||
private String cycle;
|
||||
|
||||
/**
|
||||
* 启用标志
|
||||
*/
|
||||
/** 启用标志 */
|
||||
private Integer flag;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@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 createAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String createBy;
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 补贴管理Mapper接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
public interface FtSubsidyDaoMapper extends BaseMapper<FtSubsidyDao> {
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 补贴管理Service接口
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
public interface IFtSubsidyDaoService extends IService<FtSubsidyDao> {
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
||||
import com.ruoyi.system.fantang.mapper.FtSubsidyDaoMapper;
|
||||
import com.ruoyi.system.fantang.service.IFtSubsidyDaoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.system.fantang.mapper.FtSubsidyDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
||||
import com.ruoyi.system.fantang.service.IFtSubsidyDaoService;
|
||||
|
||||
/**
|
||||
* 补贴管理Service业务层处理
|
||||
*
|
||||
* @author ft
|
||||
* @date 2020-11-19
|
||||
* @date 2020-11-25
|
||||
*/
|
||||
@Service
|
||||
public class FtSubsidyDaoServiceImpl extends ServiceImpl<FtSubsidyDaoMapper, FtSubsidyDao> implements IFtSubsidyDaoService {
|
||||
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="subsidyId" column="subsidy_id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="price" column="price" />
|
||||
<result property="range" column="range" />
|
||||
<result property="subsidy_range" column="subsidyRange" />
|
||||
<result property="cycle" column="cycle" />
|
||||
<result property="flag" column="flag" />
|
||||
<result property="createAt" column="create_at" />
|
||||
|
@ -163,7 +163,7 @@
|
||||
v-for="item in deptListOptions"
|
||||
:key="item.departName"
|
||||
:label="item.departName"
|
||||
:value="item.departName">
|
||||
:value="item.departId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -123,7 +123,7 @@
|
||||
<el-input v-model="form.name" placeholder="请输入姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属部门" prop="departId">
|
||||
<el-select v-model="form.departId" placeholder="请选择科室列表">
|
||||
<el-select v-model="form.departId" placeholder="请选择科室">
|
||||
<el-option
|
||||
v-for="item in deptListOptions"
|
||||
:key="item.departName"
|
||||
|
@ -20,24 +20,6 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" prop="range">
|
||||
<el-input
|
||||
v-model="queryParams.range"
|
||||
placeholder="请输入范围"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="周期" prop="cycle">
|
||||
<el-input
|
||||
v-model="queryParams.cycle"
|
||||
placeholder="请输入周期"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建日期" prop="createAt">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.createAt"
|
||||
@ -112,8 +94,6 @@
|
||||
<el-table-column label="补贴 id" align="center" prop="subsidyId" v-if="false"/>
|
||||
<el-table-column label="补贴类型" align="center" prop="type" :formatter="typeFormat"/>
|
||||
<el-table-column label="金额" align="center" prop="price"/>
|
||||
<el-table-column label="范围" align="center" prop="range"/>
|
||||
<el-table-column label="周期" align="center" prop="cycle"/>
|
||||
<el-table-column label="创建日期" align="center" prop="createAt" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createAt, '{y}-{m}-{d}') }}</span>
|
||||
@ -166,11 +146,14 @@
|
||||
<el-form-item label="金额" prop="price">
|
||||
<el-input v-model="form.price" placeholder="请输入金额"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="范围" prop="range">
|
||||
<el-input v-model="form.range" placeholder="请输入范围"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="周期" prop="cycle">
|
||||
<el-input v-model="form.cycle" placeholder="请输入周期"/>
|
||||
<el-form-item label="启用标志" prop="flag">
|
||||
<el-switch
|
||||
v-model="form.flag"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="启用"
|
||||
inactive-text="禁用">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -215,8 +198,6 @@ export default {
|
||||
pageSize: 10,
|
||||
type: null,
|
||||
price: null,
|
||||
range: null,
|
||||
cycle: null,
|
||||
createAt: null,
|
||||
createBy: null
|
||||
},
|
||||
@ -230,11 +211,8 @@ export default {
|
||||
price: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
range: [
|
||||
{required: true, message: "范围不能为空", trigger: "blur"}
|
||||
],
|
||||
cycle: [
|
||||
{required: true, message: "周期不能为空", trigger: "blur"}
|
||||
flag: [
|
||||
{required: true, message: "启用标志不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
};
|
||||
@ -270,11 +248,11 @@ export default {
|
||||
subsidyId: null,
|
||||
type: null,
|
||||
price: null,
|
||||
range: null,
|
||||
subsidyRange: null,
|
||||
cycle: null,
|
||||
flag: null,
|
||||
flag: true,
|
||||
createAt: null,
|
||||
createBy: null
|
||||
createBy: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -315,12 +293,22 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.subsidyId != null) {
|
||||
if (this.form.flag === true) {
|
||||
this.form.flag = 1;
|
||||
} else {
|
||||
this.form.flag = 0;
|
||||
}
|
||||
updateSubsidy(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
if (this.form.flag === true) {
|
||||
this.form.flag = 1;
|
||||
} else {
|
||||
this.form.flag = 0;
|
||||
}
|
||||
addSubsidy(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user