Browse Source

福利领取基本功能

xianwait 2 years ago
parent
commit
ffaae4163a

+ 15 - 4
willalp-admin/src/main/java/com/willalp/web/controller/app/AppThreeController.java

@@ -19,10 +19,8 @@ import com.willalp.erms.service.IHsGoodsTypeService;
 import com.willalp.event.domain.HsActivityAppoint;
 import com.willalp.event.domain.HsEvent;
 import com.willalp.event.domain.HsEventImg;
-import com.willalp.event.service.IHsActivityAppointService;
-import com.willalp.event.service.IHsAssociationsInfoService;
-import com.willalp.event.service.IHsEventImgService;
-import com.willalp.event.service.IHsEventService;
+import com.willalp.event.domain.HsWelfareApplyRecord;
+import com.willalp.event.service.*;
 import com.willalp.files.service.IHsOrgPersonnelFilesService;
 import com.willalp.flow.service.IHsFlowCcService;
 import com.willalp.system.service.ISysDeptService;
@@ -82,6 +80,9 @@ public class AppThreeController extends BaseController {
     @Resource
     private IHsEventImgService eventImgService;
 
+    @Resource
+    private IHsWelfareApplyRecordService welfareApplyRecordService;
+
 
     @RequestMapping("/getOpfInfo")
     public AjaxResult getOpfInfo(@RequestParam String opfUserPhone) {
@@ -272,5 +273,15 @@ public class AppThreeController extends BaseController {
         }
         return AjaxResult.error("取消失败");
     }
+
+
+    /*福利领取*/
+    @RequestMapping("/welfareOrders")
+    public TableDataInfo welfareOrders() {
+        startPage();
+        return getDataTable(welfareApplyRecordService.list(new QueryWrapper<HsWelfareApplyRecord>()
+                .groupBy("source")));
+    }
+
 }
  

+ 128 - 0
willalp-admin/src/main/java/com/willalp/web/controller/clockingin/HsWelfareApplyRecordController.java

