feat:报工记录添加勾选导出

ck
HuangHuiKang 1 month ago
parent 6030506c8b
commit dee985829f

@ -171,5 +171,4 @@ public class BaogongRecordController {
return success(baogongRecordService.getBaogongRecordTrend(reqVO)); return success(baogongRecordService.getBaogongRecordTrend(reqVO));
} }
} }

@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -23,4 +24,7 @@ public class BaogongRecordStatPageReqVO extends PageParam {
@Schema(description = "结束时间") @Schema(description = "结束时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime endBaogongTime; private LocalDateTime endBaogongTime;
@Schema(description = "报工记录ID集合用于多选导出")
private List<Long> ids;
} }

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.mes.controller.admin.baogongrecord.vo; package cn.iocoder.yudao.module.mes.controller.admin.baogongrecord.vo;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -12,6 +13,10 @@ import java.time.LocalDateTime;
@Data @Data
public class BaogongRecordStatRespVO { public class BaogongRecordStatRespVO {
@Schema(description = "报工记录Id")
private String id;
@Schema(description = "任务单编码") @Schema(description = "任务单编码")
@ExcelProperty("任务单编码") @ExcelProperty("任务单编码")
private String taskCode; private String taskCode;
@ -58,6 +63,7 @@ public class BaogongRecordStatRespVO {
@Schema(description = "报工时间") @Schema(description = "报工时间")
@ExcelProperty("报工时间") @ExcelProperty("报工时间")
@ColumnWidth(20)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime baogongTime; private LocalDateTime baogongTime;
} }

@ -12,6 +12,7 @@
<select id="selectStatPage" <select id="selectStatPage"
resultType="cn.iocoder.yudao.module.mes.controller.admin.baogongrecord.vo.BaogongRecordStatRespVO"> resultType="cn.iocoder.yudao.module.mes.controller.admin.baogongrecord.vo.BaogongRecordStatRespVO">
SELECT SELECT
r.id,
t.code AS taskCode, t.code AS taskCode,
p.code AS planCode, p.code AS planCode,
r.creator AS employeeId, r.creator AS employeeId,
@ -39,6 +40,12 @@
<if test="reqVO.endBaogongTime != null"> <if test="reqVO.endBaogongTime != null">
AND r.baogong_time &lt;= #{reqVO.endBaogongTime} AND r.baogong_time &lt;= #{reqVO.endBaogongTime}
</if> </if>
<if test="reqVO.ids != null and reqVO.ids.size() > 0">
AND r.id IN
<foreach collection="reqVO.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY r.baogong_time DESC ORDER BY r.baogong_time DESC
</select> </select>

Loading…
Cancel
Save