|
@@ -250,7 +250,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
//如果是红字入库则处理是否需要做结算单
|
|
|
if(map.get("cVouchType").toString().equals("1")){
|
|
|
//保存结算单
|
|
|
-// savePurSettleVouch(map,itemMap,rowmId);
|
|
|
+ savePurSettleVouch(map,itemMap,rowmId);
|
|
|
itemMap.put("iQuantity","-"+itemMap.get("iQuantity"));
|
|
|
}
|
|
|
|
|
@@ -382,11 +382,11 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
//保存结算单
|
|
|
public void savePurSettleVouch(Map<String,Object> map,Map<String,Object> itemMap,String rowmId){
|
|
|
BigDecimal rdiQuantity=getDecimalNew(String.valueOf(itemMap.get("iQuantity")));
|
|
|
- Map<String,Object> Rdrecords01WriteQuantityMap=this.baseMapper.getRdrecords01WriteQuantity(rowmId);
|
|
|
- if(Rdrecords01WriteQuantityMap==null){
|
|
|
+ List<Map<String,Object>> Rdrecords01WriteQuantityMapList=this.baseMapper.getRdrecords01Entity(rowmId);
|
|
|
+ if(Rdrecords01WriteQuantityMapList==null||Rdrecords01WriteQuantityMapList.size()<=0){
|
|
|
throw new RuntimeException("结算业务:未找到对应蓝字入库单");
|
|
|
}
|
|
|
- BigDecimal decimal=getDecimalNew(String.valueOf(Rdrecords01WriteQuantityMap.get("iQuantity")));//蓝字未结算数量
|
|
|
+ BigDecimal decimal=this.baseMapper.getRdrecords01WriteQuantity(rowmId);//蓝字未结算数量
|
|
|
//根据红字查询对应的蓝字入库的未做发票的数量判断是否有且是否大于红字入库数量
|
|
|
if(decimal!=null&&decimal.doubleValue()>0.0&&decimal.doubleValue()>rdiQuantity.doubleValue()){
|
|
|
Map<String,Object> mapPurSettleVouch=new HashMap<>();
|
|
@@ -435,7 +435,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
mapPurSettleVouchs.put("iSVAPrice",money.doubleValue());//暂估金额
|
|
|
mapPurSettleVouchs.put("ID",oConvertUtils.addOne(getMaxId("ID","PurSettleVouchs")));//ID
|
|
|
mapPurSettleVouchs.put("PSVID",mapPurSettleVouch.get("PSVID"));//主表id
|
|
|
- mapPurSettleVouchs.put("iRdsID",mapPurSettleVouch.get("PSVID"));//蓝字入库单id ???
|
|
|
+ mapPurSettleVouchs.put("iRdsID",Rdrecords01WriteQuantityMapList.get(0).get("AutoID"));//蓝字入库单子表id ???
|
|
|
mapPurSettleVouchs.put("crdcvencode",map.get("cVenCode"));//入库单单据类型
|
|
|
this.baseMapper.savePurSettleVouch(mapPurSettleVouch);
|
|
|
this.baseMapper.savePurSettleVouchs(mapPurSettleVouchs);
|
|
@@ -541,11 +541,8 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
//根据存货与自由项找对应子件
|
|
|
|
|
|
|
|
|
- System.out.println(vouchsMap.toString());
|
|
|
- System.out.println(vouchsMap.get("MoDetailsID")+"-"+vouchsMap.get("cInvCode"));
|
|
|
- System.out.println(JSONObject.fromObject(vouchsMap).toString());
|
|
|
+
|
|
|
List<Map<String,Object>> OM_MOMaterialsList= this.baseMapper.getOM_MOMaterials(vouchsMap);
|
|
|
- System.out.println(OM_MOMaterialsList.toString());
|
|
|
if(OM_MOMaterialsList!=null&&OM_MOMaterialsList.size()>0){
|
|
|
if(OM_MOMaterialsList.size()==1){
|
|
|
vouchsMap.put("iomids",OM_MOMaterialsList.get(0).get("MOMaterialsID"));//委外订单自件id
|
|
@@ -557,8 +554,9 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
|
|
|
// if(iSendQTY.doubleValue()>fTransQty.doubleValue()){
|
|
|
//调拨数量回写到对应委外子件
|
|
|
Map<String,Object> updateOM_MOMaterials=new HashMap<>();
|
|
|
- updateOM_MOMaterials.put("map.MOMaterialsID",OM_MOMaterialsList.get(0).get("MOMaterialsID"));//委外订单子件id
|
|
|
+ updateOM_MOMaterials.put("MOMaterialsID",OM_MOMaterialsList.get(0).get("MOMaterialsID"));//委外订单子件id
|
|
|
updateOM_MOMaterials.put("fTransQty",fTransQty.doubleValue());//调拨数量
|
|
|
+ System.out.println("调拨数量:"+fTransQty.doubleValue());
|
|
|
this.baseMapper.updateOM_MOMaterialsfTransQty(updateOM_MOMaterials);
|
|
|
// }else{
|
|
|
// throw new RuntimeException("第"+vI+"调拨数量不能大于子件已领数量");
|