|
@@ -90,9 +90,41 @@ public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapp
|
|
|
|
|
|
@DS("multi-one")
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
public String saveWarehousing(List<Map<String,Object>> mapList){
|
|
|
|
|
|
for(Map<String,Object> map:mapList){
|
|
|
+
|
|
|
+
|
|
|
+ map.put("cVouchType","01");
|
|
|
+
|
|
|
+
|
|
|
+ map.put("cRdCode","12");
|
|
|
+ map.put("cPTCode","02");
|
|
|
+ map.put("cBusType","委外加工");
|
|
|
+ map.put("dDate",new Date());
|
|
|
+
|
|
|
+ if(map.get("cOrderCode") == null){
|
|
|
+ throw new RuntimeException("委外订单号为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String,String> orderInfo = subcontractingOrderMapper.selectInfoByCode(map.get("cOrderCode").toString());
|
|
|
+ if(orderInfo == null){
|
|
|
+ throw new RuntimeException("未查询到该委外订单号:"+map.get("cOrderCode").toString());
|
|
|
+ }else{
|
|
|
+ map.put("cVenCode",orderInfo.get("cVenCode"));
|
|
|
+ map.put("cDepCode",orderInfo.get("cDepCode"));
|
|
|
+ map.put("cPersonCode",orderInfo.get("cPersonCode"));
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String,String> vendorInfo = subcontractingOrderMapper.selectVendorByCode(orderInfo.get("cVenCode"));
|
|
|
+ if(vendorInfo == null){
|
|
|
+ throw new RuntimeException("委外订单号的供应商未维护成品仓库:"+orderInfo.get("cVenCode"));
|
|
|
+ }else{
|
|
|
+ map.put("cWhCode",vendorInfo.get("cVenDefine2"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
Map<String,Integer> pkMap = this.callGetUAMaxPK("rd");
|
|
|
map.put("ID",pkMap.get("iFatherId"));
|
|
@@ -104,39 +136,8 @@ public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapp
|
|
|
throw new RuntimeException("获取入库单号失败");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if(map.get("cVouchType").toString().equals("0")){
|
|
|
- map.put("cVouchType",0);
|
|
|
- }else{
|
|
|
- throw new RuntimeException("cVouchType:只能进行采购入库(0)");
|
|
|
- }
|
|
|
-
|
|
|
- if(map.get("cRdCode").toString().equals("委外入库")){
|
|
|
-
|
|
|
- map.put("cRdCode",12);
|
|
|
- map.put("cPTCode",02);
|
|
|
- }else{
|
|
|
- throw new RuntimeException("入库类别:只能进行委外入库");
|
|
|
- }
|
|
|
- map.put("dDate",new Date());
|
|
|
- if(map.get("cWhCode") == null){
|
|
|
- throw new RuntimeException("cWhCode为空");
|
|
|
- }
|
|
|
- if(map.get("cOrderCode") == null){
|
|
|
- throw new RuntimeException("委外订单号为空");
|
|
|
- }
|
|
|
- if(map.get("cBusType") == null){
|
|
|
- map.put("cBusType","委外加工");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- subcontractingOrderMapper.saveRdRecord01One(map);
|
|
|
+ this.baseMapper.saveRdRecord01One(map);
|
|
|
|
|
|
if(map.get("item") != null && !map.get("item").equals("")){
|
|
|
List<Map<String,Object>> itemList=(List<Map<String,Object>>)map.get("item");
|
|
@@ -161,10 +162,13 @@ public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapp
|
|
|
if(itemMap.get("iQuantity") == null){
|
|
|
throw new RuntimeException("iQuantity为空");
|
|
|
}
|
|
|
-
|
|
|
- if(itemMap.get("unit") == null){
|
|
|
- throw new RuntimeException("unit为空");
|
|
|
+ Map<String,String> invInfo = subcontractingOrderMapper.selectUnitByCode(itemMap.get("cInvCode").toString());
|
|
|
+ if(invInfo == null){
|
|
|
+ throw new RuntimeException("未查询到该存货编码:"+itemMap.get("cInvCode"));
|
|
|
+ }else{
|
|
|
+ itemMap.put("unit",invInfo.get("cComUnitCode"));
|
|
|
}
|
|
|
+
|
|
|
|
|
|
if(itemMap.get("cBatch") == null){
|
|
|
throw new RuntimeException("cBatch为空");
|
|
@@ -182,7 +186,7 @@ public class SubcontractingOrderImpl extends ServiceImpl<SubcontractingOrderMapp
|
|
|
if(itemMap.get("num") == null){
|
|
|
throw new RuntimeException("num为空");
|
|
|
}
|
|
|
- subcontractingOrderMapper.saveRdRecord01One(itemMap);
|
|
|
+ subcontractingOrderMapper.saveRdrecords01One(itemMap);
|
|
|
}
|
|
|
}else{
|
|
|
throw new RuntimeException("item为空");
|