|
|
|
@ -23,6 +23,7 @@ import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.inout.IoCodeTempEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderEntity;
|
|
|
|
|
import com.glxp.api.entity.inv.InvProductEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.*;
|
|
|
|
|
import com.glxp.api.exception.JsonException;
|
|
|
|
|
import com.glxp.api.http.ErpInvClient;
|
|
|
|
@ -942,11 +943,29 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
|
|
|
|
|
item.setToBillNo(null);
|
|
|
|
|
updateThrInvOrderDetails.add(item);
|
|
|
|
|
//校验产品是否被供应商关联
|
|
|
|
|
List<InvProductEntity> invProductEntities = invProductService.selectByRelId(relId, null, null, thrInvOrder.getInvCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(invProductEntities)) {
|
|
|
|
|
InvProductEntity invProductEntity1 = null;
|
|
|
|
|
for (InvProductEntity invProductEntity : invProductEntities) {
|
|
|
|
|
if (IntUtil.value(invProductEntity.getReCount()) > 0 && IntUtil.value(invProductEntity.getReCount()) > IntUtil.value(item.getReCount())) {
|
|
|
|
|
item.setSupId(invProductEntity.getSupId());
|
|
|
|
|
break;
|
|
|
|
|
} else if (IntUtil.value(invProductEntity.getReCount()) > 0) {
|
|
|
|
|
//随机找一个有库存的供应商
|
|
|
|
|
invProductEntity1 = invProductEntity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(item.getSupId()) && invProductEntity1 != null) {
|
|
|
|
|
item.setSupId(invProductEntity1.getSupId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isEmpty(item.getSupId())) {
|
|
|
|
|
CompanyProductRelevanceEntity udiRlSupEntity = udiRlSupService.selOneByRlId(relId);
|
|
|
|
|
if (udiRlSupEntity != null)
|
|
|
|
|
item.setSupId(udiRlSupEntity.getCustomerId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|