|
@@ -66,11 +66,12 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
/**
|
|
|
* 面料损耗信息接口
|
|
|
* @param code 计划号
|
|
|
+ * @param editData 传入的面损内容,用于重新计算单价、和更新保留修改内容
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
|
|
- public FabricLoss getFabricLossData(String code) {
|
|
|
+ public FabricLoss getFabricLossData(String code, FabricLoss editData) {
|
|
|
if (oConvertUtils.isNotEmpty(code)){
|
|
|
FabricLoss ret = new FabricLoss();
|
|
|
ret.setEdit(0);
|
|
@@ -304,8 +305,11 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
fabricOMOrderList1.addAll(fabricOMOrderListTmp);
|
|
|
}
|
|
|
// 设置详情及成本
|
|
|
- fabricOMOrderList1 = setFabricOMOrderOutDetail(fabricOMOrderList1, code);
|
|
|
+ fabricOMOrderList1 = setFabricOMOrderOutDetail(fabricOMOrderList1, code, editData);
|
|
|
fabricOMOrderList1 = setFabricOMOrderInDetail(fabricOMOrderList1, code);
|
|
|
+ // 设置余料去向
|
|
|
+ fabricOMOrderList1 = setFabricOMOrderLeftDetail(fabricOMOrderList1, code);
|
|
|
+
|
|
|
// 设置附件
|
|
|
fabricOMOrderList1.forEach(e->{
|
|
|
List<AccessorItem> accessorItemList1 = omAccList.stream().filter(a->a.getCInvId().equals(e.getCInvCode()+e.getCColor())).collect(Collectors.toList());
|
|
@@ -372,7 +376,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
List<FabricMoOrderCK> findList1 = ckList.stream().filter(e->
|
|
|
e.getCInvCodeOut().equals(fabricCostInvoice.getCInvCode()) &&
|
|
|
e.getCColorOut().equals(fabricCostInvoice.getCColor()) &&
|
|
|
- e.getCBatchOut().equals(fabricCostInvoice.getCBatch())).collect(Collectors.toList());
|
|
|
+ e.getCBatchOut().equalsIgnoreCase(fabricCostInvoice.getCBatch())).collect(Collectors.toList());
|
|
|
|
|
|
for (FabricMoOrderCK ckItem : findList1) {
|
|
|
money+=ckItem.getIMoney();
|
|
@@ -415,7 +419,22 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
// 转入成本
|
|
|
fabricCostInvoiceList.addAll(getInCost(ret.getFabricPoOrderList(), fabricOMOrderListGn, fabricOMOrderListGw));
|
|
|
// 转出成本
|
|
|
- fabricCostInvoiceList.addAll(getOutCost(ret.getFabricPoOrderList(), fabricOMOrderListGn, fabricOMOrderListGw));
|
|
|
+ List<FabricCostInvoice> outCostList = getOutCost(ret.getFabricPoOrderList(), fabricOMOrderListGn, fabricOMOrderListGw);
|
|
|
+ // 设置修改的工厂
|
|
|
+ if (editData != null){
|
|
|
+ List<FabricCostInvoice> editCostList = editData.getFabricCostInvoiceList();
|
|
|
+ if (oConvertUtils.listIsNotEmpty(editCostList)){
|
|
|
+ for (FabricCostInvoice item : outCostList){
|
|
|
+ Optional<FabricCostInvoice> findOpt = editCostList.stream().filter(e->e.getCVCName().equalsIgnoreCase(item.getCVCName()) &&
|
|
|
+ "转出成本".equalsIgnoreCase(e.getCBusType())).findFirst();
|
|
|
+ if (findOpt.isPresent()){
|
|
|
+ item.setCVenAbbName(findOpt.get().getCVenAbbName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fabricCostInvoiceList.addAll(outCostList);
|
|
|
+
|
|
|
|
|
|
ret.setFabricCostInvoiceList(fabricCostInvoiceList);
|
|
|
// 计算单件成本
|
|
@@ -513,6 +532,10 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
// 质量事故单
|
|
|
ret.setFabricAccidentList(fabricLossMapper.getAccidentList(code));
|
|
|
+ // 设置备注
|
|
|
+ if (editData != null){
|
|
|
+ ret.setNoteOne(editData.getNoteOne());
|
|
|
+ }
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
@@ -523,9 +546,21 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
* 设置委外订单材料出库详情
|
|
|
* @param fabricOMOrderList - 委外订单列表
|
|
|
* @param code - 计划号
|
|
|
+ * @param editData - 要设置内容的面损
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<FabricOMOrder> setFabricOMOrderOutDetail(List<FabricOMOrder> fabricOMOrderList, String code){
|
|
|
+ private List<FabricOMOrder> setFabricOMOrderOutDetail(List<FabricOMOrder> fabricOMOrderList, String code,
|
|
|
+ FabricLoss editData){
|
|
|
+ // 设置用户修改内容的数据
|
|
|
+ List<FabricOMOrder> editOmList = new ArrayList<>();
|
|
|
+ if (editData != null){
|
|
|
+ if (editData.getFabricOMOrderList1() != null){
|
|
|
+ editOmList.addAll(editData.getFabricOMOrderList1());
|
|
|
+ }
|
|
|
+ if (editData.getFabricOMOrderList2() != null){
|
|
|
+ editOmList.addAll(editData.getFabricOMOrderList2());
|
|
|
+ }
|
|
|
+ }
|
|
|
// 获取委外订单行id,入库物料编号+颜色,处理费用,入库数量
|
|
|
List<Map<String,Object>> rowInfoList = fabricLossMapper.getOmRowInfoList(code);
|
|
|
// 获取委外订单行id,出库物料信息,出库数量
|
|
@@ -654,7 +689,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
|
|
|
|
|
|
- List<FabricMoOrderCK> fabricMoOrderCKList = getFabricMoOrderCKList(rowInfoList, rowOutList, rowInList, rowInListWithAV);
|
|
|
+ List<FabricMoOrderCK> fabricMoOrderCKList = getFabricMoOrderCKList(rowInfoList, rowOutList, rowInList, rowInListWithAV, editOmList);
|
|
|
|
|
|
for (FabricOMOrder fabricOMOrder : fabricOMOrderList){
|
|
|
// 根据入库物料过滤
|
|
@@ -921,7 +956,8 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
private List<FabricMoOrderCK> getFabricMoOrderCKList(List<Map<String,Object>> rowInfoList,
|
|
|
List<FabricMoOrderCK> rowOutList,
|
|
|
List<Map<String,Object>> rowInList,
|
|
|
- List<Map<String,Object>> rowInListWithAV){
|
|
|
+ List<Map<String,Object>> rowInListWithAV,
|
|
|
+ List<FabricOMOrder> editOmList){
|
|
|
// 判断出库物料在形态转换里的,把入库物料从形态转换设置成本。只取一层
|
|
|
do{
|
|
|
// 出库物料不在入库单里的物料,在形态转换单里
|
|
@@ -1062,9 +1098,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
}
|
|
|
// 获取出库的入库
|
|
|
List<Map<String,Object>> findInByOutList = rowInList.stream().filter(in->
|
|
|
- in.get("cInvCode").toString().equals(itemOut.getCInvCodeOut()) &&
|
|
|
- in.get("cColor").toString().equals(itemOut.getCColorOut()) &&
|
|
|
- in.get("cBatch").toString().equals(itemOut.getCBatchOut())).collect(Collectors.toList());
|
|
|
+ in.get("cInvCode").toString().equalsIgnoreCase(itemOut.getCInvCodeOut()) &&
|
|
|
+ in.get("cColor").toString().equalsIgnoreCase(itemOut.getCColorOut()) &&
|
|
|
+ in.get("cBatch").toString().equalsIgnoreCase(itemOut.getCBatchOut())).collect(Collectors.toList());
|
|
|
for (Map<String,Object> itemIn :findInByOutList){
|
|
|
Double inSum = oConvertUtils.getDouble(itemIn.get("iQuantity").toString(),0);
|
|
|
Double iPurchuseMoney = oConvertUtils.getDouble(itemIn.get("iPurchuseMoney").toString(),0);
|
|
@@ -1093,11 +1129,16 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
retItem.setIQuantity(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
retItem.setIQuantityOut(itemOut.getIQuantityOut());
|
|
|
retItem.setIQuantityIn(inSum);
|
|
|
- bdVal = new BigDecimal(iPurchuseMoney/inSum*curSum);
|
|
|
+ Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId());
|
|
|
+ if (iPrice == null){
|
|
|
+ iPrice = iPurchuseMoney/inSum;
|
|
|
+ }
|
|
|
+ bdVal = new BigDecimal(iPrice*curSum);
|
|
|
retItem.setIMoney(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- bdVal = new BigDecimal(iPurchuseMoney/inSum);
|
|
|
+ bdVal = new BigDecimal(iPrice);
|
|
|
retItem.setIPrice(bdVal.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- retItem.setICalPrice(retItem.getIPrice());
|
|
|
+ bdVal = new BigDecimal(iPurchuseMoney/inSum);
|
|
|
+ retItem.setICalPrice(bdVal.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
if (outSum<=0){
|
|
|
break;
|
|
|
}
|
|
@@ -1105,7 +1146,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
// 形态转换前的入库
|
|
|
if (outSum>0){
|
|
|
List<Map<String,Object>> findInWithAVByOutList = rowInListWithAV.stream().filter(in->
|
|
|
- in.get("cInvIdOut").toString().equals(itemOut.getCInvCodeOut()+itemOut.getCColorOut()+itemOut.getCBatchOut())).collect(Collectors.toList());
|
|
|
+ in.get("cInvIdOut").toString().equalsIgnoreCase(itemOut.getCInvCodeOut()+itemOut.getCColorOut()+itemOut.getCBatchOut())).collect(Collectors.toList());
|
|
|
for (Map<String,Object> itemIn :findInWithAVByOutList){
|
|
|
Double inSum = oConvertUtils.getDouble(itemIn.get("iQuantity").toString(),0);
|
|
|
Double iPurchuseMoney = oConvertUtils.getDouble(itemIn.get("iPurchuseMoney").toString(),0);
|
|
@@ -1134,11 +1175,16 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
retItem.setIQuantity(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
retItem.setIQuantityOut(itemOut.getIQuantityOut());
|
|
|
retItem.setIQuantityIn(inSum);
|
|
|
- bdVal = new BigDecimal(iPurchuseMoney/inSum*curSum);
|
|
|
+ Double iPrice = getSaveOmOutPrice(editOmList, retItem.getMODetailsID(), retItem.getInvOutId());
|
|
|
+ if (iPrice == null){
|
|
|
+ iPrice = iPurchuseMoney/inSum;
|
|
|
+ }
|
|
|
+ bdVal = new BigDecimal(iPrice*curSum);
|
|
|
retItem.setIMoney(bdVal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- bdVal = new BigDecimal(iPurchuseMoney/inSum);
|
|
|
+ bdVal = new BigDecimal(iPrice);
|
|
|
retItem.setIPrice(bdVal.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
- retItem.setICalPrice(retItem.getIPrice());
|
|
|
+ bdVal = new BigDecimal(iPurchuseMoney/inSum);
|
|
|
+ retItem.setICalPrice(bdVal.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
if (outSum<=0){
|
|
|
break;
|
|
|
}
|
|
@@ -1167,9 +1213,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
if (oConvertUtils.listIsNotEmpty(inList)){
|
|
|
for (FabricPoOrderIn itemIn : inList){
|
|
|
Optional<FabricPoOrderIn> findItemOpt = allInList.stream().filter(e->
|
|
|
- e.getCInvCode().equals(itemIn.getCInvCode()) &&
|
|
|
- e.getCColor().equals(itemIn.getCColor()) &&
|
|
|
- e.getCBatch().equals(itemIn.getCBatch())).findFirst();
|
|
|
+ e.getCInvCode().equalsIgnoreCase(itemIn.getCInvCode()) &&
|
|
|
+ e.getCColor().equalsIgnoreCase(itemIn.getCColor()) &&
|
|
|
+ e.getCBatch().equalsIgnoreCase(itemIn.getCBatch())).findFirst();
|
|
|
if (findItemOpt.isPresent()){
|
|
|
FabricPoOrderIn formatItem = findItemOpt.get();
|
|
|
Double dMoney = formatItem.getIPrice()*formatItem.getIQuantity()+itemIn.getIPrice()*itemIn.getIQuantity();
|
|
@@ -1275,9 +1321,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
double inLeft = itemIn.getIQuantity();
|
|
|
for (FabricMoOrderCK outItem : omOutListAll){
|
|
|
- if (outItem.getCBatchOut().equals(itemIn.getCBatch()) &&
|
|
|
- outItem.getCInvCodeOut().equals(itemIn.getCInvCode()) &&
|
|
|
- outItem.getCColorOut().equals(itemIn.getCColor())){
|
|
|
+ if (outItem.getCBatchOut().equalsIgnoreCase(itemIn.getCBatch()) &&
|
|
|
+ outItem.getCInvCodeOut().equalsIgnoreCase(itemIn.getCInvCode()) &&
|
|
|
+ outItem.getCColorOut().equalsIgnoreCase(itemIn.getCColor())){
|
|
|
double outLeft = outItem.getIQuantity();
|
|
|
bOmFind = true;
|
|
|
inLeft -= outLeft;
|
|
@@ -1306,9 +1352,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
}
|
|
|
if (useOutList != null){
|
|
|
for (FabricPoOrderOut outItem : useOutList){
|
|
|
- if (outItem.getCBatch().equals(itemIn.getCBatch()) &&
|
|
|
- outItem.getCInvCode().equals(itemIn.getCInvCode()) &&
|
|
|
- outItem.getCColor().equals(itemIn.getCColor())){
|
|
|
+ if (outItem.getCBatch().equalsIgnoreCase(itemIn.getCBatch()) &&
|
|
|
+ outItem.getCInvCode().equalsIgnoreCase(itemIn.getCInvCode()) &&
|
|
|
+ outItem.getCColor().equalsIgnoreCase(itemIn.getCColor())){
|
|
|
double outLeft = outItem.getIQuantity();
|
|
|
inLeft -= outLeft;
|
|
|
if (inLeft<0){
|
|
@@ -1400,9 +1446,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
if (oConvertUtils.listIsNotEmpty(orderOutList)) {
|
|
|
for (FabricPoOrderOut orderOut : orderOutList) {
|
|
|
List<FabricMoOrderCK> findOrderCKList = moOrderCKList.stream().filter(e ->
|
|
|
- e.getCInvCodeOut().equals(orderOut.getCInvCode()) &&
|
|
|
- e.getCColorOut().equals(orderOut.getCColor()) &&
|
|
|
- e.getCBatchOut().equals(orderOut.getCBatch())).collect(Collectors.toList());
|
|
|
+ e.getCInvCodeOut().equalsIgnoreCase(orderOut.getCInvCode()) &&
|
|
|
+ e.getCColorOut().equalsIgnoreCase(orderOut.getCColor()) &&
|
|
|
+ e.getCBatchOut().equalsIgnoreCase(orderOut.getCBatch())).collect(Collectors.toList());
|
|
|
if (findOrderCKList.size() > 0) {
|
|
|
orderOut.setIPrice(findOrderCKList.get(0).getIPrice());
|
|
|
BigDecimal bdVal = new BigDecimal(orderOut.getIQuantity()*orderOut.getIPrice());
|
|
@@ -1434,9 +1480,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
if (oConvertUtils.listIsNotEmpty(inList)){
|
|
|
for (FabricPoOrderIn itemIn : inList){
|
|
|
Optional<FabricPoOrderIn> findItemOpt = allInList.stream().filter(e->
|
|
|
- e.getCInvCode().equals(itemIn.getCInvCode()) &&
|
|
|
- e.getCColor().equals(itemIn.getCColor()) &&
|
|
|
- e.getCBatch().equals(itemIn.getCBatch())).findFirst();
|
|
|
+ e.getCInvCode().equalsIgnoreCase(itemIn.getCInvCode()) &&
|
|
|
+ e.getCColor().equalsIgnoreCase(itemIn.getCColor()) &&
|
|
|
+ e.getCBatch().equalsIgnoreCase(itemIn.getCBatch())).findFirst();
|
|
|
if (findItemOpt.isPresent()){
|
|
|
FabricPoOrderIn formatItem = findItemOpt.get();
|
|
|
Double dMoney = formatItem.getIPrice()*formatItem.getIQuantity()+itemIn.getIPrice()*itemIn.getIQuantity();
|
|
@@ -1513,9 +1559,9 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
double outLeft = itemOut.getIQuantity();
|
|
|
for (FabricPoOrderIn itemIn : allInList){
|
|
|
- if (itemOut.getCBatchOut().equals(itemIn.getCBatch()) &&
|
|
|
- itemOut.getCInvCodeOut().equals(itemIn.getCInvCode()) &&
|
|
|
- itemOut.getCColorOut().equals(itemIn.getCColor())){
|
|
|
+ if (itemOut.getCBatchOut().equalsIgnoreCase(itemIn.getCBatch()) &&
|
|
|
+ itemOut.getCInvCodeOut().equalsIgnoreCase(itemIn.getCInvCode()) &&
|
|
|
+ itemOut.getCColorOut().equalsIgnoreCase(itemIn.getCColor())){
|
|
|
double inLeft = itemIn.getIQuantity();
|
|
|
|
|
|
outLeft -= inLeft;
|
|
@@ -1594,4 +1640,118 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置委外订单余料数据
|
|
|
+ * @param fabricOMOrderList
|
|
|
+ * @param code
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ private List<FabricOMOrder> setFabricOMOrderLeftDetail(List<FabricOMOrder> fabricOMOrderList, String code){
|
|
|
+ // 获取本次委外入库的形态转换
|
|
|
+ List<Map<String,Object>> fabricAssemVouchList = fabricLossMapper.getMoAssemVouchList(code);
|
|
|
+
|
|
|
+ // 采购入库被其他委外订单使用的信息
|
|
|
+ List<FabricPoOrderOut> fabricPoOrderOutList = fabricLossMapper.getMoOrderInToOther(code);
|
|
|
+ // 采购入库仓库库存
|
|
|
+ List<FabricPoOrderOut> poOrderStockList = fabricLossMapper.getMoStockList(code);
|
|
|
+ // 采购订单设置分配数量、委外供应商、余纱、采购损耗
|
|
|
+ for (FabricOMOrder omOrder : fabricOMOrderList){
|
|
|
+ // 委外入库的批次,及单价(单价=(单价*数量)加/数量
|
|
|
+
|
|
|
+ if (omOrder.getFabricMoOrderRKList() == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ List<String> inBatchList = new ArrayList<>();
|
|
|
+ Double dSum=0.0,dMoney=0.0,dPrice=0.0;
|
|
|
+ for (FabricMoOrderRK rkItem : omOrder.getFabricMoOrderRKList()){
|
|
|
+ inBatchList.add(rkItem.getCBatch().toLowerCase());
|
|
|
+ dSum = DoubleOperation.add(dSum,omOrder.getIQuantityIn());
|
|
|
+ dMoney = DoubleOperation.add(dMoney, DoubleOperation.mul(rkItem.getIQuantityIn(),rkItem.getIPrice()));
|
|
|
+ }
|
|
|
+ if (dSum>0){
|
|
|
+ dPrice = DoubleOperation.div(dMoney,dSum,4);
|
|
|
+ }
|
|
|
+ // 获取委外形态转换物料
|
|
|
+ List<Map<String, Object>> tmpAssemVouchList = fabricAssemVouchList.stream().filter(e->
|
|
|
+ oConvertUtils.getString(e.get("cInvCode")).equals(omOrder.getCInvCode()) &&
|
|
|
+ oConvertUtils.getString(e.get("cColor")).equals(omOrder.getCColor()) &&
|
|
|
+ inBatchList.contains(oConvertUtils.getString(e.get("cBatch")).toLowerCase())).collect(Collectors.toList());
|
|
|
+
|
|
|
+ // 未形态转换物料
|
|
|
+ List<FabricPoOrderOut> tmpOmOutList1 = fabricPoOrderOutList.stream().filter(e->
|
|
|
+ e.getCInvCode().equals(omOrder.getCInvCode()) &&
|
|
|
+ e.getCColor().equals(omOrder.getCColor()) &&
|
|
|
+ inBatchList.contains(oConvertUtils.getString(e.getCBatch()).toLowerCase())).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ // 形态转换物料
|
|
|
+ List<FabricPoOrderOut> tmpOmOutList2 = fabricPoOrderOutList.stream().filter(out->{
|
|
|
+ return tmpAssemVouchList.stream().filter(e ->
|
|
|
+ oConvertUtils.getString(e.get("cInvCode2")).equals(omOrder.getCInvCode()) &&
|
|
|
+ oConvertUtils.getString(e.get("cColor2")).equals(omOrder.getCColor()) &&
|
|
|
+ inBatchList.contains(oConvertUtils.getString(e.get("cAVBatch2")).toLowerCase())
|
|
|
+ ).count() > 0;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ tmpOmOutList1.addAll(tmpOmOutList2);
|
|
|
+
|
|
|
+
|
|
|
+ for (FabricPoOrderOut item : tmpOmOutList1){
|
|
|
+ String cCode = item.getCCode();
|
|
|
+ int index1 = cCode.indexOf("SY");
|
|
|
+ if (index1 == -1) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ int index2 = cCode.indexOf("-", index1);
|
|
|
+ if (index2 == -1) {
|
|
|
+ index2 = cCode.length();
|
|
|
+ }
|
|
|
+ item.setIPrice(dPrice);
|
|
|
+ item.setIMoney(DoubleOperation.mul(dPrice, item.getIQuantity()));
|
|
|
+
|
|
|
+ }
|
|
|
+ // 设置仓库库存
|
|
|
+ List<FabricPoOrderOut> findPoOrderStockList = poOrderStockList.stream().filter(e->
|
|
|
+ omOrder.getCInvCode().equals(e.getCInvCode()) &&
|
|
|
+ oConvertUtils.getString(omOrder.getCColor()).equals(e.getCColor()) &&
|
|
|
+ inBatchList.contains(e.getCBatch().toLowerCase())).collect(Collectors.toList());
|
|
|
+ for (FabricPoOrderOut item : findPoOrderStockList){
|
|
|
+ item.setIPrice(dPrice);
|
|
|
+ item.setIMoney(DoubleOperation.mul(dPrice, item.getIQuantity()));
|
|
|
+
|
|
|
+ }
|
|
|
+ tmpOmOutList1.addAll(findPoOrderStockList);
|
|
|
+
|
|
|
+ omOrder.setFabricPoOrderOutList(tmpOmOutList1);
|
|
|
+ }
|
|
|
+ return fabricOMOrderList;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取用户保存的出库单价,根据委外订单id,出库物料id获取
|
|
|
+ * @param editOmList
|
|
|
+ * @param modetailsID
|
|
|
+ * @param invOutId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private Double getSaveOmOutPrice(List<FabricOMOrder> editOmList, String modetailsID, String invOutId){
|
|
|
+ Optional<FabricOMOrder> findOpt = editOmList.stream().filter(e->e.getMODetailsID().indexOf(modetailsID)>-1).findFirst();
|
|
|
+ if (findOpt.isPresent()){
|
|
|
+ FabricOMOrder findItem = findOpt.get();
|
|
|
+ List<FabricMoOrderCK> ckList = findItem.getFabricMoOrderCKList();
|
|
|
+ if (oConvertUtils.listIsNotEmpty(ckList)){
|
|
|
+ Optional<FabricMoOrderCK> findCkOpt = ckList.stream().filter(e->e.getInvOutId().equalsIgnoreCase(invOutId)).findFirst();
|
|
|
+ if (findCkOpt.isPresent()){
|
|
|
+ FabricMoOrderCK findCkItem = findCkOpt.get();
|
|
|
+ if (!findCkItem.getIPrice().equals(findCkItem.getICalPrice())){
|
|
|
+ return findCkOpt.get().getIPrice();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
}
|