|
@@ -1,6 +1,7 @@
|
|
|
package org.jeecg.modules.openApi.service.impl;
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.jeecg.modules.openApi.entity.PurchaseWarehousing;
|
|
|
import org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper;
|
|
|
import org.jeecg.modules.openApi.service.IPurchaseWarehousingService;
|
|
@@ -32,7 +33,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
@Autowired
|
|
|
private PurchaseWarehousingMapper purchaseWarehousingMapper;
|
|
|
|
|
|
- @DS("multi-datasource1")
|
|
|
+ @DS("multi-one")
|
|
|
@Override
|
|
|
public void savaOne(List<Map<String, Object>> mapList) {
|
|
|
if(mapList!=null&&mapList.size()>0){
|
|
@@ -41,6 +42,13 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
|
|
|
map.put("ID",getMaxId("ID","RdRecord01"));
|
|
|
System.out.println(map.get("ID"));
|
|
|
+
|
|
|
+ Integer cCode=this.baseMapper.getMaxCode("cCode","RdRecord01");
|
|
|
+ if(cCode!=null){
|
|
|
+ map.put("cCode",cCode+1);
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("获取入库单号失败");
|
|
|
+ }
|
|
|
|
|
|
if(map.get("cVouchType").toString().equals("1")){
|
|
|
map.put("cVouchType",0);
|
|
@@ -57,11 +65,28 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
map.put("cRdCode",12);
|
|
|
map.put("cPTCode",02);
|
|
|
}
|
|
|
+
|
|
|
+ String cPersonCode=map.get("cPersonCode").toString();
|
|
|
+ if(StringUtils.isNotBlank(cPersonCode)){
|
|
|
+ Map<String,Object> personMap=this.baseMapper.getPerson(cPersonCode);
|
|
|
+ map.put("cDepCode",personMap.get("cDepCode"));
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("部门编码不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ String cVenCode=String.valueOf(map.get("cVenCode"));
|
|
|
+ if(StringUtils.isNotBlank(cVenCode)){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException("供应商编码不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
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");
|
|
|
Integer rowId=1;
|
|
|
+ String message="";
|
|
|
for(Map<String,Object> itemMap:itemList){
|
|
|
|
|
|
itemMap.put("AutoID",getMaxId("AutoID","rdrecords01"));
|
|
@@ -69,8 +94,29 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
itemMap.put("ID",map.get("ID"));
|
|
|
|
|
|
itemMap.put("irowno",rowId);
|
|
|
+
|
|
|
+ itemMap.put("cPOID",String.valueOf(map.get("cOrderCode")));
|
|
|
+
|
|
|
+ if(map.get("cRdCode").toString().equals("采购入库")){
|
|
|
+ itemMap.put("iPOsID",itemMap.get("moDetailId"));
|
|
|
+ itemMap.put("iOMoDID","");
|
|
|
+ }else{
|
|
|
+ itemMap.put("iPOsID","");
|
|
|
+ itemMap.put("iOMoDID",itemMap.get("moDetailId"));
|
|
|
+ String moDetailId=String.valueOf(itemMap.get("moDetailId"));
|
|
|
+ if(StringUtils.isNotBlank(moDetailId)){
|
|
|
+
|
|
|
+ Map<String,Object> omMoDetails=this.baseMapper.getOMMoDetails(moDetailId);
|
|
|
+ itemMap.put("iordercode",omMoDetails.get("csoordercode"));
|
|
|
+ }else{
|
|
|
+ message=message+"缺少委外订单行id;";
|
|
|
+ }
|
|
|
+ }
|
|
|
rowId++;
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(message)){
|
|
|
+ throw new RuntimeException(message);
|
|
|
+ }
|
|
|
this.baseMapper.saveRdrecords01One(itemList);
|
|
|
}
|
|
|
}
|