Browse Source

解决 物料属性导入报错问题

java8
赵宏斌 5 months ago
parent
commit
2bc7e213ef
  1. 1
      src/main/java/com/xujie/sys/modules/pms/controller/PqcController.java
  2. 24
      src/main/java/com/xujie/sys/modules/pms/service/Impl/QcServiceImpl.java

1
src/main/java/com/xujie/sys/modules/pms/controller/PqcController.java

@ -242,7 +242,6 @@ public class PqcController {
@PostMapping("/queryOperationForResourceList")
public R queryOperationForResourceList(@RequestBody OperationForResource data){
IPage<OperationForResource> page = pqcService.queryOperationForResourceList(data);
System.out.println("工序所属机台列表数量"+page.getTotal());
if (page.getTotal()!=0){
return R.ok().put("code",3).put("rows",page.getRecords()).put("total",page.getTotal());
}

24
src/main/java/com/xujie/sys/modules/pms/service/Impl/QcServiceImpl.java

@ -1285,9 +1285,23 @@ public class QcServiceImpl implements QcService {
String templateId = row.getCell(1).getStringCellValue();
// 截取检验类型
String type = templateId.substring(0, templateId.indexOf("-"));
String operation = row.getCell(2).getStringCellValue();
String resourceId = row.getCell(3).getStringCellValue();
String supplierNo = row.getCell(4).getStringCellValue();
String operation = null;
String resourceId = null;
String supplierNo = null;
String attributeRemark = null;
if(row.getCell(2)!= null){
operation = row.getCell(2).getStringCellValue();
}
if(row.getCell(3)!= null){
resourceId = row.getCell(3).getStringCellValue();
}
if(row.getCell(4)!= null){
supplierNo = row.getCell(4).getStringCellValue();
}
if(row.getCell(5)!= null){
attributeRemark = row.getCell(5).getStringCellValue();
}
if ("IQC".equals(type)) {
if (Objects.isNull(supplierNo)||supplierNo.equals("")){
throw new RuntimeException("第"+j+"条数据,检验模板类型为"+type+"时,供应商不能为空!");
@ -1301,9 +1315,9 @@ public class QcServiceImpl implements QcService {
task.setSite(paramData.getSite().split("_")[0]);
task.setBuNo(paramData.getSite().split("_")[1]);
task.setPartNo(row.getCell(0).getRawValue());
task.setSupplierNo(row.getCell(4).getStringCellValue());
task.setSupplierNo(supplierNo);
task.setAttributeType("A");
task.setAttributeRemark(row.getCell(5).getStringCellValue());
task.setAttributeRemark(attributeRemark);
task.setCreateBy(paramData.getCreateBy());
// 查重
task.setAttributeNo(task.getPartNo());

Loading…
Cancel
Save