Commit 009d0096 authored by hongguangwu's avatar hongguangwu

MVP1.6.9-社保自动化日志

parent e5c2638d
...@@ -17,16 +17,10 @@ ...@@ -17,16 +17,10 @@
package com.yifu.cloud.plus.v1.yifu.social.vo; package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 自动化日志 * 自动化日志
...@@ -35,49 +29,27 @@ import java.util.Date; ...@@ -35,49 +29,27 @@ import java.util.Date;
* @date 2024-08-30 10:27:16 * @date 2024-08-30 10:27:16
*/ */
@Data @Data
public class TSocialSoldierLogExportVo extends RowIndex implements Serializable { public class TSocialSoldierLogExportVo implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名") @ExcelProperty("员工姓名")
private String empName; private String empName;
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号 不能为空", maxLength = 20)
@Schema(description = "身份证号")
@ExcelProperty("身份证号") @ExcelProperty("身份证号")
private String empIdcard; private String empIdcard;
@ExcelAttribute(name = "日期", isDate = true, dateFormat = "yyyy-MM-dd HH:mm")
@Schema(description = "日期")
@ExcelProperty("日期") @ExcelProperty("日期")
private Date createTime; private LocalDateTime createTime;
@ExcelAttribute(name = "派单项", maxLength = 2) @ExcelProperty("派单项")
@Length(max = 2, message = "派单项:社保;医保不能超过2个字符")
@ExcelProperty("派单项:社保;医保")
@Schema(description = "派单项:社保;医保")
private String dispatchItem; private String dispatchItem;
@ExcelAttribute(name = "社保户", maxLength = 50)
@Length(max = 2, message = "社保户不能超过50个字符")
@ExcelProperty("社保户") @ExcelProperty("社保户")
@Schema(description = "社保户")
private String socialHuName; private String socialHuName;
@ExcelAttribute(name = "类型", maxLength = 2) @ExcelProperty("类型")
@Length(max = 2, message = "类型:提交;审核不能超过2个字符")
@ExcelProperty("类型:提交;审核")
@Schema(description = "类型:提交;审核")
private String type; private String type;
@Length(max = 50, message = "结果 不能超过50 个字符")
@ExcelAttribute(name = "结果", maxLength = 50)
@Schema(description = "结果")
@ExcelProperty("结果") @ExcelProperty("结果")
private String remark; private String remark;
......
...@@ -137,7 +137,7 @@ public class TSocialSoldierLogController { ...@@ -137,7 +137,7 @@ public class TSocialSoldierLogController {
**/ **/
@Operation(description = "导出自动化日志 hasPermission('social_tsocialsoldierlog_export')") @Operation(description = "导出自动化日志 hasPermission('social_tsocialsoldierlog_export')")
@PostMapping("/export") @PostMapping("/export")
@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_export')") //@PreAuthorize("@pms.hasPermission('social_tsocialsoldierlog_export')")
public void export(HttpServletResponse response, @RequestBody TSocialSoldierLogSearchVo searchVo) { public void export(HttpServletResponse response, @RequestBody TSocialSoldierLogSearchVo searchVo) {
tSocialSoldierLogService.listExport(response, searchVo); tSocialSoldierLogService.listExport(response, searchVo);
} }
......
...@@ -21,10 +21,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -21,10 +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.TSocialSoldierLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialSoldierLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo; import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogSearchVo;
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;
/** /**
* 自动化日志 * 自动化日志
* *
...@@ -40,4 +43,7 @@ public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> { ...@@ -40,4 +43,7 @@ public interface TSocialSoldierLogMapper extends BaseMapper<TSocialSoldierLog> {
* @return * @return
*/ */
IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, @Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog); IPage<TSocialSoldierLog> getTSocialSoldierLogPage(Page<TSocialSoldierLog> page, @Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
List<TSocialSoldierLogExportVo> getTSocialSoldierLogList(@Param("tSocialSoldierLog") TSocialSoldierLogSearchVo tSocialSoldierLog);
} }
...@@ -73,7 +73,7 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM ...@@ -73,7 +73,7 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM
public void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo) { public void listExport(HttpServletResponse response, TSocialSoldierLogSearchVo searchVo) {
String fileName = "自动化日志批量导出" + DateUtil.getThisTime() + ".xlsx"; String fileName = "自动化日志批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表 //获取要导出的列表
List<TSocialSoldierLog> list = new ArrayList<>(); List<TSocialSoldierLogExportVo> list = new ArrayList<>();
long count = noPageCountDiy(searchVo); long count = noPageCountDiy(searchVo);
ServletOutputStream out = null; ServletOutputStream out = null;
try { try {
...@@ -90,7 +90,7 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM ...@@ -90,7 +90,7 @@ public class TSocialSoldierLogServiceImpl extends ServiceImpl<TSocialSoldierLogM
// 获取实际记录 // 获取实际记录
searchVo.setLimitStart(i); searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT); searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo); list = baseMapper.getTSocialSoldierLogList(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
writeSheet = EasyExcelFactory.writerSheet("自动化日志" + index).build(); writeSheet = EasyExcelFactory.writerSheet("自动化日志" + index).build();
excelWriter.write(list, writeSheet); excelWriter.write(list, writeSheet);
......
...@@ -113,5 +113,23 @@ ...@@ -113,5 +113,23 @@
1=1 1=1
<include refid="tSocialSoldierLog_where"/> <include refid="tSocialSoldierLog_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select>
<!--tSocialSoldierLog简单分页查询-->
<select id="getTSocialSoldierLogList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.TSocialSoldierLogExportVo">
SELECT
<include refid="Base_Column_List"/>
FROM t_social_soldier_log a
<where>
1=1
<include refid="tSocialSoldierLog_where"/>
</where>
order by a.CREATE_TIME desc
<if test="tSocialSoldierLog != null">
<if test="tSocialSoldierLog.limitStart != null">
limit #{tSocialSoldierLog.limitStart},#{tSocialSoldierLog.limitEnd}
</if>
</if>
</select> </select>
</mapper> </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