🐛 导出bug、型号的模糊查询
All checks were successful
Release / Release (push) Successful in 43s

This commit is contained in:
my_ong 2025-03-25 20:36:51 +08:00
parent 6e9edd706c
commit 9039b3c731
6 changed files with 29 additions and 3 deletions

View File

@ -69,7 +69,7 @@ public class ApplyFormController {
@Operation(summary = "导出申请单列表")
public void downloadExcel(@Parameter(description = "申请类型(1入库 3出库 4盘点)") @RequestParam(name = "applyType") Integer applyType,
@Parameter(description = "物料类型") @RequestParam(name = "type", required = false) String type,
@Parameter(description = "编码/名称") @RequestParam(name = "code", required = false) String key,
@Parameter(description = "编码/名称") @RequestParam(name = "key", required = false) String key,
HttpServletResponse response) {
IPage<ApplyDTO> applyDTOIPage = searchPage(1, 10000, applyType, type, key);
List<ApplyDTO> applyDTOList = applyDTOIPage.getRecords();

View File

@ -0,0 +1,21 @@
package tech.riemann.ims.converter;
import cn.idev.excel.converters.Converter;
import cn.idev.excel.metadata.GlobalConfiguration;
import cn.idev.excel.metadata.data.WriteCellData;
import cn.idev.excel.metadata.property.ExcelContentProperty;
/**
* @author mayong
* @since 2025/3/15 18:23
*/
public class BooleanConverter implements Converter<Boolean> {
@Override
public WriteCellData<?> convertToExcelData(Boolean value,
ExcelContentProperty contentProperty,
GlobalConfiguration globalConfiguration) {
return new WriteCellData<>(Boolean.TRUE.equals(value) ? "" : "");
}
}

View File

@ -11,6 +11,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.nutz.json.JsonField;
import tech.riemann.ims.converter.BooleanConverter;
import tech.riemann.ims.converter.ICodeBookConverter;
import tech.riemann.ims.enums.ApplyTypeEnum;
import tech.riemann.ims.enums.ReviewResultEnum;
@ -90,7 +91,7 @@ public class ApplyDTO {
private String remark;
@Schema(description = "是否确认")
@ExcelProperty("是否确认")
@ExcelProperty(value = "是否确认",converter = BooleanConverter.class)
@ColumnWidth(40)
private Boolean confirm;

View File

@ -14,6 +14,7 @@ import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;
import lombok.experimental.SuperBuilder;
import org.nutz.dao.entity.annotation.*;
import tech.riemann.ims.converter.BooleanConverter;
import tech.riemann.ims.entity.IdBaseEntity;
import java.io.Serial;
@ -58,7 +59,7 @@ public class Material extends IdBaseEntity {
@Column("m_assign_rule")
@Comment("赋码规则")
@ColDefine(notNull = false, type = ColType.INT)
@ExcelProperty("是否赋码")
@ExcelProperty(value = "是否赋码",converter = BooleanConverter.class)
@ColumnWidth(40)
private Boolean assignRule; // 0-低值易耗品不参与赋码 1-高价值工具类参与唯一赋码
@ -108,6 +109,7 @@ public class Material extends IdBaseEntity {
@Column("m_description")
@Comment("备注")
@ColDefine(notNull = false, width = 500, precision = 0)
@ExcelProperty("备注")
@ColumnWidth(40)
private String description;

View File

@ -66,6 +66,7 @@
and (
m_code like concat('%',#{key},'%')
or m_name like concat('%',#{key},'%')
or m_spec like concat('%',#{key},'%')
)
</if>
ORDER BY f.af_apply_date DESC

View File

@ -60,6 +60,7 @@
and (
m_code like concat('%',#{key},'%')
or m_name like concat('%',#{key},'%')
or m_spec like concat('%',#{key},'%')
)
</if>
</where>