Browse Source

[feat] 销售管理 仓库管理 售后管理

新增 售后维护设备出库 确认收货后端接口
新增  确认收货的同时更新 出库单状态和销售单状态后端接口
售后维护设备出库前端页面新增 确认收货按钮和js方法
dev
liuxiaoxu 4 months ago
parent
commit
60e00e9dbe
  1. 11
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
  3. 50
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  4. 40
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html

11
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java

@ -376,4 +376,15 @@ public class AftersalesWarehouseOutController extends BaseController
}
/**
* 确认收货
*/
@RequiresPermissions("aftersales:warehouseOutOrder:confirmReceivingGoods")
@Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE)
@GetMapping( "/confirmReceivingGoods/{outOrderId}")
@ResponseBody
public AjaxResult confirmReceivingGoods(@PathVariable("outOrderId") Long outOrderId){
return toAjax(warehouseOutOrderService.confirmReceivingGoodsById(outOrderId));
}
}

5
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java

@ -140,4 +140,9 @@ public interface IAftersalesWarehouseOutService
* 修改保存售后第二次维护设备
*/
int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder);
/**
* 确认收货
*/
int confirmReceivingGoodsById(Long outOrderId);
}

50
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java

@ -13,9 +13,11 @@ import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysSalesShippingInformMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
@ -53,6 +55,9 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
@Autowired
private SysSalesShippingInformMapper shippingInformMapper;
@Autowired
private SysSalesOrderMapper sysSalesOrderMapper;
/**
* 查询出库单
*
@ -376,6 +381,51 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu
}
/**
* 确认收货
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int confirmReceivingGoodsById(Long outOrderId) {
String loginName = ShiroUtils.getLoginName();
WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderById(outOrderId);
if (warehouseOutOrder == null){
log.warn("出库单Id为空:{}",outOrderId);
}
String outOrderCode = warehouseOutOrder.getOutOrderCode();
SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform();
sysSalesShippingInform.setOutOrderCode(outOrderCode);
sysSalesShippingInform.setWarehouseOutStatus("10");
sysSalesShippingInform.setUpdateTime(new Date());
sysSalesShippingInform.setUpdateBy(loginName);
int updateSalesShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform);
if (updateSalesShippingInformResult <= 0){
throw new BusinessException("更新销售出库数据失败");
}
String salesOrderCode = warehouseOutOrder.getSalesOrderCode();
if (StringUtils.isEmpty(salesOrderCode)){
log.warn("销售订单号为空:{}",salesOrderCode);
}
SysSalesOrder sysSalesOrder = new SysSalesOrder();
sysSalesOrder.setSalesOrderCode(salesOrderCode);
//设置为全部出货
sysSalesOrder.setDeliveryStatus("6");
sysSalesOrder.setUpdateTime(new Date());
sysSalesOrder.setUpdateBy(loginName);
int updateSysSalesOrderResult = sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder);
if (updateSysSalesOrderResult <= 0){
throw new BusinessException("更新销售订单数据失败");
}
warehouseOutOrder.setUpdateTime(new Date());
warehouseOutOrder.setUpdateBy(loginName);
//设置为待验收
warehouseOutOrder.setWarehouseOutStatus("10");
return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder);
}
/*
* 售后第一次维护设备信息根据设备ID删除出货设备信息
* */

40
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html

@ -67,6 +67,7 @@
var maintenanceEquipmentOneFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentOne')}]];
var maintenanceEquipmentTwoFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentTwo')}]];
var confirmReceivingGoodsFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:confirmReceivingGoods')}]];
var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]];
var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]];
@ -182,6 +183,9 @@
if (row.warehouseOutStatus== "3"){
actions.push('<a class="btn btn-success btn-xs ' + maintenanceEquipmentTwoFlag + '" href="javascript:void(0)" onclick="maintenanceEquipmentTwo(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>维护设备</a> ');
}
if (row.warehouseOutStatus=="7"){
actions.push('<a class="btn btn-success btn-xs ' + confirmReceivingGoodsFlag + '" href="javascript:void(0)" onclick="confirmReceivingGoods(\'' + row.outOrderId + '\')"><i class="fa fa-edit"></i>确认收货</a> ');
}
return actions.join('');
}
}]
@ -208,6 +212,42 @@
$.modal.open("售后第二次维护设备",url);
}
//确认收货
function confirmReceivingGoods(outOrderId) {
// 使用layer.confirm替代alert,以实现确认功能
layer.confirm("确定要收货吗?", {
title: "系统提示",
btn: ['确定', '取消'], // 自定义按钮文本
yes: function(index, layero) {
// 用户点击确定后的操作
$.ajax({
url: prefix + '/confirmReceivingGoods/' + outOrderId,
type: 'GET',
dataType: 'json',
success: function(data) {
if (data.code == web_status.SUCCESS) {
// 成功后提示
layer.close(index); // 关闭当前confirm对话框
$.modal.alert("收货成功。");
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
} else {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError(data.msg);
}
},
error: function(error) {
layer.close(index); // 关闭当前confirm对话框
$.modal.alertError("收货失败。");
}
});
},
cancel: function(index, layero) {
// 用户点击取消的操作,通常无需处理,直接关闭对话框即可
layer.close(index);
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save