Browse Source

IFS库存初始化导入

master
han\hanst 3 months ago
parent
commit
9aaf1e6c25
  1. 3
      src/main/java/com/gaotao/modules/factory/dao/PartAttributeMapper.java
  2. 15
      src/main/java/com/gaotao/modules/factory/entity/PartAttribute.java
  3. 16
      src/main/java/com/gaotao/modules/warehouse/service/impl/IfsInventoryInitServiceImpl.java
  4. 2
      src/main/resources/mapper/factory/PartAttributeMapper.xml

3
src/main/java/com/gaotao/modules/factory/dao/PartAttributeMapper.java

@ -8,6 +8,7 @@ import com.gaotao.modules.factory.entity.dto.PartAttributeQueryDto;
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.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -29,5 +30,5 @@ public interface PartAttributeMapper extends BaseMapper<PartAttribute> {
/** /**
* 根据站点和料号查询料件属性 * 根据站点和料号查询料件属性
*/ */
PartAttribute getPartAttributeByKey(@Param("site") String site, @Param("partNo") String partNo);
PartAttribute getPartAttributeByKey(@Param("site") String site, @Param("partNo") String partNo, @Param("height") BigDecimal height);
} }

15
src/main/java/com/gaotao/modules/factory/entity/PartAttribute.java

@ -57,5 +57,18 @@ public class PartAttribute {
*/ */
private BigDecimal diameter; private BigDecimal diameter;
private String isCommonlyUsed; // 是否常用
/**
* 是否常用 (Y/N)
*/
private String isCommonlyUsed;
/**
* HU标志
*/
private String handlingUnitFlag;
/**
* 托盘类型
*/
private String palletType;
} }

16
src/main/java/com/gaotao/modules/warehouse/service/impl/IfsInventoryInitServiceImpl.java

@ -554,7 +554,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService {
* <li>R列: 最大直径max -> diameter直径mm</li> * <li>R列: 最大直径max -> diameter直径mm</li>
* <li>S列: HU -> handling_unit_flagHU标志</li> * <li>S列: HU -> handling_unit_flagHU标志</li>
* <li>T列: 密封性 -> is_commonly_used是否常用</li> * <li>T列: 密封性 -> is_commonly_used是否常用</li>
* <li>U列: A02型号 -> 暂不处理</li>
* <li>U列: A02型号 -> pallet_type托盘类型</li>
* </ul> * </ul>
* <p><b>默认值</b>print_qty=0, inventory_stock_ifs.length=0, inventory_stock_ifs.width=0</p> * <p><b>默认值</b>print_qty=0, inventory_stock_ifs.length=0, inventory_stock_ifs.width=0</p>
* <p><b>注意</b></p> * <p><b>注意</b></p>
@ -617,7 +617,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService {
String diameterStr = getValue(data, 17); // R列: 最大直径max String diameterStr = getValue(data, 17); // R列: 最大直径max
String handlingUnitFlag = getValue(data, 18); // S列: HU String handlingUnitFlag = getValue(data, 18); // S列: HU
String isCommonlyUsed = getValue(data, 19); // T列: 密封性 String isCommonlyUsed = getValue(data, 19); // T列: 密封性
// U列(20): A02型号 - 暂不处理
String palletType = getValue(data, 20); // U列: A02型号(托盘类型)
// 检查是否为空行所有必填字段都为空 // 检查是否为空行所有必填字段都为空
if (StringUtils.isBlank(rowSite) && StringUtils.isBlank(partNo) if (StringUtils.isBlank(rowSite) && StringUtils.isBlank(partNo)
@ -697,7 +697,9 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService {
|| StringUtils.isNotBlank(widthStr) || StringUtils.isNotBlank(widthStr)
|| StringUtils.isNotBlank(heightStr) || StringUtils.isNotBlank(heightStr)
|| StringUtils.isNotBlank(diameterStr) || StringUtils.isNotBlank(diameterStr)
|| StringUtils.isNotBlank(isCommonlyUsed);
|| StringUtils.isNotBlank(handlingUnitFlag)
|| StringUtils.isNotBlank(isCommonlyUsed)
|| StringUtils.isNotBlank(palletType);
if (hasPartAttributeData) { if (hasPartAttributeData) {
PartAttribute partAttribute = new PartAttribute(); PartAttribute partAttribute = new PartAttribute();
@ -708,9 +710,11 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService {
partAttribute.setWeight(parseBigDecimal(weightStr)); partAttribute.setWeight(parseBigDecimal(weightStr));
partAttribute.setLength(parseBigDecimal(lengthStr)); partAttribute.setLength(parseBigDecimal(lengthStr));
partAttribute.setWidth(parseBigDecimal(widthStr)); partAttribute.setWidth(parseBigDecimal(widthStr));
partAttribute.setHeight(parseBigDecimal(heightStr));
partAttribute.setHeight(parseBigDecimal(heightStr)!=null ? parseBigDecimal(heightStr) : BigDecimal.ZERO); // 高度不能为空默认0
partAttribute.setDiameter(parseBigDecimal(diameterStr)); partAttribute.setDiameter(parseBigDecimal(diameterStr));
partAttribute.setHandlingUnitFlag(normalizeYN(handlingUnitFlag));
partAttribute.setIsCommonlyUsed(normalizeYN(isCommonlyUsed)); partAttribute.setIsCommonlyUsed(normalizeYN(isCommonlyUsed));
partAttribute.setPalletType(palletType);
rowData.put("part_attribute", partAttribute); rowData.put("part_attribute", partAttribute);
} }
@ -823,9 +827,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService {
try { try {
// 检查是否已存在 // 检查是否已存在
PartAttribute existing = partAttributeMapper.getPartAttributeByKey( PartAttribute existing = partAttributeMapper.getPartAttributeByKey(
partAttribute.getSite(),
partAttribute.getPartNo()
);
partAttribute.getSite(), partAttribute.getPartNo(), partAttribute.getHeight());
if (existing != null) { if (existing != null) {
log.debug("料件属性已存在,跳过: site={}, partNo={}", log.debug("料件属性已存在,跳过: site={}, partNo={}",

2
src/main/resources/mapper/factory/PartAttributeMapper.xml

@ -55,7 +55,7 @@
<!-- 根据站点和料号查询料件属性 --> <!-- 根据站点和料号查询料件属性 -->
<select id="getPartAttributeByKey" resultMap="PartAttributeResult"> <select id="getPartAttributeByKey" resultMap="PartAttributeResult">
<include refid="selectPartAttributeVo"/> <include refid="selectPartAttributeVo"/>
WHERE site = #{site} AND part_no = #{partNo}
WHERE site = #{site} AND part_no = #{partNo} and height=#{height}
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save