Commit ce2bbb1d authored by 1650842865's avatar 1650842865

工序外协选择产成品和半成品;工序外协打印时,如果没有产品编码从工序外协单明细带出

parent 95888a0f
...@@ -186,7 +186,7 @@ function getOrderColumns(){ ...@@ -186,7 +186,7 @@ function getOrderColumns(){
} }
},); },);
columns.push({ columns.push({
display: "印张LOSS", name: "printLoss", width: 140, minWidth: 60, type: "string", align: "left", display: "LOSS数", name: "printLoss", width: 140, minWidth: 60, type: "string", align: "left",
editor: { editor: {
type: "text", mask: '9999999.999', required: true type: "text", mask: '9999999.999', required: true
} }
......
...@@ -298,7 +298,9 @@ public class ResourceSearchController { ...@@ -298,7 +298,9 @@ public class ResourceSearchController {
if (CollectionUtil.isNotEmpty(mapList)){ if (CollectionUtil.isNotEmpty(mapList)){
mapList = mapList mapList = mapList
.stream() .stream()
.filter(map -> map.containsValue("ZZCP")) .filter(map -> (map.containsValue("ZZCP")
|| map.containsValue("ZBCP")
))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (CollectionUtil.isNotEmpty(mapList)){ if (CollectionUtil.isNotEmpty(mapList)){
...@@ -309,6 +311,7 @@ public class ResourceSearchController { ...@@ -309,6 +311,7 @@ public class ResourceSearchController {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
System.out.println("条数:" + mapList.size());
Integer intPage = sdo.getInteger("intPage", 1); Integer intPage = sdo.getInteger("intPage", 1);
Integer pageSize = sdo.getInteger("pageSize",10); Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize); PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
......
...@@ -78,8 +78,8 @@ public class ProcessOutsourceOrderItem extends AbstractEntity { ...@@ -78,8 +78,8 @@ public class ProcessOutsourceOrderItem extends AbstractEntity {
private BigDecimal menge; private BigDecimal menge;
/** /**
* 印张LOSS * LOSS数
*/ * */
@Column(name = "print_loss") @Column(name = "print_loss")
private BigDecimal printLoss; private BigDecimal printLoss;
......
...@@ -614,13 +614,26 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -614,13 +614,26 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
String ebeln = (String) map.get("ebeln");//采购订单号 String ebeln = (String) map.get("ebeln");//采购订单号
//根据订单号查询外协单明细 //根据订单号查询外协单明细
ProcessOutsourceOrderItem outsourceOrderItem = processOutsourceOrderItemRepository.findByEbeln(ebeln); ProcessOutsourceOrderItem outsourceOrderItem = processOutsourceOrderItemRepository.findByEbeln(ebeln);
if (StringUtil.isBlank((String) map.get("matnr2")) ){
map.put("matnr2",outsourceOrderItem.getProductCode().replaceFirst("^0*", ""));
map.put("maktx",outsourceOrderItem.getProductName());
//没有产品编码时,从外协单查询
map = this.getProductInfo(map);
}
map.put("outProcess01",outsourceOrderItem.getTxz01()); map.put("outProcess01",outsourceOrderItem.getTxz01());
map.put("outProcess02",outsourceOrderItem.getTxz02()); map.put("outProcess02",outsourceOrderItem.getTxz02());
//临时工序外发,计算印张数;实际送货数量,LOSS数 //临时工序外发,计算印张数;实际送货数量,LOSS数
BigDecimal number = outsourceOrderItem.getMenge();//成品数量 BigDecimal number = outsourceOrderItem.getMenge();//成品数量
map.put("number",number); map.put("number",number);
BigDecimal model = (BigDecimal)map.get("model") != null ? (BigDecimal)map.get("model") : BigDecimal.ZERO;//排版数量 BigDecimal model = (BigDecimal)map.get("model") != null ? (BigDecimal)map.get("model") : BigDecimal.ZERO;//排版数量
BigDecimal printLoss = outsourceOrderItem.getPrintLoss() != null ? outsourceOrderItem.getPrintLoss() : BigDecimal.ZERO;//印张LOSS数 BigDecimal loss = outsourceOrderItem.getPrintLoss() != null ? outsourceOrderItem.getPrintLoss() : BigDecimal.ZERO;//印张LOSS数改为LOSS数
//map.put("printLoss",printLoss);
BigDecimal printLoss = BigDecimal.ZERO;
if (model.compareTo(BigDecimal.ZERO) > 0 && loss.compareTo(BigDecimal.ZERO) > 0){
printLoss = loss.divide(model,2,RoundingMode.UP);
long printLossL = printLoss.setScale(0, RoundingMode.UP).longValue();
printLoss = new BigDecimal(printLossL);
}
map.put("printLoss",printLoss); map.put("printLoss",printLoss);
//印张量 = 成品数量/排版数量 //印张量 = 成品数量/排版数量
BigDecimal printNumber = BigDecimal.ZERO; BigDecimal printNumber = BigDecimal.ZERO;
...@@ -636,7 +649,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu ...@@ -636,7 +649,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
} }
//LOSS数 = 印张LOSS * 排版数量 //LOSS数 = 印张LOSS * 排版数量
BigDecimal loss = printLoss.multiply(model); //BigDecimal loss = printLoss.multiply(model);
map.put("loss",loss); map.put("loss",loss);
//实际送货数量 = 成品数量 + LOSS数 //实际送货数量 = 成品数量 + LOSS数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment