From 60e00e9dbe62eb842876fa22f2f21f7590aeba01 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 11 Jul 2024 16:52:07 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=AE=A1=E7=90=86=20=E6=96=B0=E5=A2=9E=20=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=87=BA=E5=BA=93=20?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=94=B6=E8=B4=A7=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=20=E7=A1=AE=E8=AE=A4=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E7=9A=84=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0=20?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E7=8A=B6=E6=80=81=E5=92=8C=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=8D=95=E7=8A=B6=E6=80=81=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=87=BA=E5=BA=93=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=A1=AE=E8=AE=A4=E6=94=B6=E8=B4=A7?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=92=8Cjs=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWarehouseOutController.java | 11 ++++ .../IAftersalesWarehouseOutService.java | 5 ++ .../AftersalesWarehouseOutServiceImpl.java | 50 +++++++++++++++++++ .../warehouseOutOrder/warehouseOutOrder.html | 40 +++++++++++++++ 4 files changed, 106 insertions(+) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java index 4abf6cf3..32e23d2d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java +++ b/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)); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java index 5a16ff02..2851f1df 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java +++ b/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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java index ec33f164..e3d2d7cf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java +++ b/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删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html index 998b0854..36212e7d 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html +++ b/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('维护设备 '); } + if (row.warehouseOutStatus=="7"){ + actions.push('确认收货 '); + } 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); + } + }); + } + \ No newline at end of file