|
|
@@ -133,6 +133,15 @@ public class BomInfoController {
|
|
|
BomInfo bomInfo = new BomInfo();
|
|
|
bomInfo.setCusCode(cCusCode);
|
|
|
bomInfo.setModeCode(CusStd);
|
|
|
+ //查询是否重复
|
|
|
+ List<Map<String,Object>> list2 = bomInfoService.getBomInfoRepetition(bomInfo);
|
|
|
+ if (list2.size() > 0){
|
|
|
+ System.out.println("第"+(i+1)+"条数据,客户型号重复录入");
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
|
|
+ map.put("msg", "510");
|
|
|
+ map.put("errMsg", "第"+(i+1)+"条数据,客户型号重复录入");
|
|
|
+ return map;
|
|
|
+ }
|
|
|
bomInfoService.importExcel(bomInfo, request);
|
|
|
}
|
|
|
map.put("msg", "200");
|
|
|
@@ -241,9 +250,9 @@ public class BomInfoController {
|
|
|
bomInfo.setCusCode(cCusCode);
|
|
|
bomInfo.setModeCode(CusStd);
|
|
|
bomInfo.setErpCode(jsonObject.get("ERP CODE").toString());
|
|
|
- bomInfo.setErpCode(jsonObject.get("图纸号").toString());
|
|
|
- bomInfo.setErpCode(jsonObject.get("品名").toString());
|
|
|
- bomInfo.setErpCode(jsonObject.get("数量").toString());
|
|
|
+ bomInfo.setPcode(jsonObject.get("图纸号").toString());
|
|
|
+ bomInfo.setcInvName(jsonObject.get("品名").toString());
|
|
|
+ bomInfo.setiNum(jsonObject.get("数量").toString());
|
|
|
bomInfoService.importBomInfoDetail(bomInfo, request);
|
|
|
}else {
|
|
|
System.out.println("第"+(i+1)+"条数据,物料不存在,不允许录入");
|