Commit 1e2fff65 authored by hongguangwu's avatar hongguangwu

派单导出+档案导入

parent ec284ebc
...@@ -1184,7 +1184,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1184,7 +1184,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 户籍所在地 // 户籍所在地
if (Common.isNotNull(excel.getIdProvince())) { if (Common.isNotNull(excel.getIdProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1192,7 +1192,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1192,7 +1192,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdCity())) { if (Common.isNotNull(excel.getIdCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1200,7 +1200,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1200,7 +1200,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdTown())) { if (Common.isNotNull(excel.getIdTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1209,7 +1209,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1209,7 +1209,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 档案所在地 // 档案所在地
if (Common.isNotNull(excel.getFileProvince())) { if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1217,7 +1217,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1217,7 +1217,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileCity())) { if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1225,7 +1225,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1225,7 +1225,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileTown())) { if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1695,7 +1695,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1695,7 +1695,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 户籍所在地 // 户籍所在地
if (Common.isNotNull(excel.getIdProvince())) { if (Common.isNotNull(excel.getIdProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1703,7 +1703,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1703,7 +1703,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdCity())) { if (Common.isNotNull(excel.getIdCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdCity() + CommonConstants.DOWN_LINE_STRING + excel.getIdProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1711,7 +1711,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1711,7 +1711,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getIdTown())) { if (Common.isNotNull(excel.getIdTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getIdTown() + CommonConstants.DOWN_LINE_STRING + excel.getIdCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1720,7 +1720,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1720,7 +1720,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
// 档案所在地 // 档案所在地
if (Common.isNotNull(excel.getFileProvince())) { if (Common.isNotNull(excel.getFileProvince())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1728,7 +1728,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1728,7 +1728,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileCity())) { if (Common.isNotNull(excel.getFileCity())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileCity() + CommonConstants.DOWN_LINE_STRING + excel.getFileProvince().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
...@@ -1736,7 +1736,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1736,7 +1736,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
} }
if (Common.isNotNull(excel.getFileTown())) { if (Common.isNotNull(excel.getFileTown())) {
areaStr = ExcelUtil.getRedisAreaValue("area_" + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim()); areaStr = ExcelUtil.getRedisAreaValue(CacheConstants.AREA_VALUE + excel.getFileTown() + CommonConstants.DOWN_LINE_STRING + excel.getFileCity().trim());
if (Common.isEmpty(areaStr)) { if (Common.isEmpty(areaStr)) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard())); errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_FILE_AREA_ERROR, excel.getEmpIdcard()));
} else { } else {
......
...@@ -96,7 +96,7 @@ public class TDispatchInfo extends BaseEntity { ...@@ -96,7 +96,7 @@ public class TDispatchInfo extends BaseEntity {
* 员工类型 * 员工类型
*/ */
@Length(max = 32, message = "员工类型 不能超过32个字符" ) @Length(max = 32, message = "员工类型 不能超过32个字符" )
@ExcelAttribute(name = "员工类型", maxLength = 32) @ExcelAttribute(name = "员工类型", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型" ) @Schema(description = "员工类型" )
@ExcelProperty("员工类型" ) @ExcelProperty("员工类型" )
private String empType; private String empType;
...@@ -112,7 +112,7 @@ public class TDispatchInfo extends BaseEntity { ...@@ -112,7 +112,7 @@ public class TDispatchInfo extends BaseEntity {
* 民族 * 民族
*/ */
@Length(max = 32, message = "民族 不能超过32个字符" ) @Length(max = 32, message = "民族 不能超过32个字符" )
@ExcelAttribute(name = "民族", maxLength = 32) @ExcelAttribute(name = "民族", isDataId = true,dataType = ExcelAttributeConstants.EMP_NATIONAL)
@Schema(description = "民族" ) @Schema(description = "民族" )
@ExcelProperty("民族" ) @ExcelProperty("民族" )
private String empNational; private String empNational;
......
/*
* 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.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 派单导出Vo
* @author hgw
* @date 2022-7-28 10:40:34
*/
@Data
@Schema(description = "派单导出Vo")
public class TDispatchInfoExportVo {
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
@ExcelAttribute(name = "申请编码", maxLength = 30)
@Schema(description = "申请编码")
@ExcelProperty("申请编码")
private String dispatchCode;
@ExcelAttribute(name = "员工编码", maxLength = 30)
@Schema(description = "员工编码")
@ExcelProperty("员工编码")
private String empNo;
@ExcelAttribute(name = "员工姓名", maxLength = 50)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
@ExcelAttribute(name = "身份证号", maxLength = 20)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
@ExcelAttribute(name = "员工类型", isDataId = true, dataType = ExcelAttributeConstants.EMP_NATRUE)
@Schema(description = "员工类型")
@ExcelProperty("员工类型")
private String empType;
@ExcelAttribute(name = "社保公积金类型", readConverterExp = "0=社保,1=公积金")
@Schema(description = "社保公积金类型:0社保1公积金")
@ExcelProperty("社保公积金类型")
private String typeSub;
@ExcelAttribute(name = "单位名称", maxLength = 50)
@Schema(description = "单位名称")
@ExcelProperty("单位名称")
private String belongUnitName;
@ExcelAttribute(name = "项目名称", maxLength = 50)
@Schema(description = "项目名称")
@ExcelProperty("项目名称")
private String settleDomainName;
@ExcelAttribute(name = "项目编码", maxLength = 50)
@Schema(description = "项目编码")
@ExcelProperty("项目编码")
private String settleDomainCode;
@ExcelAttribute(name = "派单类型", readConverterExp = "0=增加派单,1=减少派单")
@Schema(description = "派单类型:0派增1派减")
@ExcelProperty("派单类型")
private String type;
@ExcelAttribute(name = "派单项", maxLength = 50)
@Schema(description = "派单项:如 养老、公积金")
@ExcelProperty("派单项")
private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 32)
@Schema(description = "社保户")
@ExcelProperty("社保户")
private String socialHouseholdName;
@ExcelAttribute(name = "公积金户", maxLength = 32)
@Schema(description = "公积金户")
@ExcelProperty("公积金户")
private String providentHouseholdName;
@ExcelAttribute(name = "审核状态", readConverterExp = "1=待审核,2=审核通过,3=审核不通过")
@Schema(description = "审核状态:1待审核2审核通过3审核不通过")
@ExcelProperty("审核状态")
private String status;
@ExcelAttribute(name = "社保办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=部分办理成功,4=办理中")
@Schema(description = "社保办理状态 0 待办理 1 办理成功 2 办理失败 3 部分办理成功 4 办理中")
@ExcelProperty("社保办理状态")
private String socialHandleStatus;
@ExcelAttribute(name = "公积金办理状态", readConverterExp = "0=待办理,1=办理成功,2=办理失败,3=已派减")
@Schema(description = "公积金办理状态:0 待办理 1办理成功 2 办理失败 3 已派减")
@ExcelProperty("公积金办理状态")
private String fundHandleStatus;
@Schema(description = "申请人")
@ExcelProperty("申请人")
private String createName;
@ExcelAttribute(name = "申请人所在部门", maxLength = 50)
@Schema(description = "申请人所在部门")
@ExcelProperty("申请人所在部门")
private String organName;
@Schema(description = "申请时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@ExcelProperty("申请时间")
private LocalDateTime createTime;
}
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.vo; package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/** /**
* 派单信息记录表 * 派单信息记录表
...@@ -31,28 +34,34 @@ import java.time.LocalDateTime; ...@@ -31,28 +34,34 @@ import java.time.LocalDateTime;
@Data @Data
public class TDispatchInfoSearchVo extends TDispatchInfo { public class TDispatchInfoSearchVo extends TDispatchInfo {
/** @TableField(exist = false)
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
@Schema(description = "选中的idList")
private List<String> idList;
/**
* 多选导出或删除等操作 * 多选导出或删除等操作
*/ */
@Schema(description = "选中ID,多个逗号分割") @Schema(description = "选中ID,多个逗号分割")
private String ids; private String ids;
/** /**
* 创建时间区间 [开始时间,结束时间] * 创建时间区间 [开始时间,结束时间]
*/ */
@Schema(description = "创建时间区间") @Schema(description = "创建时间区间")
private LocalDateTime[] createTimes; private LocalDateTime[] createTimes;
/** /**
* @Author fxj * @Author fxj
* 查询数据起 * 查询数据起
**/ **/
@Schema(description = "查询limit 开始") @Schema(description = "查询limit 开始")
private int limitStart; private int limitStart;
/** /**
* @Author fxj * @Author fxj
* 查询数据止 * 查询数据止
**/ **/
@Schema(description = "查询limit 数据条数") @Schema(description = "查询limit 数据条数")
private int limitEnd; private int limitEnd;
} }
...@@ -205,12 +205,12 @@ public class TDispatchInfoController { ...@@ -205,12 +205,12 @@ public class TDispatchInfoController {
/** /**
* 派单信息记录表 批量导出 * 派单信息记录表 批量导出
* @author fxj * @author hgw
* @date 2022-07-15 11:38:05 * @date 2022-7-28 11:01:56
**/ **/
@Operation(description = "导出派单信息记录表 hasPermission('demo_tdispatchinfo-export')") @Operation(description = "导出派单信息记录表 hasPermission('tdispatchinfo-export')")
@PostMapping("/export") @PostMapping("/export")
@PreAuthorize("@pms.hasPermission('demo_tdispatchinfo-export')") @PreAuthorize("@pms.hasPermission('tdispatchinfo-export')")
public void export(HttpServletResponse response, @RequestBody TDispatchInfoSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TDispatchInfoSearchVo searchVo) {
tDispatchInfoService.listExport(response,searchVo); tDispatchInfoService.listExport(response,searchVo);
} }
......
...@@ -21,9 +21,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,9 +21,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 派单信息记录表 * 派单信息记录表
* *
...@@ -38,4 +42,13 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> { ...@@ -38,4 +42,13 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
* @return * @return
*/ */
IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfo tDispatchInfo); IPage<TDispatchInfo> getTDispatchInfoPage(Page<TDispatchInfo> page, @Param("tDispatchInfo") TDispatchInfo tDispatchInfo);
/**
* @Description: 派单导出
* @Author: hgw
* @Date: 2022/7/28 10:45
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo>
**/
List<TDispatchInfoExportVo> exportDispatch(@Param("tDispatchInfo") TDispatchInfoSearchVo tDispatchInfo);
} }
...@@ -46,10 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.*; ...@@ -46,10 +46,7 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil; import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.DispatchDetailVo; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -103,9 +100,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -103,9 +100,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo) { public void listExport(HttpServletResponse response, TDispatchInfoSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "派单批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TDispatchInfo> list = new ArrayList<>(); List<TDispatchInfoExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
...@@ -114,22 +111,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -114,22 +111,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭 // 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TDispatchInfo.class).build(); ExcelWriter excelWriter = EasyExcel.write(out, TDispatchInfoExportVo.class).includeColumnFiledNames(searchVo.getExportFields()).build();
int index = 0; int index = 0;
if (count > CommonConstants.ZERO_INT) { if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) { for (int i = 0; i <= count; ) {
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = exportDispatch(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
ExcelUtil<TDispatchInfo> util = new ExcelUtil<>(TDispatchInfo.class); ExcelUtil<TDispatchInfoExportVo> util = new ExcelUtil<>(TDispatchInfoExportVo.class);
for (TDispatchInfo vo : list) { for (TDispatchInfoExportVo vo : list) {
util.convertEntity(vo, null, null, null); util.convertEntity(vo, null, null, null);
} }
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("派单信息记录表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("派单" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
index++; index++;
} }
...@@ -139,7 +136,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -139,7 +136,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
} else { } else {
WriteSheet writeSheet = EasyExcel.writerSheet("派单信息记录表" + index).build(); WriteSheet writeSheet = EasyExcel.writerSheet("派单" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
} }
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
...@@ -163,8 +160,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -163,8 +160,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
@Override @Override
public List<TDispatchInfo> noPageDiy(TDispatchInfoSearchVo searchVo) { public List<TDispatchInfo> noPageDiy(TDispatchInfoSearchVo searchVo) {
LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList;
if (Common.isNotNull(idList)) { if (Common.isNotNull(searchVo.getIds())) {
idList = Common.getList(searchVo.getIds());
wrapper.in(TDispatchInfo::getId, idList);
} else if (searchVo.getIdList() != null) {
idList = searchVo.getIdList();
wrapper.in(TDispatchInfo::getId, idList); wrapper.in(TDispatchInfo::getId, idList);
} }
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) { if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
...@@ -174,10 +175,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -174,10 +175,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
private List<TDispatchInfoExportVo> exportDispatch(TDispatchInfoSearchVo searchVo) {
if (Common.isNotNull(searchVo.getIds())) {
List<String> idList = Common.getList(searchVo.getIds());
searchVo.setIdList(idList);
}
return baseMapper.exportDispatch(searchVo);
}
private Long noPageCountDiy(TDispatchInfoSearchVo searchVo) { private Long noPageCountDiy(TDispatchInfoSearchVo searchVo) {
LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo); LambdaQueryWrapper<TDispatchInfo> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds()); List<String> idList;
if (Common.isNotNull(idList)) { if (Common.isNotNull(searchVo.getIds())) {
idList = Common.getList(searchVo.getIds());
wrapper.in(TDispatchInfo::getId, idList);
} else if (searchVo.getIdList() != null) {
idList = searchVo.getIdList();
wrapper.in(TDispatchInfo::getId, idList); wrapper.in(TDispatchInfo::getId, idList);
} }
return baseMapper.selectCount(wrapper); return baseMapper.selectCount(wrapper);
......
...@@ -97,6 +97,31 @@ ...@@ -97,6 +97,31 @@
</resultMap> </resultMap>
<!-- 派单导出vo -->
<resultMap id="exportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchInfoExportVo">
<id property="id" column="ID"/>
<result property="dispatchCode" column="DISPATCH_CODE"/>
<result property="empNo" column="EMP_NO"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="typeSub" column="TYPE_SUB"/>
<result property="belongUnitName" column="BELONG_UNIT_NAME"/>
<result property="settleDomainName" column="SETTLE_DOMAIN_NAME"/>
<result property="settleDomainCode" column="SETTLE_DOMAIN_CODE"/>
<result property="type" column="TYPE"/>
<result property="dispatchItem" column="DISPATCH_ITEM"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="providentHouseholdName" column="PROVIDENT_HOUSEHOLD_NAME"/>
<result property="status" column="STATUS"/>
<result property="socialHandleStatus" column="SOCIAL_HANDLE_STATUS"/>
<result property="fundHandleStatus" column="FUND_HANDLE_STATUS"/>
<result property="createName" column="CREATE_NAME"/>
<result property="organName" column="ORGAN_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
a.EMP_ID, a.EMP_ID,
...@@ -170,6 +195,12 @@ ...@@ -170,6 +195,12 @@
</sql> </sql>
<sql id="tDispatchInfo_where"> <sql id="tDispatchInfo_where">
<if test="tDispatchInfo != null"> <if test="tDispatchInfo != null">
<if test="tDispatchInfo.idList != null">
AND a.ID in
<foreach item="idStr" index="index" collection="tDispatchInfo.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''"> <if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''">
AND a.ID = #{tDispatchInfo.id} AND a.ID = #{tDispatchInfo.id}
</if> </if>
...@@ -355,5 +386,42 @@ ...@@ -355,5 +386,42 @@
1=1 1=1
<include refid="tDispatchInfo_where"/> <include refid="tDispatchInfo_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select>
<!-- 派单导出 -->
<select id="exportDispatch" resultMap="exportMap">
select
a.ID,
a.DISPATCH_CODE,
a.EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.EMP_TYPE,
a.TYPE_SUB,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.SETTLE_DOMAIN_CODE,
a.TYPE,
a.DISPATCH_ITEM,
s.SOCIAL_HOUSEHOLD_NAME,
f.PROVIDENT_HOUSEHOLD_NAME,
a.STATUS,
a.SOCIAL_HANDLE_STATUS,
a.FUND_HANDLE_STATUS,
a.CREATE_NAME,
a.ORGAN_NAME,
a.CREATE_TIME
from t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
left join t_provident_fund f on f.id=a.FUND_ID
<where>
1=1
<include refid="tDispatchInfo_where"/>
</where>
order by a.CREATE_TIME desc
<if test="tSocialFundInfo.limitStart != null">
limit #{tDispatchInfo.limitStart},#{tDispatchInfo.limitEnd}
</if>
</select> </select>
</mapper> </mapper>
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
<sql id="tSocialFundInfo_where"> <sql id="tSocialFundInfo_where">
<if test="tSocialFundInfo != null"> <if test="tSocialFundInfo != null">
<if test="tSocialFundInfo.idList != null"> <if test="tSocialFundInfo.idList != null">
AND a.id in AND a.ID in
<foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")"> <foreach item="idStr" index="index" collection="tSocialFundInfo.idList" open="(" separator="," close=")">
#{idStr} #{idStr}
</foreach> </foreach>
......
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