|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.ruoyi.aftersales.service.impl; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -13,7 +14,9 @@ import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.ruoyi.system.domain.SysSalesOrderChild; |
|
|
|
import com.ruoyi.system.domain.SysSalesShippingInform; |
|
|
|
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; |
|
|
|
import com.ruoyi.system.mapper.SysSalesShippingInformMapper; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseOutOrder; |
|
|
|
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; |
|
|
|
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; |
|
|
@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService; |
|
|
|
import com.ruoyi.common.core.text.Convert; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
/** |
|
|
|
* 出库单Service业务层处理 |
|
|
@ -46,6 +50,9 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu |
|
|
|
@Autowired |
|
|
|
private WarehouseOutOrderDetailMapper outOrderDetailMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysSalesShippingInformMapper shippingInformMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询出库单 |
|
|
|
* |
|
|
@ -240,6 +247,49 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu |
|
|
|
return selectShippingDeviceVOs; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改保存售后第一次维护设备 |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder) { |
|
|
|
|
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|
|
|
|
|
List<SelectShippingDeviceVO> selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList(); |
|
|
|
for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { |
|
|
|
AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); |
|
|
|
afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); |
|
|
|
afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); |
|
|
|
afterSalesShippingDevice.setUpdateBy(loginName); |
|
|
|
afterSalesShippingDevice.setUpdateTime(new Date()); |
|
|
|
int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); |
|
|
|
if (updateShippingDeviceResult <= 0){ |
|
|
|
throw new BusinessException("更新出货设备数据失败"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//设置出库单为待业务确认发货
|
|
|
|
warehouseOutOrder.setWarehouseOutStatus("2"); |
|
|
|
|
|
|
|
//更新销售管理销售出库的出货状态 待业务确认发货
|
|
|
|
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); |
|
|
|
sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); |
|
|
|
sysSalesShippingInform.setWarehouseOutStatus("2"); |
|
|
|
sysSalesShippingInform.setUpdateBy(loginName); |
|
|
|
sysSalesShippingInform.setUpdateTime(new Date()); |
|
|
|
int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); |
|
|
|
if (updateShippingInformResult <= 0){ |
|
|
|
log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); |
|
|
|
throw new BusinessException("更新销售出库单数据失败"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
* 售后第一次维护设备信息根据设备ID删除出货设备信息 |
|
|
|
* */ |
|
|
|