diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java index 7fe3568d..349730dd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java @@ -1,9 +1,12 @@ package com.ruoyi.warehouse.controller; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -238,4 +241,39 @@ public class WarehouseOutOrderController extends BaseController return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder)); } + + + /** + * 退换货-出库 + */ + @GetMapping("/refundsExchangesOutWarehouse/{outOrderId}") + public String refundsExchangesOutWarehouse(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) + { + WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); + mmap.put("warehouseOutOrder", warehouseOutOrder); + return prefix + "/refundsExchangesOutWarehouse"; + } + + /** + * 修改保存退换货-出库 + */ + @RequiresPermissions("warehouse:warehouseOutOrder:refundsExchangesOutWarehouse") + @Log(title = "仓库出库单", businessType = BusinessType.UPDATE) + @PostMapping("/refundsExchangesOutWarehouse") + @ResponseBody + public AjaxResult refundsExchangesOutWarehouseSave(@RequestBody WarehouseOutOrder warehouseOutOrder) + { + return toAjax(warehouseOutOrderService.updateRefundsExchangesOutWarehouse(warehouseOutOrder)); + } + + /** + * 退换货-出库 供应商物料详情列表 + */ + @ResponseBody + @RequestMapping("/refundsExchangesDetailList") + public Map> refundsExchangesDetailList(String outOrderCode){ + List allDetails = outOrderDetailService.selectWarehouseOutOrderDetailListByCode(outOrderCode); + Map> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseOutOrderDetail::getSupplierCode)); + return groupedDetails; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java index 4914ed52..a7955417 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java @@ -4,6 +4,7 @@ import java.util.List; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; /** * 出库单详情Mapper接口 @@ -86,4 +87,5 @@ public interface WarehouseOutOrderDetailMapper * 销售单-出库 物料信息关联设备信息 */ List selectShippingDeviceList(WarehouseOutOrderDetail warehouseOutOrderDetail); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java index 058faca5..0739d3d2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java @@ -5,6 +5,7 @@ import java.util.List; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; /** * 出库单详情Service接口 @@ -85,4 +86,9 @@ public interface IWarehouseOutOrderDetailService * 销售单-出库 物料信息关联设备信息 */ List selectShippingDeviceList(AfterSalesShippingDevice afterSalesShippingDevice); + + /** + * 退换货-出库 供应商物料详情列表 + */ + List selectWarehouseOutOrderDetailListByCode(String outOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java index d4eaaea8..45a1ee14 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java @@ -83,4 +83,8 @@ public interface IWarehouseOutOrderService */ int updateSalesOutWarehouse(WarehouseOutOrder warehouseOutOrder); + /** + * 修改保存销售单-出库 + */ + int updateRefundsExchangesOutWarehouse(WarehouseOutOrder warehouseOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java index 0ea5f5c2..9b70eca2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java @@ -8,6 +8,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -155,4 +156,13 @@ public class WarehouseOutOrderDetailServiceImpl implements IWarehouseOutOrderDet return afterSalesShippingDeviceMapper.selectShippingDeviceList(afterSalesShippingDevice); } + + /** + * 退换货-出库 供应商物料详情列表 + */ + @Override + public List selectWarehouseOutOrderDetailListByCode(String outOrderCode) { + + return warehouseOutOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java index 0046299b..b1f7fb87 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java @@ -188,4 +188,27 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService } return updateRows; } + + /** + * 修改保存退换货-出库 + */ + @Transactional + @Override + public int updateRefundsExchangesOutWarehouse(WarehouseOutOrder warehouseOutOrder) { + + String loginName = ShiroUtils.getLoginName(); + + List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); + if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ + log.warn("退换货-出库,物料列表信息为空:{}",warehouseOutOrder); + } + int updateRows = 0; + for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { + warehouseOutOrderDetail.setUpdateBy(loginName); + warehouseOutOrderDetail.setUpdateTime(new Date()); + //更新数据库记录 + updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + } + return updateRows; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml index e102a679..cb05571e 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml @@ -83,7 +83,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and material_no = #{materialNo} - insert into warehouse_out_order_detail diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/refundsExchangesOutWarehouse.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/refundsExchangesOutWarehouse.html new file mode 100644 index 00000000..9ff1c7fc --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/refundsExchangesOutWarehouse.html @@ -0,0 +1,216 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+
+ +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html index a21c9b84..dbd0d5b3 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html @@ -73,6 +73,7 @@ var makeOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:makeOutWarehouse')}]]; var requisitioningOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:requisitioningOutWarehouse')}]]; + var refundsExchangesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:refundsExchangesOutWarehouse')}]]; var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; @@ -193,7 +194,10 @@ actions.push('出库 '); } - + /*退换货-出库*/ + if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 4 && row.warehouseOutType == 4){ + actions.push('出库 '); + } return actions.join(''); } }] @@ -224,6 +228,12 @@ var url = ctx + 'warehouse/warehouseOutOrder/requisitioningOutWarehouse/' + outOrderId; $.modal.open("出库",url); } + + /*退换货-出库*/ + function refundsExchangesOutWarehouse(outOrderId){ + var url = ctx + 'warehouse/warehouseOutOrder/refundsExchangesOutWarehouse/' + outOrderId; + $.modal.open("出库",url); + } \ No newline at end of file