@@ -0,0 +1,128 @@
+package com.willalp.web.controller.clockingin;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.willalp.common.annotation.Log;
+import com.willalp.common.core.controller.BaseController;
+import com.willalp.common.core.domain.AjaxResult;
+import com.willalp.common.core.page.TableDataInfo;
+import com.willalp.common.enums.BusinessType;
+import com.willalp.common.utils.DateUtils;
+import com.willalp.common.utils.SecurityUtils;
+import com.willalp.common.utils.poi.ExcelUtil;
+import com.willalp.event.domain.HsWelfareApplyRecord;
+import com.willalp.event.service.IHsWelfareApplyRecordService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 福利报名记录Controller
+ *
+ * @author willalp
+ * @date 2023-04-17
+ */
+@RestController
+@RequestMapping("/event/applyRecord")
+public class HsWelfareApplyRecordController extends BaseController {
+    @Resource
+    private IHsWelfareApplyRecordService hsWelfareApplyRecordService;
+
+    /**
+     * 查询福利报名记录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(HsWelfareApplyRecord hsWelfareApplyRecord) {
+        startPage();
+        List<HsWelfareApplyRecord> list = hsWelfareApplyRecordService.selectHsWelfareApplyRecordList(hsWelfareApplyRecord);
+        List<HsWelfareApplyRecord> source = hsWelfareApplyRecordService.list(new QueryWrapper<HsWelfareApplyRecord>()
+                .groupBy("source"));
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询福利报名记录列表
+     */
+    @GetMapping("/sourceList")
+    public TableDataInfo sourceList(HsWelfareApplyRecord hsWelfareApplyRecord) {
+        startPage();
+        List<HsWelfareApplyRecord> source = hsWelfareApplyRecordService.list(new QueryWrapper<HsWelfareApplyRecord>()
+                .groupBy("source"));
+        return getDataTable(source);
+    }
+
+
+    /**
+     * 导出福利报名记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('event:applyRecord:export')")
+    @Log(title = "福利报名记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(HsWelfareApplyRecord hsWelfareApplyRecord) {
+        List<HsWelfareApplyRecord> list = hsWelfareApplyRecordService.selectHsWelfareApplyRecordList(hsWelfareApplyRecord);
+        ExcelUtil<HsWelfareApplyRecord> util = new ExcelUtil<>(HsWelfareApplyRecord.class);
+        return util.exportExcel(list, "福利报名记录数据");
+    }
+
+
+    @GetMapping("/importTemp")
+    public AjaxResult importTemp() {
+        ExcelUtil<HsWelfareApplyRecord> util = new ExcelUtil<>(HsWelfareApplyRecord.class);
+        return util.importTemplateExcel("福利领取人员导入模板");
+    }
+
+    @Log(title = "福利报名记录", businessType = BusinessType.IMPORT)
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file) throws Exception {
+        ExcelUtil<HsWelfareApplyRecord> util = new ExcelUtil<>(HsWelfareApplyRecord.class);
+        //获取数据库对应数据
+        List<HsWelfareApplyRecord> list = util.importExcel(file.getInputStream(), 0);
+        return AjaxResult.success(hsWelfareApplyRecordService.importData(list, file.getOriginalFilename()));
+    }
+
+    /**
+     * 获取福利报名记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('event:applyRecord:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(hsWelfareApplyRecordService.getById(id));
+    }
+
+    /**
+     * 新增福利报名记录
+     */
+    @PreAuthorize("@ss.hasPermi('event:applyRecord:add')")
+    @Log(title = "福利报名记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody HsWelfareApplyRecord hsWelfareApplyRecord) {
+        hsWelfareApplyRecord.setCreateBy(SecurityUtils.getUsername());
+        hsWelfareApplyRecord.setCreateTime(DateUtils.getNowDate());
+        return toAjax(hsWelfareApplyRecordService.save(hsWelfareApplyRecord));
+    }
+
+    /**
+     * 修改福利报名记录
+     */
+    @PreAuthorize("@ss.hasPermi('event:applyRecord:edit')")
+    @Log(title = "福利报名记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody HsWelfareApplyRecord hsWelfareApplyRecord) {
+        hsWelfareApplyRecord.setUpdateBy(SecurityUtils.getUsername());
+        hsWelfareApplyRecord.setUpdateTime(DateUtils.getNowDate());
+        return toAjax(hsWelfareApplyRecordService.updateById(hsWelfareApplyRecord));
+    }
+
+    /**
+     * 删除福利报名记录
+     */
+    @PreAuthorize("@ss.hasPermi('event:applyRecord:remove')")
+    @Log(title = "福利报名记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(hsWelfareApplyRecordService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 26 - 41
willalp-admin/src/main/resources/i18n/messages.properties

@@ -10,12 +10,9 @@ user.password.delete=对不起,您的账号已被删除
 user.blocked=用户已封禁,请联系管理员
 role.blocked=角色已封禁,请联系管理员
 user.logout.success=退出成功
-
 length.not.valid=长度必须在{min}到{max}个字符之间
-
 user.username.not.valid=* 2到20个汉字、字母、数字或下划线组成,且必须以非数字开头
 user.password.not.valid=* 5-50个字符
-
 user.email.not.valid=邮箱格式错误
 user.mobile.phone.number.not.valid=手机号格式错误
 user.login.success=登录成功
@@ -23,11 +20,9 @@ user.register.success=注册成功
 user.notfound=请重新登录
 user.forcelogout=管理员强制退出,请重新登录
 user.unknown.error=未知错误,请重新登录
-
 ##文件上传消息
 upload.exceed.maxSize=上传的文件大小超出限制的文件大小!<br/>允许的文件最大大小是:{0}MB!
 upload.filename.exceed.length=上传的文件名最长{0}个字符
-
 ##权限
 no.permission=您没有数据的权限,请联系管理员添加权限 [{0}]
 no.create.permission=您没有创建数据的权限,请联系管理员添加权限 [{0}]
@@ -35,49 +30,39 @@ no.update.permission=您没有修改数据的权限,请联系管理员添加
 no.delete.permission=您没有删除数据的权限,请联系管理员添加权限 [{0}]
 no.export.permission=您没有导出数据的权限,请联系管理员添加权限 [{0}]
 no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
-
 ##机构部门
-system.dept.errorCode1 = 机构部门编码规则未设置,请先维护编码规则!
-system.dept.errorCode2 = 部门已停用,不允许新增!
-
+system.dept.errorCode1=机构部门编码规则未设置,请先维护编码规则!
+system.dept.errorCode2=部门已停用,不允许新增!
 ##用户
-system.user.errorCode1 = 用户编码规则未设置,请先维护用户编码规则!
-system.user.errorCode2 = 用户编码或名称{0}用户不存在!
-system.user.errorCode3 = 用户编码{0}用户已停用或删除!
-system.user.errorCode4 = 导入用户数据不能为空!
-system.user.errorCode5 = 导入用户数据手机号码{0}重复,请修改后重新导入!
-
+system.user.errorCode1=用户编码规则未设置,请先维护用户编码规则!
+system.user.errorCode2=用户编码或名称{0}用户不存在!
+system.user.errorCode3=用户编码{0}用户已停用或删除!
+system.user.errorCode4=导入用户数据不能为空!
+system.user.errorCode5=导入用户数据手机号码{0}重复,请修改后重新导入!
 ##卡片用户
-system.card.errorCode1 = 卡片编码规则未设置,请先维护卡片编码规则!
-system.card.errorCode2 = 用户已有卡片!
-
-
+system.card.errorCode1=卡片编码规则未设置,请先维护卡片编码规则!
+system.card.errorCode2=用户已有卡片!
 ##设备账户
-system.device.errorCode1 = 设备编码规则未设置,请先维护卡片编码规则!
-
+system.device.errorCode1=设备编码规则未设置,请先维护卡片编码规则!
 ##角色编码
-system.role.errorCode1 = 角色编码规则未设置,请先维护角色编码规则!
-
+system.role.errorCode1=角色编码规则未设置,请先维护角色编码规则!
 #积分管理
-pns.integral.errorCode1 = 导入失败!共{0}条数据格式不正确,错误如下{1}
-
-pns.integral.successCode1 = 充值结果:已经为列表中{0}位员工充值完成
-
+pns.integral.errorCode1=导入失败!共{0}条数据格式不正确,错误如下{1}
+pns.integral.successCode1=充值结果:已经为列表中{0}位员工充值完成
+event.club.successCode=共导入成功{0}条数据,导入失败{1}条数据
 #人员机构
-system.userOrganization.errerCode1 = 该用户当前机构已授权!
-
+system.userOrganization.errerCode1=该用户当前机构已授权!
 #APP首页
-app.home.config.null = 配置错误,未绑定首页方案
-app.home.config.homeId.null = 首页方案数据ID为空
-app.home.config.appHomeId.null = 首页方案ID为空
-app.home.config.vo.null = 该首页方案数据不存在
-app.home.config.homePojo.null = 该首页方案不存在
-app.home.config.orgCode.null = 首页方案对应机构编号为空
-app.home.config.type.null = 首页方案类型错误
-app.home.config.save.error = 配置'保存'失败
-
+app.home.config.null=配置错误,未绑定首页方案
+app.home.config.homeId.null=首页方案数据ID为空
+app.home.config.appHomeId.null=首页方案ID为空
+app.home.config.vo.null=该首页方案数据不存在
+app.home.config.homePojo.null=该首页方案不存在
+app.home.config.orgCode.null=首页方案对应机构编号为空
+app.home.config.type.null=首页方案类型错误
+app.home.config.save.error=配置'保存'失败
 #灯控
-control.openOrClose.device.not.network = 设备未连接,请检查网络或连接设备
-control.useNoId.null = 执行口ID为空
-control.selectTiming.to.useNoId.null = 该执行口暂未配置任务
+control.openOrClose.device.not.network=设备未连接,请检查网络或连接设备
+control.useNoId.null=执行口ID为空
+control.selectTiming.to.useNoId.null=该执行口暂未配置任务
 

+ 132 - 0
willalp-clocking-in/src/main/java/com/willalp/event/domain/HsWelfareApplyRecord.java

@@ -0,0 +1,132 @@
+package com.willalp.event.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.willalp.common.annotation.Excel;
+import com.willalp.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 福利报名记录对象 hs_welfare_apply_record
+ *
+ * @author willalp
+ * @date 2023-04-17
+ */
+
+@TableName("hs_welfare_apply_record")
+public class HsWelfareApplyRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId
+    private String id;
+
+    /** Excel来源 */
+    //@Excel(name = "Excel来源")
+    private String source;
+
+    /** 用户编号 */
+    @Excel(name = "用户编号")
+    private String userCode;
+
+    /** 用户名称 */
+    @Excel(name = "用户名称")
+    private String userName;
+
+    /** 地点 */
+    @Excel(name = "地点")
+    private String address;
+
+    /** 当前状态 */
+    @Excel(name = "当前状态")
+    private String nowStatus;
+
+    /** 是否删除(0.未删除;1.已删除) */
+    @TableLogic
+    private Integer isDelete;
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+    public void setSource(String source)
+    {
+        this.source = source;
+    }
+
+    public String getSource()
+    {
+        return source;
+    }
+    public void setUserCode(String userCode)
+    {
+        this.userCode = userCode;
+    }
+
+    public String getUserCode()
+    {
+        return userCode;
+    }
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName()
+    {
+        return userName;
+    }
+    public void setAddress(String address)
+    {
+        this.address = address;
+    }
+
+    public String getAddress()
+    {
+        return address;
+    }
+    public void setNowStatus(String nowStatus)
+    {
+        this.nowStatus = nowStatus;
+    }
+
+    public String getNowStatus()
+    {
+        return nowStatus;
+    }
+    public void setIsDelete(Integer isDelete)
+    {
+        this.isDelete = isDelete;
+    }
+
+    public Integer getIsDelete()
+    {
+        return isDelete;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("source", getSource())
+            .append("userCode", getUserCode())
+            .append("userName", getUserName())
+            .append("address", getAddress())
+            .append("nowStatus", getNowStatus())
+            .append("isDelete", getIsDelete())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 23 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsWelfareApplyRecordMapper.java

@@ -0,0 +1,23 @@
+package com.willalp.event.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.willalp.event.domain.HsWelfareApplyRecord;
+
+import java.util.List;
+
+/**
+ * 福利报名记录Mapper接口
+ *
+ * @author willalp
+ * @date 2023-04-17
+ */
+public interface HsWelfareApplyRecordMapper extends BaseMapper<HsWelfareApplyRecord>
+{
+    /**
+     * 查询福利报名记录列表
+     *
+     * @param hsWelfareApplyRecord 福利报名记录
+     * @return 福利报名记录集合
+     */
+    List<HsWelfareApplyRecord> selectHsWelfareApplyRecordList(HsWelfareApplyRecord hsWelfareApplyRecord);
+}

+ 63 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsWelfareApplyRecordMapper.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.willalp.event.mapper.HsWelfareApplyRecordMapper">
+
+    <resultMap type="com.willalp.event.domain.HsWelfareApplyRecord" id="HsWelfareApplyRecordResult">
+        <result property="id" column="id"/>
+        <result property="source" column="source"/>
+        <result property="userCode" column="user_code"/>
+        <result property="userName" column="user_name"/>
+        <result property="address" column="address"/>
+        <result property="nowStatus" column="now_status"/>
+        <result property="isDelete" column="is_delete"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectHsWelfareApplyRecordVo">
+        select id,
+               source,
+               user_code,
+               user_name,
+               address,
+               now_status,
+               is_delete,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from hs_welfare_apply_record
+    </sql>
+
+    <select id="selectHsWelfareApplyRecordList" parameterType="HsWelfareApplyRecord"
+            resultMap="HsWelfareApplyRecordResult">
+        <include refid="selectHsWelfareApplyRecordVo"/>
+        <where>
+            is_delete = 0
+            <if test="source != null  and source != ''">
+                and source = #{source}
+            </if>
+            <if test="userCode != null  and userCode != ''">
+                and user_code = #{userCode}
+            </if>
+            <if test="userName != null  and userName != ''">
+                and user_name like concat('%', #{userName}, '%')
+            </if>
+            <if test="address != null  and address != ''">
+                and address = #{address}
+            </if>
+            <if test="nowStatus != null  and nowStatus != ''">
+                and now_status = #{nowStatus}
+            </if>
+            <if test="isDelete != null ">
+                and is_delete = #{isDelete}
+            </if>
+        </where>
+    </select>
+</mapper>

+ 25 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsWelfareApplyRecordService.java

@@ -0,0 +1,25 @@
+package com.willalp.event.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.willalp.event.domain.HsWelfareApplyRecord;
+
+import java.util.List;
+
+/**
+ * 福利报名记录Service接口
+ *
+ * @author willalp
+ * @date 2023-04-17
+ */
+public interface IHsWelfareApplyRecordService extends IService<HsWelfareApplyRecord>
+{
+    /**
+     * 查询福利报名记录列表
+     *
+     * @param hsWelfareApplyRecord 福利报名记录
+     * @return 福利报名记录集合
+     */
+    List<HsWelfareApplyRecord> selectHsWelfareApplyRecordList(HsWelfareApplyRecord hsWelfareApplyRecord);
+
+    String importData(List<HsWelfareApplyRecord> list,String fileName);
+}

+ 76 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsWelfareApplyRecordServiceImpl.java

@@ -0,0 +1,76 @@
+package com.willalp.event.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.willalp.common.core.domain.ReturnEntity;
+import com.willalp.common.exception.base.BaseException;
+import com.willalp.common.utils.ObjectToTypes;
+import com.willalp.common.utils.StringUtils;
+import com.willalp.event.domain.HsWelfareApplyRecord;
+import com.willalp.event.mapper.HsWelfareApplyRecordMapper;
+import com.willalp.event.service.IHsWelfareApplyRecordService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 福利报名记录Service业务层处理
+ *
+ * @author willalp
+ * @date 2023-04-17
+ */
+@Service
+public class HsWelfareApplyRecordServiceImpl extends ServiceImpl<HsWelfareApplyRecordMapper, HsWelfareApplyRecord> implements IHsWelfareApplyRecordService {
+    @Resource
+    private HsWelfareApplyRecordMapper hsWelfareApplyRecordMapper;
+
+    /**
+     * 查询福利报名记录列表
+     *
+     * @param hsWelfareApplyRecord 福利报名记录
+     * @return 福利报名记录
+     */
+    @Override
+    public List<HsWelfareApplyRecord> selectHsWelfareApplyRecordList(HsWelfareApplyRecord hsWelfareApplyRecord) {
+        return hsWelfareApplyRecordMapper.selectHsWelfareApplyRecordList(hsWelfareApplyRecord);
+    }
+
+    @Override
+    public String importData(List<HsWelfareApplyRecord> list, String fileName) {
+        if (StringUtils.isBlank(fileName)) {
+            if (count(new QueryWrapper<HsWelfareApplyRecord>().eq("source", fileName)) > 0) {
+                throw new BaseException("该Excel已经存在");
+            }
+        }
+        int successNum = 0;
+        int failureNum = 0;
+        List<HsWelfareApplyRecord> toSaveList = new ArrayList<>();
+        for (HsWelfareApplyRecord welfareApplyRecord : list) {
+            try {
+                if (StringUtils.isBlank(welfareApplyRecord.getUserCode())) {
+                    throw new Exception();
+                }
+                if (StringUtils.isBlank(welfareApplyRecord.getUserName())) {
+                    throw new Exception();
+                }
+                welfareApplyRecord.setSource(fileName);
+                toSaveList.add(welfareApplyRecord);
+            } catch (Exception e) {
+                failureNum++;
+                log.error(e.getMessage(), e);
+            }
+        }
+        if (saveBatch(toSaveList)) {
+            successNum = toSaveList.size();
+        }
+        ReturnEntity<String> res = new ReturnEntity<>();
+        res.setReturnMessage("event.club.successCode", new String[]{
+                ObjectToTypes.parseString(successNum), ObjectToTypes.parseString(failureNum)
+        });
+        return res.getMessage();
+    }
+
+
+}

+ 70 - 0
willalp-ui/src/api/event/applyRecord.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询福利报名记录列表
+export function listApplyRecord(query) {
+  return request({
+    url: '/event/applyRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function sourceListApplyRecord(query) {
+  return request({
+    url: '/event/applyRecord/sourceList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询福利报名记录详细
+export function getApplyRecord(id) {
+  return request({
+    url: '/event/applyRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增福利报名记录
+export function addApplyRecord(data) {
+  return request({
+    url: '/event/applyRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改福利报名记录
+export function updateApplyRecord(data) {
+  return request({
+    url: '/event/applyRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除福利报名记录
+export function delApplyRecord(id) {
+  return request({
+    url: '/event/applyRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出福利报名记录
+export function exportApplyRecord(query) {
+  return request({
+    url: '/event/applyRecord/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出福利报名记录
+export function importTempApplyRecord(query) {
+  return request({
+    url: '/event/applyRecord/importTemp',
+    method: 'get',
+    params: query
+  })
+}

+ 484 - 0
willalp-ui/src/views/event/applyRecord/index.vue

@@ -0,0 +1,484 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="Excel来源" prop="source">
+        <el-input
+          v-model="queryParams.source"
+          placeholder="请输入Excel来源"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户编号" prop="userCode">
+        <el-input
+          v-model="queryParams.userCode"
+          placeholder="请输入用户编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户名称" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入用户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="地点" prop="address">
+        <el-select v-model="queryParams.address" placeholder="请选择地点" clearable size="small">
+          <el-option
+            v-for="dict in dict.type.welfare_apply_addr"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="当前状态" prop="nowStatus">
+        <el-select v-model="queryParams.nowStatus" placeholder="请选择当前状态" clearable size="small">
+          <el-option
+            v-for="dict in dict.type.welfare_apply_status"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+      <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['event:applyRecord:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['event:applyRecord:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['event:applyRecord:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['event:applyRecord:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['salary:salaryslip:add']"
+        >导入
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-row :gutter="6">
+      <el-col :span="8">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>福利领取目录</span>
+          </div>
+          <div class="item">
+            <el-table v-loading="loading" :data="sourceList" @selection-change="handleSelectionChange" rowClick>
+              <el-table-column label="Excel来源" align="center" prop="source"/>
+            </el-table>
+            <pagination
+              v-show="total>0"
+              :total="sourceQueryParams.total"
+              :page.sync="sourceQueryParams.pageNum"
+              :limit.sync="sourceQueryParams.pageSize"
+              @pagination="getList"
+            />
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :span="16">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>报名信息</span>
+          </div>
+          <div class="item">
+            <el-table v-loading="loading" :data="applyRecordList" @selection-change="handleSelectionChange">
+              <el-table-column type="selection" width="55" align="center"/>
+              <el-table-column label="用户编号" align="center" prop="userCode"/>
+              <el-table-column label="用户名称" align="center" prop="userName"/>
+              <el-table-column label="地点" align="center" prop="address">
+                <template slot-scope="scope">
+                  <dict-tag :options="dict.type.welfare_apply_addr" :value="scope.row.address"/>
+                </template>
+              </el-table-column>
+              <el-table-column label="当前状态" align="center" prop="nowStatus">
+                <template slot-scope="scope">
+                  <dict-tag :options="dict.type.welfare_apply_status" :value="scope.row.nowStatus"/>
+                </template>
+              </el-table-column>
+              <el-table-column label="备注" align="center" prop="remark"/>
+              <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-edit"
+                    @click="handleUpdate(scope.row)"
+                    v-hasPermi="['event:applyRecord:edit']"
+                  >修改
+                  </el-button>
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-delete"
+                    @click="handleDelete(scope.row)"
+                    v-hasPermi="['event:applyRecord:remove']"
+                  >删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+            <pagination
+              v-show="total>0"
+              :total="total"
+              :page.sync="queryParams.pageNum"
+              :limit.sync="queryParams.pageSize"
+              @pagination="getList"
+            />
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+    <!-- 添加或修改福利报名记录对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-form-item label="Excel来源" prop="source">
+          <el-input v-model="form.source" placeholder="请输入Excel来源"/>
+        </el-form-item>
+        <el-form-item label="用户编号" prop="userCode">
+          <el-input v-model="form.userCode" placeholder="请输入用户编号"/>
+        </el-form-item>
+        <el-form-item label="用户名称" prop="userName">
+          <el-input v-model="form.userName" placeholder="请输入用户名称"/>
+        </el-form-item>
+        <el-form-item label="地点" prop="address">
+          <el-input v-model="form.address" placeholder="请输入地点"/>
+        </el-form-item>
+        <el-form-item label="当前状态" prop="nowStatus">
+          <el-select v-model="form.nowStatus" placeholder="请选择当前状态">
+            <el-option
+              v-for="dict in dict.type.welfare_apply_status"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
+                   @click="importTemplate">下载模板
+          </el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="cancelTemplate">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listApplyRecord,
+  sourceListApplyRecord,
+  getApplyRecord,
+  delApplyRecord,
+  addApplyRecord,
+  updateApplyRecord,
+  exportApplyRecord,
+  importTempApplyRecord
+} from '@/api/event/applyRecord'
+import { getToken } from '@/utils/auth'
+import { listSalaryslip } from '@/api/salary/salaryslip'
+
+export default {
+  name: 'ApplyRecord',
+  dicts: ['welfare_apply_status', 'welfare_apply_addr'],
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 福利报名记录表格数据
+      applyRecordList: [],
+      sourceList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        source: null,
+        userCode: null,
+        userName: null,
+        address: null,
+        nowStatus: null,
+        isDelete: null
+      },
+      sourceQueryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        total: 0
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/event/applyRecord/importData'
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    rowClick(row, column, event) {
+      this.queryParams.source = row.source
+      this.excelInfo.source = row.source
+      listSalaryslip(this.queryParams).then(response => {
+        this.salaryslipList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 查询福利报名记录列表 */
+    getList() {
+      this.loading = true
+      listApplyRecord(this.queryParams).then(response => {
+        this.applyRecordList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+      sourceListApplyRecord(this.sourceQueryParams).then(response => {
+        this.sourceList = response.rows
+        this.sourceQueryParams.total = response.total
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        source: null,
+        userCode: null,
+        userName: null,
+        address: null,
+        nowStatus: '0',
+        isDelete: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      }
+      this.resetForm('form')
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '添加福利报名记录'
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      const id = row.id || this.ids
+      getApplyRecord(id).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = '修改福利报名记录'
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateApplyRecord(this.form).then(() => {
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addApplyRecord(this.form).then(() => {
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids
+      this.$modal.confirm('是否确认删除福利报名记录编号为"' + ids + '"的数据项?').then(function() {
+        return delApplyRecord(ids)
+      }).then(() => {
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$modal.confirm('是否确认导出所有福利报名记录数据项?').then(() => {
+        this.exportLoading = true
+        return exportApplyRecord(queryParams)
+      }).then(response => {
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
+    },
+    handleImport() {
+      this.upload.title = '福利领取人员导入'
+      this.upload.open = true
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
+      this.cancel()
+      this.getList()
+    },
+    importTemplate() {
+      importTempApplyRecord().then(response => {
+        this.$download.name(response.msg)
+      })
+    },
+    submitFileForm() {
+      this.$refs.upload.submit()
+    },
+    cancelTemplate() {
+      this.upload.open = false
+    }
+  }
+}
+
+</script>