仓库管理按时间倒序排序

This commit is contained in:
秦鸿展
2026-02-09 13:16:25 +08:00
parent af540c67f9
commit bea406051f
6 changed files with 31 additions and 2 deletions
@@ -184,6 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.basic.domain.storageLocation.repository.todo.StorageLocationDO" resultMap="StorageLocationResult">
<include refid="selectStorageLocationPo"/>
<include refid="selectStorageLocationPo1"/>
-- 按照创建时间倒序排序
order by a.create_time desc
</select>
<select id="getStorageLocationCount" parameterType="com.mhd.basic.domain.storageLocation.repository.todo.StorageLocationDO" resultType="java.lang.Long">
@@ -103,5 +103,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.basic.domain.storageLocationGroup.repository.todo.StorageLocationGroupDO" resultMap="StorageLocationGroupResult">
<include refid="selectStorageLocationGroupPo"/>
<include refid="selectStorageLocationGroupPo1"/>
order by a.create_time desc
</select>
</mapper>
@@ -100,5 +100,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.basic.domain.storageSection.repository.todo.StorageSectionDO" resultMap="StorageSectionResult">
<include refid="selectStorageSectionPo"/>
<include refid="selectStorageSectionPo1"/>
order by a.create_time desc
</select>
</mapper>
@@ -139,5 +139,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryList" parameterType="com.mhd.basic.domain.warehouse.repository.todo.WarehouseDO" resultMap="WarehouseResult">
<include refid="selectWarehousePo"/>
<include refid="selectWarehousePo1"/>
order by create_time desc
</select>
</mapper>
@@ -22,8 +22,11 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.stream.Collectors;
/**
* 物料基础信息ApplicationService
@@ -73,6 +76,21 @@ public class MaterialBaseInfoApplicationService {
BeanUtils.copyProperties(materialGoodsRules,materialGoodsRulePO);
materialBaseInfoPO.setMaterialGoodsRule(materialGoodsRulePO);
}
// 将物料分类的List转换为逗号分隔的字符串,用于导出
if (!CollectionUtils.isEmpty(materialBaseInfoPO.getMaterialClassifyCode())) {
materialBaseInfoPO.setMaterialClassifyCodeStr(
materialBaseInfoPO.getMaterialClassifyCode().stream()
.filter(code -> !StringUtils.isEmpty(code))
.collect(Collectors.joining(","))
);
}
if (!CollectionUtils.isEmpty(materialBaseInfoPO.getMaterialClassifyName())) {
materialBaseInfoPO.setMaterialClassifyNameStr(
materialBaseInfoPO.getMaterialClassifyName().stream()
.filter(name -> !StringUtils.isEmpty(name))
.collect(Collectors.joining(","))
);
}
}
return materialBaseInfoPOS;
}
@@ -70,15 +70,21 @@ public class MaterialBaseInfoPO extends BaseVOEntity {
private String barCode;
@ApiModelProperty("物料分类编码")
@Excel(name = "物料分类编码")
@TableField(typeHandler = ListTypeHandler.class)
private List<String> materialClassifyCode;
@ApiModelProperty("物料分类名称")
@Excel(name = "物料分类名称")
@TableField(typeHandler = ListTypeHandler.class)
private List<String> materialClassifyName;
@ApiModelProperty("物料分类编码(导出用,逗号分隔)")
@Excel(name = "物料分类编码")
private String materialClassifyCodeStr;
@ApiModelProperty("物料分类名称(导出用,逗号分隔)")
@Excel(name = "物料分类名称")
private String materialClassifyNameStr;
@ApiModelProperty("物料种类编码 数据字典")
@Excel(name = "物料种类编码 数据字典")
private String materialType;