|
|
|
@ -1512,7 +1512,7 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRlSupEntitys)) {
|
|
|
|
|
for (UdiRlSupEntity udiRlSupEntity : udiRlSupEntitys) {
|
|
|
|
|
Integer count1 = invProductService.selectExitCount(thrInvOrder.getInvCode(), Long.parseLong(udiRlSupEntity.getCustomerId()), Long.parseLong(udiRlSupEntity.getUdiRlIdFk()));
|
|
|
|
|
if (IntUtil.value(count1 > 0)) {
|
|
|
|
|
if (IntUtil.value(count1) > 0) {
|
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
|
if (udiRlSupEntity.getPrice() == null)
|
|
|
|
|
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
|
|
|
|
@ -1574,11 +1574,28 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
BeanUtils.copyProperties(item, thrInvOrderDetail);
|
|
|
|
|
thrInvOrderDetail.setOrderIdFk(billNo);
|
|
|
|
|
thrInvOrderDetail.setRelId(sk.getRelId());
|
|
|
|
|
thrInvOrderDetail.setSupId(sk.getSupId() + "");
|
|
|
|
|
UdiRlSupEntity udiRlSupEntity = udiRlSupService.findByUdiRlIdUnitFk(thrInvOrderDetail.getRelId() + "", thrInvOrderDetail.getSupId());
|
|
|
|
|
if (udiRlSupEntity != null && udiRlSupEntity.getPrice() != null) {
|
|
|
|
|
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
|
|
|
|
|
}
|
|
|
|
|
List<UdiRlSupEntity> udiRlSupEntitys = udiRlSupService.findByUdiRlId(sk.getRelId());
|
|
|
|
|
if (CollUtil.isNotEmpty(udiRlSupEntitys)) {
|
|
|
|
|
for (UdiRlSupEntity udiRlSupEntity : udiRlSupEntitys) {
|
|
|
|
|
Integer count1 = invProductService.selectExitCount(thrInvOrder.getInvCode(), Long.parseLong(udiRlSupEntity.getCustomerId()), Long.parseLong(udiRlSupEntity.getUdiRlIdFk()));
|
|
|
|
|
if (IntUtil.value(count1) > 0) {
|
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
|
if (udiRlSupEntity.getPrice() == null)
|
|
|
|
|
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
|
|
|
|
|
else
|
|
|
|
|
thrInvOrderDetail.setPrice(udiRlSupEntity.getPrice());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (thrInvOrderDetail.getSupId() == null) {
|
|
|
|
|
thrInvOrderDetail.setSupId(udiRlSupEntitys.get(0).getCustomerId());
|
|
|
|
|
if (udiRlSupEntitys.get(0).getPrice() == null)
|
|
|
|
|
thrInvOrderDetail.setPrice(BigDecimal.ZERO);
|
|
|
|
|
else
|
|
|
|
|
thrInvOrderDetail.setPrice(udiRlSupEntitys.get(0).getPrice());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
exmsg.append(thrCode + "供应商未关联");
|
|
|
|
|
Integer skCount = sk.getCount();
|
|
|
|
|
if (skCount != null && skCount > 0) {
|
|
|
|
|
thrInvOrderDetail.setReCount(String.valueOf(skCount * finalCount));
|
|
|
|
|