Browse Source

2024-11-08

java8
fengyuan_yang 2 years ago
parent
commit
5ee8128e07
  1. 2
      src/main/java/com/xujie/sys/modules/part/mapper/PartInformationMapper.java
  2. 57
      src/main/java/com/xujie/sys/modules/part/service/impl/PartInformationServiceImpl.java
  3. 4
      src/main/resources/mapper/part/PartInformationMapper.xml

2
src/main/java/com/xujie/sys/modules/part/mapper/PartInformationMapper.java

@ -141,4 +141,6 @@ public interface PartInformationMapper extends BaseMapper<PartInformationEntity>
void deleteRoutingGuideLineByPartNo(PartInformationEntity data);
void savePartDefaultLocation(List<LocationInformationVo> ifsDefaultLocations);
String getNextPartNo2(PartInformationVo data);
}

57
src/main/java/com/xujie/sys/modules/part/service/impl/PartInformationServiceImpl.java

@ -19,12 +19,14 @@ import com.xujie.sys.modules.part.vo.LocationInformationVo;
import com.xujie.sys.modules.part.vo.ManufacturerInformationVo;
import com.xujie.sys.modules.part.vo.PartInformationVo;
import com.xujie.sys.modules.report.dao.ProcedureDao;
import org.apache.poi.ss.usermodel.DateUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
@ -81,6 +83,61 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
} else {
throw new RuntimeException("工厂和部门有误!");
}
// 获取 partNo
// RFID: 原材料 31000001 半成品 32000001 成品 33000001
// 软标: 原材料 11000001 半成品 12000001 成品 13000001
// 硬标: 原材料 21000001 半成品 22000001 成品 23000001
// 天线: 原材料 41000001 半成品 42000001 成品 43000001
String partNo;
String type;
if ("03-RFID".equals(data.getBuNo())) {
if ("Purchased (raw)".equals(data.getPartType2())) {
type = "31";
} else if ("Manufactured Recipe".equals(data.getPartType2())) {
type = "32";
} else if ("Manufactured".equals(data.getPartType2())) {
type = "33";
} else {
throw new RuntimeException("零件类型有误!");
}
} else if ("01-Label".equals(data.getBuNo())) {
if ("Purchased (raw)".equals(data.getPartType2())) {
type = "11";
} else if ("Manufactured Recipe".equals(data.getPartType2())) {
type = "12";
} else if ("Manufactured".equals(data.getPartType2())) {
type = "13";
} else {
throw new RuntimeException("零件类型有误!");
}
} else if ("02-Hardtag".equals(data.getBuNo())) {
if ("Purchased (raw)".equals(data.getPartType2())) {
type = "21";
} else if ("Manufactured Recipe".equals(data.getPartType2())) {
type = "22";
} else if ("Manufactured".equals(data.getPartType2())) {
type = "23";
} else {
throw new RuntimeException("零件类型有误!");
}
} else if ("04-MHM".equals(data.getBuNo())) {
if ("Purchased (raw)".equals(data.getPartType2())) {
type = "41";
} else if ("Manufactured Recipe".equals(data.getPartType2())) {
type = "42";
} else if ("Manufactured".equals(data.getPartType2())) {
type = "43";
} else {
throw new RuntimeException("零件类型有误!");
}
} else {
throw new RuntimeException("BU有误!");
}
data.setQueryType(type);
partNo = partInformationMapper.getNextPartNo2(data);
data.setPartNo(partNo);
// 调用存储过程校验参数
Map<String, Object> resultMap = this.checkSavePart(data);
// 判断是否检验成功

4
src/main/resources/mapper/part/PartInformationMapper.xml

@ -763,4 +763,8 @@
</foreach>
</insert>
<!-- 下一个物料编码 -->
<select id="getNextPartNo2" resultType="string" parameterType="com.xujie.sys.modules.part.vo.PartInformationVo">
select dbo.get_next_part_code(#{site}, #{buNo}, #{queryType})
</select>
</mapper>
Loading…
Cancel
Save