Commit 2a75ee2e authored by huyuchen's avatar huyuchen

huych-入职登记商险待办提交

parent 32e3ed37
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Data
@TableName("t_employee_insurance_pre")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商险待办任务表")
public class TEmployeeInsurancePre extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "id")
private String id;
@Schema(description = "员工姓名")
private String employeeName;
@Schema(description = "身份证号")
private String empIdcard;
@Schema(description = "手机号码")
private String empPhone;
@Schema(description = "入职日期")
private Date joinLeaveDate;
@Schema(description = "状态,0待确认,1待派单,2派单失败,3待投保,4投保中,5投保退回,6已完成")
private String processStatus;
@Schema(description = "前端客服")
private String customerUsername;
@Schema(description = "前端客服登录名")
private String customerUserLoginname;
@Schema(description = "项目名称")
private String deptName;
@Schema(description = "项目编码")
private String deptNo;
@Schema(description = "项目id")
private String deptId;
@Schema(description = "预计派单时间")
private Date expectedCollectionTime;
@Schema(description = "登记人")
private String registUser;
@Schema(description = "登记时间")
private Date registTime;
@Schema(description = "最新的客服名称")
private String customerUsernameNew;
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
@Schema(description = "险种名称")
private String insuranceTypeName;
@Schema(description = "险种主键")
private String insuranceTypeId;
@Schema(description = "购买标准")
private String buyStandard;
@Schema(description = "购买类型, 1新增、3批增、4替换")
private Integer buyType;
@Schema(description = "保单开始时间")
private Date policyStart;
@Schema(description = "保单结束时间")
private Date policyEnd;
@Schema(description = "是否地市自购0是 1 否")
private String isAddress;
@Schema(description = "就职岗位")
private String position;
@Schema(description = "数据来源1客户端 2客服端")
private String dataSource;
@Schema(description = "购买地-省")
private String fileProvince;
@Schema(description = "购买地-市")
private String fileCity;
@Schema(description = "购买地-省id")
private String provinceCode;
@Schema(description = "购买地-市id")
private String cityCode;
@Schema(description = "入离职登记主表id")
private String registerId;
@Schema(description = "替换员工姓名")
private String replaceEmployeeName;
@Schema(description = "替换身份证号")
private String replaceEmpIdcard;
@Schema(description = "替换项目编码")
private String replaceDeptNo;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 商险待办导出vo
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Data
public class TEmployeeInsurancePreExportVo implements Serializable {
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String employeeName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号")
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 购买类型, 1新增、3批增、4替换
*/
@ExcelAttribute(name = "投保类型")
@Schema(description = "投保类型, 1新增、3批增、4替换")
@ExcelProperty("投保类型")
private String buyType;
/**
* 保险公司名称
*/
@ExcelAttribute(name = "保险公司")
@Schema(description = "保险公司")
@ExcelProperty("保险公司")
private String insuranceCompanyName;
/**
* 险种名称
*/
@ExcelAttribute(name = "险种")
@Schema(description = "险种")
@ExcelProperty("险种")
private String insuranceTypeName;
/**
* 是否地市自购0是 1 否
*/
@ExcelAttribute(name = "是否地市自购0是 1 否")
@Schema(description = "是否地市自购0是 1 否")
@ExcelProperty("是否地市自购0是 1 否")
private String isAddress;
/**
* 保单起止时间
*/
@ExcelAttribute(name = "保单起止时间")
@Schema(description = "保单起止时间")
@ExcelProperty("保单起止时间")
private String policyStartEnd;
/**
* 购买标准
*/
@ExcelAttribute(name = "购买标准")
@Schema(description = "购买标准")
@ExcelProperty("购买标准")
private String buyStandard;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期")
@ExcelProperty("入职日期")
private Date joinLeaveDate;
/**
* 预计派单时间
*/
@ExcelAttribute(name = "预计派单时间", isDate = true)
@Schema(description = "预计派单时间")
@ExcelProperty("预计派单时间")
private Date expectedCollectionTime;
/**
* 前端客服
*/
@ExcelAttribute(name = "前端客服")
@Schema(description = "前端客服")
@ExcelProperty("前端客服")
private String customerUsername;
/**
* 状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职4已完成
*/
@ExcelAttribute(name = "状态")
@Schema(description = "状态,0待确认,1待派单,2派单失败,3待投保,4投保中,5投保退回,6已完成")
@ExcelProperty("状态")
private String processStatus;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Data
public class TEmployeeInsurancePreSearchVo extends TEmployeeInsurancePre {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
@Schema(description = "处理状态数组")
@TableField(exist = false)
private List<String> statusList;
@Schema(description = "项目权限数组")
@TableField(exist = false)
private List<String> deptNoList;
@Schema(description = "列表类型 1 待办 2监控 3入职确认信息")
private String type;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.util.Date;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Data
public class TEmployeeInsurancePreVo implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名")
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String employeeName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号")
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 入职日期
*/
@ExcelAttribute(name = "入职日期", isDate = true)
@Schema(description = "入职日期")
@ExcelProperty("入职日期")
private Date joinLeaveDate;
/**
* 状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职4已完成
*/
@ExcelAttribute(name = "状态,0短信待发送,1信息待填写,2信息待审核,3拒绝入职4已完成")
@Schema(description = "状态,0待确认,1待派单,2派单失败,3待投保,4投保中,5投保退回,6已完成")
@ExcelProperty("状态,0待确认,1待派单,2派单失败,3待投保,4投保中,5投保退回,6已完成")
private String processStatus;
/**
* 前端客服
*/
@ExcelAttribute(name = "前端客服")
@Schema(description = "前端客服")
@ExcelProperty("前端客服")
private String customerUsername;
/**
* 前端客服登录名
*/
@ExcelAttribute(name = "前端客服登录名")
@Schema(description = "前端客服登录名")
@ExcelProperty("前端客服登录名")
private String customerUserLoginname;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String deptName;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码")
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String deptNo;
/**
* 项目id
*/
@ExcelAttribute(name = "项目id")
@Schema(description = "项目id")
@ExcelProperty("项目id")
private String deptId;
/**
* 预计派单时间
*/
@ExcelAttribute(name = "预计派单时间", isDate = true)
@Schema(description = "预计派单时间")
@ExcelProperty("预计派单时间")
private Date expectedCollectionTime;
/**
* 登记人
*/
@ExcelAttribute(name = "登记人")
@Schema(description = "登记人")
@ExcelProperty("登记人")
private String registUser;
/**
* 登记时间
*/
@ExcelAttribute(name = "登记时间")
@Schema(description = "登记时间")
@ExcelProperty("登记时间")
private Date registTime;
/**
* 最新的客服名称
*/
@ExcelAttribute(name = "最新的客服名称")
@Schema(description = "最新的客服名称")
@ExcelProperty("最新的客服名称")
private String customerUsernameNew;
/**
* 保险公司名称
*/
@ExcelAttribute(name = "保险公司名称")
@Schema(description = "保险公司名称")
@ExcelProperty("保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@ExcelAttribute(name = "险种名称")
@Schema(description = "险种名称")
@ExcelProperty("险种名称")
private String insuranceTypeName;
/**
* 险种主键
*/
@ExcelAttribute(name = "险种主键")
@Schema(description = "险种主键")
@ExcelProperty("险种主键")
private String insuranceTypeId;
/**
* 购买标准
*/
@ExcelAttribute(name = "购买标准")
@Schema(description = "购买标准")
@ExcelProperty("购买标准")
private String buyStandard;
/**
* 购买类型, 1新增、3批增、4替换
*/
@ExcelAttribute(name = "购买类型, 1新增、3批增、4替换")
@Schema(description = "购买类型, 1新增、3批增、4替换")
@ExcelProperty("购买类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 保单开始时间
*/
@ExcelAttribute(name = "保单开始时间", isDate = true)
@Schema(description = "保单开始时间")
@ExcelProperty("保单开始时间")
private Date policyStart;
/**
* 保单结束时间
*/
@ExcelAttribute(name = "保单结束时间", isDate = true)
@Schema(description = "保单结束时间")
@ExcelProperty("保单结束时间")
private Date policyEnd;
/**
* 是否地市自购0是 1 否
*/
@ExcelAttribute(name = "是否地市自购0是 1 否")
@Schema(description = "是否地市自购0是 1 否")
@ExcelProperty("是否地市自购0是 1 否")
private String isAddress;
/**
* 就职岗位
*/
@ExcelAttribute(name = "就职岗位")
@Schema(description = "就职岗位")
@ExcelProperty("就职岗位")
private String position;
/**
* 数据来源1客户端 2客服端
*/
@ExcelAttribute(name = "数据来源1客户端 2客服端")
@Schema(description = "数据来源1客户端 2客服端")
@ExcelProperty("数据来源1客户端 2客服端")
private String dataSource;
/**
* 购买地-省
*/
@ExcelAttribute(name = "购买地-省")
@Schema(description = "购买地-省")
@ExcelProperty("购买地-省")
private String fileProvince;
/**
* 购买地-市
*/
@ExcelAttribute(name = "购买地-市")
@Schema(description = "购买地-市")
@ExcelProperty("购买地-市")
private String fileCity;
/**
* 购买地-省id
*/
@ExcelAttribute(name = "购买地-省id")
@Schema(description = "购买地-省id")
@ExcelProperty("购买地-省id")
private String provinceCode;
/**
* 购买地-市id
*/
@ExcelAttribute(name = "购买地-市id")
@Schema(description = "购买地-市id")
@ExcelProperty("购买地-市id")
private String cityCode;
/**
* 入离职登记主表id
*/
@ExcelAttribute(name = "入离职登记主表id")
@Schema(description = "入离职登记主表id")
@ExcelProperty("入离职登记主表id")
private String registerId;
/**
* 替换员工姓名
*/
@ExcelAttribute(name = "替换员工姓名")
@Schema(description = "替换员工姓名")
@ExcelProperty("替换员工姓名")
private String replaceEmployeeName;
/**
* 替换身份证号
*/
@ExcelAttribute(name = "替换身份证号")
@Schema(description = "替换身份证号")
@ExcelProperty("替换身份证号")
private String replaceEmpIdcard;
/**
* 替换项目编码
*/
@ExcelAttribute(name = "替换项目编码")
@Schema(description = "替换项目编码")
@ExcelProperty("替换项目编码")
private String replaceDeptNo;
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.MenuUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeinsurancepre" )
@Tag(name = "商险待办任务表管理")
public class TEmployeeInsurancePreController {
private final TEmployeeInsurancePreService tEmployeeInsurancePreService;
private final MenuUtil menuUtil;
/**
* 简单分页查询
* @param page 分页对象
* @param tEmployeeInsurancePre 商险待办任务表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TEmployeeInsurancePre>> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, TEmployeeInsurancePreSearchVo tEmployeeInsurancePre) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, tEmployeeInsurancePre);
return new R<>(tEmployeeInsurancePreService.getTEmployeeInsurancePrePage(page,tEmployeeInsurancePre));
}
/**
* 通过id查询商险待办任务表
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('insurances_temployeeinsurancepre_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_get')" )
public R<TEmployeeInsurancePre> getById(@PathVariable("id" ) String id) {
return R.ok(tEmployeeInsurancePreService.getById(id));
}
/**
* 新增商险待办任务表
* @param tEmployeeInsurancePre 商险待办任务表
* @return R
*/
@Operation(summary = "新增商险待办任务表", description = "新增商险待办任务表:hasPermission('insurances_temployeeinsurancepre_add')")
@SysLog("新增商险待办任务表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_add')" )
public R<Boolean> save(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) {
return R.ok(tEmployeeInsurancePreService.save(tEmployeeInsurancePre));
}
/**
* 修改商险待办任务表
* @param tEmployeeInsurancePre 商险待办任务表
* @return R
*/
@Operation(summary = "修改商险待办任务表", description = "修改商险待办任务表:hasPermission('insurances_temployeeinsurancepre_edit')")
@SysLog("修改商险待办任务表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_edit')" )
public R<Boolean> updateById(@RequestBody TEmployeeInsurancePre tEmployeeInsurancePre) {
return R.ok(tEmployeeInsurancePreService.updateById(tEmployeeInsurancePre));
}
/**
* 通过id删除商险待办任务表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除商险待办任务表", description = "通过id删除商险待办任务表:hasPermission('insurances_temployeeinsurancepre_del')")
@SysLog("通过id删除商险待办任务表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tEmployeeInsurancePreService.removeById(id));
}
/**
* 商险待办任务表 批量导出
* @author huych
* @date 2025-03-31 12:25:13
**/
@Operation(description = "导出商险待办任务表 hasPermission('insurances_temployeeinsurancepre-export')")
@PostMapping("/export")
@PreAuthorize("@pms.hasPermission('insurances_temployeeinsurancepre-export')")
public void export(HttpServletResponse response, @RequestBody TEmployeeInsurancePreSearchVo searchVo) {
tEmployeeInsurancePreService.listExport(response,searchVo);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Mapper
public interface TEmployeeInsurancePreMapper extends BaseMapper<TEmployeeInsurancePre> {
/**
* 商险待办任务表简单分页查询
* @param tEmployeeInsurancePre 商险待办任务表
* @return
*/
IPage<TEmployeeInsurancePre> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, @Param("tEmployeeInsurancePre") TEmployeeInsurancePre tEmployeeInsurancePre);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import javax.servlet.http.HttpServletResponse;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
public interface TEmployeeInsurancePreService extends IService<TEmployeeInsurancePre> {
/**
* 商险待办任务表简单分页查询
* @param tEmployeeInsurancePre 商险待办任务表
* @return
*/
IPage<TEmployeeInsurancePre> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, TEmployeeInsurancePreSearchVo tEmployeeInsurancePre);
void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TEmployeeInsurancePreSearchVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
/**
* 商险待办任务表
*
* @author huych
* @date 2025-03-31 12:25:13
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsurancePreMapper, TEmployeeInsurancePre> implements TEmployeeInsurancePreService {
@Autowired
private ArchivesDaprUtil archivesDaprUtil;
/**
* 商险待办任务表简单分页查询
*
* @param tEmployeeInsurancePre 商险待办任务表
* @return
*/
@Override
public IPage<TEmployeeInsurancePre> getTEmployeeInsurancePrePage(Page<TEmployeeInsurancePre> page, TEmployeeInsurancePreSearchVo tEmployeeInsurancePre) {
//权限赋值
initSearchVo(tEmployeeInsurancePre);
return baseMapper.getTEmployeeInsurancePrePage(page, tEmployeeInsurancePre);
}
/**
* 商险待办任务表批量导出
*
* @param tEmployeeInsurancePre 商险待办任务表
* @return
*/
@Override
public void listExport(HttpServletResponse response, TEmployeeInsurancePreSearchVo searchVo) {
String fileName = "商险待办任务表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TEmployeeInsurancePre> list = new ArrayList<>();
long count = 0;
try (ServletOutputStream out= response.getOutputStream();){
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TEmployeeInsurancePre.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
// list = noPageDiy(searchVo);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("商险待办任务表" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("商险待办任务表" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
excelWriter.finish();
} catch (Exception e) {
log.error("执行异常", e);
}
}
/**
* @Description: 获取前端客服的所有项目权限
* @Author: huych
* @Date: 2025/3/13 17:02
* @return:
**/
public void initSearchVo(TEmployeeInsurancePreSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
if (isSsc || CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
searchVo.setAuthSql(null);
return;
}
if (Common.isNotNull(searchVo.getType()) && CommonConstants.ONE_STRING.equals(searchVo.getType())) {
searchVo.setAuthSql(null);
//获取项目信息
R<TSettleDomainRegistListVo> domainR = archivesDaprUtil.getAllDeptByCustomerLoginName(user.getUsername());
if (null != domainR && null != domainR.getData() && null != domainR.getData().getDeptNos()) {
searchVo.setDeptNoList(domainR.getData().getDeptNos());
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
}
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
for (Long role : roleList) {
if (role == roleId) {
return true;
}
}
return false;
}
}
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper">
<resultMap id="tEmployeeInsurancePreMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre">
<id property="id" column="id"/>
<result property="employeeName" column="employee_name"/>
<result property="empIdcard" column="emp_idcard"/>
<result property="empPhone" column="emp_phone"/>
<result property="joinLeaveDate" column="join_leave_date"/>
<result property="processStatus" column="process_status"/>
<result property="customerUsername" column="customer_username"/>
<result property="customerUserLoginname" column="customer_user_loginname"/>
<result property="deptName" column="dept_name"/>
<result property="deptNo" column="dept_no"/>
<result property="deptId" column="dept_id"/>
<result property="expectedCollectionTime" column="expected_collection_time"/>
<result property="registUser" column="regist_user"/>
<result property="registTime" column="regist_time"/>
<result property="customerUsernameNew" column="customer_username_new"/>
<result property="insuranceCompanyName" column="insurance_company_name"/>
<result property="insuranceTypeName" column="insurance_type_name"/>
<result property="insuranceTypeId" column="insurance_type_id"/>
<result property="buyStandard" column="buy_standard"/>
<result property="buyType" column="buy_type"/>
<result property="policyStart" column="policy_start"/>
<result property="policyEnd" column="policy_end"/>
<result property="isAddress" column="is_address"/>
<result property="position" column="position"/>
<result property="dataSource" column="data_source"/>
<result property="fileProvince" column="file_province"/>
<result property="fileCity" column="file_city"/>
<result property="provinceCode" column="province_code"/>
<result property="cityCode" column="city_code"/>
<result property="registerId" column="register_id"/>
<result property="replaceEmployeeName" column="replace_employee_name"/>
<result property="replaceEmpIdcard" column="replace_emp_idcard"/>
<result property="replaceDeptNo" column="replace_dept_no"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.employee_name,
a.emp_idcard,
a.emp_phone,
a.join_leave_date,
a.process_status,
a.customer_username,
a.customer_user_loginname,
a.dept_name,
a.dept_no,
a.dept_id,
a.expected_collection_time,
a.regist_user,
a.regist_time,
a.customer_username_new,
a.insurance_company_name,
a.insurance_type_name,
a.insurance_type_id,
a.buy_standard,
a.buy_type,
a.policy_start,
a.policy_end,
a.is_address,
a.position,
a.data_source,
a.file_province,
a.file_city,
a.province_code,
a.city_code,
a.register_id,
a.replace_employee_name,
a.replace_emp_idcard,
a.replace_dept_no,
a.create_by,
a.create_name,
a.create_time,
a.update_by,
a.update_time
</sql>
<sql id="tEmployeeInsurancePre_where">
<if test="tEmployeeInsurancePre != null">
<if test="tEmployeeInsurancePre.id != null and tEmployeeInsurancePre.id.trim() != ''">
AND a.id = #{tEmployeeInsurancePre.id}
</if>
<if test="tEmployeeInsurancePre.employeeName != null and tEmployeeInsurancePre.employeeName.trim() != ''">
AND a.employee_name like CONCAT('%',#{tEmployeeInsurancePre.employeeName},'%')
</if>
<if test="tEmployeeInsurancePre.empIdcard != null and tEmployeeInsurancePre.empIdcard.trim() != ''">
AND a.emp_idcard like CONCAT('%',#{tEmployeeInsurancePre.empIdcard},'%')
</if>
<if test="tEmployeeInsurancePre.empPhone != null and tEmployeeInsurancePre.empPhone.trim() != ''">
AND a.emp_phone like CONCAT('%',#{tEmployeeInsurancePre.empPhone},'%')
</if>
<if test="tEmployeeInsurancePre.joinLeaveDate != null">
AND a.join_leave_date = #{tEmployeeInsurancePre.joinLeaveDate}
</if>
<if test="tEmployeeInsurancePre.processStatus != null and tEmployeeInsurancePre.processStatus.trim() != ''">
AND a.process_status = #{tEmployeeInsurancePre.processStatus}
</if>
<if test="tEmployeeInsurancePre.statusList != null and tEmployeeInsurancePre.statusList.size() > 0">
AND a.process_status in
<foreach item="item" index="index" collection="tEmployeeInsurancePre.statusList" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="tEmployeeInsurancePre.customerUsername != null and tEmployeeInsurancePre.customerUsername.trim() != ''">
AND a.customer_username = #{tEmployeeInsurancePre.customerUsername}
</if>
<if test="tEmployeeInsurancePre.customerUserLoginname != null and tEmployeeInsurancePre.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{tEmployeeInsurancePre.customerUserLoginname}
</if>
<if test="tEmployeeInsurancePre.deptName != null and tEmployeeInsurancePre.deptName.trim() != ''">
AND a.dept_name like CONCAT('%',#{tEmployeeInsurancePredeptName},'%')
</if>
<if test="tEmployeeInsurancePre.deptNo != null and tEmployeeInsurancePre.deptNo.trim() != ''">
AND a.dept_no = #{tEmployeeInsurancePre.deptNo}
</if>
<if test="tEmployeeInsurancePre.deptId != null and tEmployeeInsurancePre.deptId.trim() != ''">
AND a.dept_id = #{tEmployeeInsurancePre.deptId}
</if>
<if test="tEmployeeInsurancePre.expectedCollectionTime != null">
AND a.expected_collection_time = #{tEmployeeInsurancePre.expectedCollectionTime}
</if>
<if test="tEmployeeInsurancePre.registUser != null and tEmployeeInsurancePre.registUser.trim() != ''">
AND a.regist_user = #{tEmployeeInsurancePre.registUser}
</if>
<if test="tEmployeeInsurancePre.registTime != null">
AND a.regist_time = #{tEmployeeInsurancePre.registTime}
</if>
<if test="tEmployeeInsurancePre.customerUsernameNew != null and tEmployeeInsurancePre.customerUsernameNew.trim() != ''">
AND a.customer_username_new = #{tEmployeeInsurancePre.customerUsernameNew}
</if>
<if test="tEmployeeInsurancePre.insuranceCompanyName != null and tEmployeeInsurancePre.insuranceCompanyName.trim() != ''">
AND a.insurance_company_name = #{tEmployeeInsurancePre.insuranceCompanyName}
</if>
<if test="tEmployeeInsurancePre.insuranceTypeName != null and tEmployeeInsurancePre.insuranceTypeName.trim() != ''">
AND a.insurance_type_name = #{tEmployeeInsurancePre.insuranceTypeName}
</if>
<if test="tEmployeeInsurancePre.insuranceTypeId != null">
AND a.insurance_type_id = #{tEmployeeInsurancePre.insuranceTypeId}
</if>
<if test="tEmployeeInsurancePre.buyStandard != null and tEmployeeInsurancePre.buyStandard.trim() != ''">
AND a.buy_standard = #{tEmployeeInsurancePre.buyStandard}
</if>
<if test="tEmployeeInsurancePre.buyType != null">
AND a.buy_type = #{tEmployeeInsurancePre.buyType}
</if>
<if test="tEmployeeInsurancePre.policyStart != null">
AND a.policy_start = #{tEmployeeInsurancePre.policyStart}
</if>
<if test="tEmployeeInsurancePre.policyEnd != null">
AND a.policy_end = #{tEmployeeInsurancePre.policyEnd}
</if>
<if test="tEmployeeInsurancePre.isAddress != null and tEmployeeInsurancePre.isAddress.trim() != ''">
AND a.is_address = #{tEmployeeInsurancePre.isAddress}
</if>
<if test="tEmployeeInsurancePre.position != null and tEmployeeInsurancePre.position.trim() != ''">
AND a.position = #{tEmployeeInsurancePre.position}
</if>
<if test="tEmployeeInsurancePre.dataSource != null and tEmployeeInsurancePre.dataSource.trim() != ''">
AND a.data_source = #{tEmployeeInsurancePre.dataSource}
</if>
<if test="tEmployeeInsurancePre.fileProvince != null and tEmployeeInsurancePre.fileProvince.trim() != ''">
AND a.file_province = #{tEmployeeInsurancePre.fileProvince}
</if>
<if test="tEmployeeInsurancePre.fileCity != null and tEmployeeInsurancePre.fileCity.trim() != ''">
AND a.file_city = #{tEmployeeInsurancePre.fileCity}
</if>
<if test="tEmployeeInsurancePre.provinceCode != null and tEmployeeInsurancePre.provinceCode.trim() != ''">
AND a.province_code = #{tEmployeeInsurancePre.provinceCode}
</if>
<if test="tEmployeeInsurancePre.cityCode != null and tEmployeeInsurancePre.cityCode.trim() != ''">
AND a.city_code = #{tEmployeeInsurancePre.cityCode}
</if>
<if test="tEmployeeInsurancePre.registerId != null and tEmployeeInsurancePre.registerId.trim() != ''">
AND a.register_id = #{tEmployeeInsurancePre.registerId}
</if>
<if test="tEmployeeInsurancePre.createBy != null and tEmployeeInsurancePre.createBy.trim() != ''">
AND a.create_by = #{tEmployeeInsurancePre.createBy}
</if>
<if test="tEmployeeInsurancePre.authSql != null and tEmployeeInsurancePre.authSql.trim() != ''">
${tEmployeeInsurancePre.authSql}
</if>
<if test="tEmployeeInsurancePre.deptNoList != null and tEmployeeInsurancePre.deptNoList.size > 0">
AND a.dept_no in
<foreach item="idStr" index="index" collection="tEmployeeInsurancePre.deptNoList" open="(" separator=","
close=")">
#{idStr}
</foreach>
</if>
</if>
</sql>
<!--tEmployeeInsurancePre简单分页查询-->
<select id="getTEmployeeInsurancePrePage" resultMap="tEmployeeInsurancePreMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_insurance_pre a
<where>
1=1
<include refid="tEmployeeInsurancePre_where"/>
</where>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment