From 9ec6b3a0352674d76e1d5fce91fdb0cc28479f3b Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 11 Jul 2024 09:38:25 +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=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95?= =?UTF-8?q?=20=E7=A1=AE=E8=AE=A4=E5=8F=91=E8=B4=A7=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95=20=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=8F=91=E8=B4=A7=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8D=95=20=E7=A1=AE=E8=AE=A4=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=92=8C=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8D=95=20=E5=8F=96=E6=B6=88=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=92=8C=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E6=96=B0=E5=A2=9E=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SysSalesShippingInformController.java | 55 +++++++++++++++++-- .../ISysSalesShippingInformService.java | 11 ++++ .../SysSalesShippingInformServiceImpl.java | 48 +++++++++++++++- .../mapper/WarehouseOutOrderMapper.java | 5 ++ .../warehouse/WarehouseOutOrderMapper.xml | 8 +++ .../salesShippingInform/cancelShipping.html | 35 ++++++++++++ .../salesShippingInform/confirmShipping.html | 49 +++++++++++++++++ .../salesShippingInform.html | 19 +++++-- 8 files changed, 219 insertions(+), 11 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java index 7b18ba4d..82b00c35 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesShippingInformController.java @@ -1,15 +1,13 @@ package com.ruoyi.system.controller; import java.util.List; + +import com.ruoyi.system.domain.SysSalesOrder; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.system.domain.SysSalesShippingInform; @@ -147,5 +145,52 @@ public class SysSalesShippingInformController extends BaseController return toAjax(sysSalesShippingInformService.restoreSysSalesShippingInformById(id)); } + /** + * 确认发货 + */ + @GetMapping("/confirmShipping/{shippingInformId}") + public String confirmShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap) + { + SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId); + mmap.put("sysSalesShippingInform", sysSalesShippingInform); + return prefix + "/confirmShipping"; + } + + /** + * 修改保存确认发货 + */ + @RequiresPermissions("system:salesShippingInform:confirmShipping") + @Log(title = "销售确认发货", businessType = BusinessType.UPDATE) + @PostMapping("/confirmShipping") + @ResponseBody + public AjaxResult confirmShippingSave(SysSalesShippingInform sysSalesShippingInform) + { + return toAjax(sysSalesShippingInformService.updateConfirmShipping(sysSalesShippingInform)); + } + + + + /** + * 取消发货 + */ + @GetMapping("/cancelShipping/{shippingInformId}") + public String cancelShipping(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap) + { + SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId); + mmap.put("sysSalesShippingInform", sysSalesShippingInform); + return prefix + "/cancelShipping"; + } + + /** + * 修改保存取消发货 + */ + @RequiresPermissions("system:salesShippingInform:cancelShipping") + @Log(title = "销售取消发货", businessType = BusinessType.UPDATE) + @PostMapping("/cancelShipping") + @ResponseBody + public AjaxResult cancelShippingSave(SysSalesShippingInform sysSalesShippingInform) + { + return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java index 2290f0b9..b2a59311 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java @@ -79,4 +79,15 @@ public interface ISysSalesShippingInformService * 通过销售发起出货生成销售出货通知单列表 * */ int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode); + + + /** + * 修改保存确认发货 + */ + int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform); + + /** + * 修改保存取消发货 + */ + int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index a8e5460b..96682a81 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; @@ -12,6 +13,8 @@ import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesOrderVo; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; +import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,6 +22,7 @@ import com.ruoyi.system.mapper.SysSalesShippingInformMapper; import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.service.ISysSalesShippingInformService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 销售出货通知Service业务层处理 @@ -28,7 +32,7 @@ import com.ruoyi.common.core.text.Convert; */ @Slf4j @Service -public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService +public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService { @Autowired private SysSalesShippingInformMapper sysSalesShippingInformMapper; @@ -39,6 +43,9 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor @Autowired private RedisCache redisCache; + @Autowired + private WarehouseOutOrderMapper warehouseOutOrderMapper; + /** * 查询销售出货通知 * @@ -174,4 +181,43 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform); } + + /** + * 修改保存确认发货 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateConfirmShipping(SysSalesShippingInform sysSalesShippingInform) { + + String loginName = ShiroUtils.getLoginName(); + //设置出库状态为 待设备维护2 + sysSalesShippingInform.setWarehouseOutStatus("3"); + sysSalesShippingInform.setUpdateBy(loginName); + sysSalesShippingInform.setUpdateTime(new Date()); + + //更新出库单数据 + String outOrderCode = sysSalesShippingInform.getOutOrderCode(); + if (StringUtils.isEmpty(outOrderCode)){ + log.warn("出库单号为空:{}",outOrderCode); + } + WarehouseOutOrder warehouseOutOrder = warehouseOutOrderMapper.selectWarehouseOutOrderByCode(outOrderCode); + warehouseOutOrder.setWarehouseOutStatus("3"); + warehouseOutOrder.setUpdateBy(loginName); + warehouseOutOrder.setUpdateTime(new Date()); + + int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + if (updateWarehouseOutOrderResult <= 0){ + throw new BusinessException("更新出库单数据失败"); + } + return sysSalesShippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + } + + /** + * 修改保存取消发货 (后续完善) + */ + @Override + public int updateCancelShipping(SysSalesShippingInform sysSalesShippingInform) { + + return 1; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java index e505696e..99ed744c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderMapper.java @@ -83,4 +83,9 @@ public interface WarehouseOutOrderMapper * @return 结果 */ public int restoreWarehouseOutOrderById(Long outOrderId); + + /* + * 根据出库单号查询出库单数据 + * */ + WarehouseOutOrder selectWarehouseOutOrderByCode(String outOrderCode); } diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml index 4371525f..728613f3 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderMapper.xml @@ -89,6 +89,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where out_order_id = #{outOrderId} + + + + + insert into warehouse_out_order diff --git a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html new file mode 100644 index 00000000..03eee16b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/cancelShipping.html @@ -0,0 +1,35 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html new file mode 100644 index 00000000..47233d79 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmShipping.html @@ -0,0 +1,49 @@ + + + + + + + +
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html index 20a1664d..37119d4a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html @@ -70,6 +70,12 @@ var removeFlag = [[${@permission.hasPermi('system:salesShippingInform:remove')}]]; var cancelFlag = [[${@permission.hasPermi('system:salesShippingInform:cancel')}]]; var restoreFlag = [[${@permission.hasPermi('system:salesShippingInform:restore')}]]; + var confirmShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmShipping')}]]; + + + + + var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; @@ -217,11 +223,8 @@ formatter: function(value, row, index) { var actions = []; actions.push('编辑 '); - actions.push('删除 '); - if(row.delFlag == '0'){ - actions.push('作废 '); - }else{ - actions.push('恢复 '); + if(row.warehouseOutStatus == '2'){ + actions.push('确认发货 '); } return actions.join(''); } @@ -229,6 +232,12 @@ }; $.table.init(options); }); + + //确认发货 + function confirmShipping(shippingInformId){ + var url = prefix +'/confirmShipping/' + shippingInformId; + $.modal.open("确认发货",url); + } \ No newline at end of file