no message
parent
d13db2705a
commit
ec98f790f2
|
|
@ -8,9 +8,6 @@ public class ItemDate {
|
|||
@ApiModelProperty(value = "行号", required = true, example = "行号")
|
||||
int lineNo;
|
||||
|
||||
@ApiModelProperty(value = "需求工位", required = true)
|
||||
String station;
|
||||
|
||||
@ApiModelProperty(value = "物料代码", required = true, example = "物料代码")
|
||||
String itemCode;
|
||||
|
||||
|
|
@ -19,4 +16,9 @@ public class ItemDate {
|
|||
|
||||
@ApiModelProperty(value = "物料数量", required = true, example = "1")
|
||||
Double itemQty = 0d;
|
||||
|
||||
@ApiModelProperty(value = "需求工位", required = true)
|
||||
String station;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ public class ZcData {
|
|||
@ApiModelProperty(value = "需求工位", required = true)
|
||||
String station;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ public class GdServiceImpl implements GdService {
|
|||
private final BatchCreateOrUpdate batchCreateOrUpdate;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(GdQueryCriteria criteria, Pageable pageable) {
|
||||
Page<Gd> page = gdRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||
|
|
@ -316,14 +315,14 @@ public class GdServiceImpl implements GdService {
|
|||
*/
|
||||
private void validateGd(Yclbl yclbl) {
|
||||
if (StringUtils.isEmpty(yclbl.getOrderNo())) {
|
||||
throw new IllegalArgumentException("工单号不能为空!");
|
||||
throw new IllegalArgumentException("工单号必填!");
|
||||
}
|
||||
if (StringUtils.isEmpty(yclbl.getTaskCode())) {
|
||||
throw new IllegalArgumentException("任务号不能为空!");
|
||||
throw new IllegalArgumentException("任务号必填!");
|
||||
}
|
||||
|
||||
if (yclbl.getBlzc().isEmpty() && yclbl.getBlzcmx().isEmpty()) {
|
||||
throw new IllegalArgumentException("成品明细和单品明细不能为空!");
|
||||
throw new IllegalArgumentException("成品明细和单品明细至少一项必填!");
|
||||
}
|
||||
|
||||
if (!yclbl.getBlzc().isEmpty()) {
|
||||
|
|
@ -333,6 +332,9 @@ public class GdServiceImpl implements GdService {
|
|||
throw new IllegalArgumentException("成品套数不能小于等于0!");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isEmpty(zcData.getStation())) {
|
||||
throw new IllegalArgumentException("成品需求工位必填!");
|
||||
}
|
||||
for (ItemDate itemDate : zcData.getBlzcmx()) {
|
||||
if (itemDate.getItemQty() == null || itemDate.getItemQty() <= 0) {
|
||||
throw new IllegalArgumentException("单品套数不能小于等于0!");
|
||||
|
|
@ -346,6 +348,9 @@ public class GdServiceImpl implements GdService {
|
|||
if (itemDate.getItemQty() == null || itemDate.getItemQty() <= 0) {
|
||||
throw new IllegalArgumentException("单品套数不能小于等于0!");
|
||||
}
|
||||
if (StringUtils.isEmpty(itemDate.getStation())) {
|
||||
throw new IllegalArgumentException("单品需求工位必填!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -413,23 +418,9 @@ public class GdServiceImpl implements GdService {
|
|||
}
|
||||
|
||||
private void createPickAndPickDetail(Gd gd, Map<String, List<GdDetail>> groupedByDpCodeMap, AtomicInteger lineNo) {
|
||||
|
||||
groupedByDpCodeMap.forEach((code, gdDetails) -> {
|
||||
PackageCheck packageCheck = validatePackageCheck(code);// 验证翻包套数是否存在
|
||||
double xqTaoQty = 0;//需求套数
|
||||
if (BaseStatus.GD_TYPE_CT.equals(gdDetails.get(0).getOrderType())) {
|
||||
xqTaoQty = gdDetails.get(0).getBigItemQty();
|
||||
} else if (BaseStatus.GD_TYPE_DP.equals(gdDetails.get(0).getOrderType())) {
|
||||
xqTaoQty = gdDetails.get(0).getItemQty();//需求套数
|
||||
}
|
||||
double fbTaoQty = packageCheck.getQuantity();//翻包套数
|
||||
double chkQty = Math.ceil(xqTaoQty / fbTaoQty);//生成出库单数量
|
||||
for (int i = 0; i < chkQty; i++) {
|
||||
Pick pick = pickService.createPick(gd, lineNo.getAndIncrement(), code, gdDetails.get(0).getStation());
|
||||
pickDetailService.createPickDetail(pick, gdDetails);
|
||||
}
|
||||
Pick pick = pickService.createPick(gd, lineNo.getAndIncrement(), code, gdDetails.get(0).getStation());
|
||||
pickDetailService.createPickDetail(pick, gdDetails);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue