|
|
@ -81,6 +81,8 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
private VoucherMapper voucherMapper;
|
|
|
|
private VoucherMapper voucherMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private WarehousingNotificationMapper warehousingNotificationMapper;
|
|
|
|
private WarehousingNotificationMapper warehousingNotificationMapper;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private ContractRelationService contractRelationService;
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<WarehousingOutboundEntity> getList(WarehousingOutboundPagination warehousingOutboundPagination){
|
|
|
|
public List<WarehousingOutboundEntity> getList(WarehousingOutboundPagination warehousingOutboundPagination){
|
|
|
|
return getTypeList(warehousingOutboundPagination,warehousingOutboundPagination.getDataType());
|
|
|
|
return getTypeList(warehousingOutboundPagination,warehousingOutboundPagination.getDataType());
|
|
|
@ -685,6 +687,8 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
DeliveryOrderEntity deliveryOrder = deliveryOrderService.getInfo(deliveryOrderForm.getId());
|
|
|
|
DeliveryOrderEntity deliveryOrder = deliveryOrderService.getInfo(deliveryOrderForm.getId());
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
|
|
|
|
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
|
|
|
|
|
|
|
|
String contractSale=null;
|
|
|
|
|
|
|
|
|
|
|
|
// warehousingOutboundForm = JsonUtil.getJsonToBean(
|
|
|
|
// warehousingOutboundForm = JsonUtil.getJsonToBean(
|
|
|
|
// generaterSwapUtil.swapDatetime(WarehousingOutboundConstant.getFormData(),warehousingOutboundForm),WarehousingOutboundForm.class);
|
|
|
|
// generaterSwapUtil.swapDatetime(WarehousingOutboundConstant.getFormData(),warehousingOutboundForm),WarehousingOutboundForm.class);
|
|
|
|
// WarehousingOutboundEntity entity = JsonUtil.getJsonToBean(warehousingOutboundForm, WarehousingOutboundEntity.class);
|
|
|
|
// WarehousingOutboundEntity entity = JsonUtil.getJsonToBean(warehousingOutboundForm, WarehousingOutboundEntity.class);
|
|
|
@ -698,6 +702,7 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
BusinessOrderEntity businessOrderEntity = businessOrderService.getInfo(deliveryOrderForm.getBusinessId());
|
|
|
|
BusinessOrderEntity businessOrderEntity = businessOrderService.getInfo(deliveryOrderForm.getBusinessId());
|
|
|
|
if (ObjectUtil.isNotEmpty(businessOrderEntity)){
|
|
|
|
if (ObjectUtil.isNotEmpty(businessOrderEntity)){
|
|
|
|
entity.setBusinessOrderNo(businessOrderEntity.getCode()); //添加销售订单编号
|
|
|
|
entity.setBusinessOrderNo(businessOrderEntity.getCode()); //添加销售订单编号
|
|
|
|
|
|
|
|
contractSale=businessOrderEntity.getContractId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
entity.setWarehousingOutboundStatus("3");//已出库
|
|
|
|
entity.setWarehousingOutboundStatus("3");//已出库
|
|
|
@ -759,7 +764,7 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
if(inventoryList != null && inventoryList.size() > 0){
|
|
|
|
if(inventoryList != null && inventoryList.size() > 0){
|
|
|
|
inventoryEntity = inventoryList.get(0);
|
|
|
|
inventoryEntity = inventoryList.get(0);
|
|
|
|
inventoryEntity.setInventoryNumber(inventoryEntity.getInventoryNumber().subtract((entitys.getDeliveryNum())));//库存数量
|
|
|
|
inventoryEntity.setInventoryNumber(inventoryEntity.getInventoryNumber().subtract((entitys.getDeliveryNum())));//库存数量
|
|
|
|
|
|
|
|
inventoryEntity.setContractSaleId(contractSale);
|
|
|
|
if (deliveryType.equals("1")) {
|
|
|
|
if (deliveryType.equals("1")) {
|
|
|
|
inventoryEntity.setPurchasePrice(entitys.getReturnUnit());//平均采购单价
|
|
|
|
inventoryEntity.setPurchasePrice(entitys.getReturnUnit());//平均采购单价
|
|
|
|
}else if (deliveryType.equals("2")){
|
|
|
|
}else if (deliveryType.equals("2")){
|
|
|
@ -783,6 +788,8 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
inventoryEntity.setOrganizeJsonId(deliveryOrder.getOrganizeJsonId());
|
|
|
|
inventoryEntity.setOrganizeJsonId(deliveryOrder.getOrganizeJsonId());
|
|
|
|
inventoryEntity.setCompanyId(deliveryOrder.getCompanyId());
|
|
|
|
inventoryEntity.setCompanyId(deliveryOrder.getCompanyId());
|
|
|
|
inventoryEntity.setDepartmentId(deliveryOrder.getDepartmentId());
|
|
|
|
inventoryEntity.setDepartmentId(deliveryOrder.getDepartmentId());
|
|
|
|
|
|
|
|
inventoryEntity.setContractSaleId(contractSale);
|
|
|
|
|
|
|
|
|
|
|
|
if (deliveryType.equals("1")) {
|
|
|
|
if (deliveryType.equals("1")) {
|
|
|
|
inventoryEntity.setPurchasePrice(entitys.getReturnUnit());//平均采购单价
|
|
|
|
inventoryEntity.setPurchasePrice(entitys.getReturnUnit());//平均采购单价
|
|
|
|
}else if (deliveryType.equals("2")){
|
|
|
|
}else if (deliveryType.equals("2")){
|
|
|
@ -792,6 +799,19 @@ public class WarehousingOutboundServiceImpl extends ServiceImpl<WarehousingOutbo
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inventoryService.saveOrUpdate(inventoryEntity);
|
|
|
|
inventoryService.saveOrUpdate(inventoryEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<ContractRelationEntity> contractRelationQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
|
|
|
contractRelationQueryWrapper.lambda().eq(ContractRelationEntity::getBusinessId, contractSale); //销售合同ud
|
|
|
|
|
|
|
|
contractRelationQueryWrapper.lambda().eq(ContractRelationEntity::getBusinessIds, inventoryEntity.getContractPurchaseId()); //采购合同id
|
|
|
|
|
|
|
|
List<ContractRelationEntity> contractRelationEntityList = contractRelationService.list(contractRelationQueryWrapper);
|
|
|
|
|
|
|
|
if(contractRelationEntityList != null && contractRelationEntityList.size() > 0){
|
|
|
|
|
|
|
|
//查询到则不做处理
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
ContractRelationEntity contractRelationEntity = new ContractRelationEntity();
|
|
|
|
|
|
|
|
contractRelationEntity.setBusinessId(contractSale);//合同主表id
|
|
|
|
|
|
|
|
contractRelationEntity.setBusinessIds(inventoryEntity.getContractPurchaseId()); //合同对应id
|
|
|
|
|
|
|
|
contractRelationService.saveOrUpdate(contractRelationEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//更新库存流水
|
|
|
|
//更新库存流水
|
|
|
|
InventoryLogEntity inventoryLogEntity = new InventoryLogEntity();
|
|
|
|
InventoryLogEntity inventoryLogEntity = new InventoryLogEntity();
|
|
|
|
inventoryLogEntity.setProductId(entitys.getProductId());
|
|
|
|
inventoryLogEntity.setProductId(entitys.getProductId());
|
|
|
|