|
|
@ -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.ManufacturerInformationVo; |
|
|
import com.xujie.sys.modules.part.vo.PartInformationVo; |
|
|
import com.xujie.sys.modules.part.vo.PartInformationVo; |
|
|
import com.xujie.sys.modules.report.dao.ProcedureDao; |
|
|
import com.xujie.sys.modules.report.dao.ProcedureDao; |
|
|
|
|
|
import org.apache.poi.ss.usermodel.DateUtil; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@ -81,6 +83,61 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
} else { |
|
|
} else { |
|
|
throw new RuntimeException("工厂和部门有误!"); |
|
|
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); |
|
|
Map<String, Object> resultMap = this.checkSavePart(data); |
|
|
// 判断是否检验成功 |
|
|
// 判断是否检验成功 |
|
|
|