From bd61d23e79ce380707bed4f91803cd8e868f73c8 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 12 Nov 2024 16:07:03 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=A1=A8=E3=80=81=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BB=E3=80=81mapper.xml=E5=B1=82=E6=9F=A5=E6=89=BE?= =?UTF-8?q?=E3=80=81=E6=8F=92=E5=85=A5=E5=92=8C=E4=BF=AE=E6=94=B9=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E9=83=BD=E5=8A=A0=E4=B8=8A=20isConfirmReceivingFlag?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E7=A1=AE=E8=AE=A4=E6=94=B6=E8=B4=A7=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=92=8C=E5=85=B6=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E4=B8=9A=E5=8A=A1=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=A6=82=E6=9E=9C=E6=9C=89=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8D=95=E5=8F=B7=E5=B0=B1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=EF=BC=8C=E4=B8=8B=E9=9D=A2=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IME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/AfterSalesShippingDevice.java | 14 + .../SysSalesShippingInformController.java | 65 +++- .../domain/Vo/ConfirmReceivingDetailVo.java | 19 ++ .../system/mapper/SysSalesOrderMapper.java | 4 + .../system/service/ISysSalesOrderService.java | 5 + .../ISysSalesShippingInformService.java | 13 + .../impl/SysSalesOrderServiceImpl.java | 10 + .../SysSalesShippingInformServiceImpl.java | 196 ++++++++++++ .../AfterSalesShippingDeviceMapper.xml | 6 +- .../mapper/system/SysSalesOrderMapper.xml | 7 + .../salesShippingInform/confirmReceiving.html | 301 ++++++++++++++++++ .../salesShippingInform.html | 21 +- 12 files changed, 654 insertions(+), 7 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java index d13b75eb..b05f0e78 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AfterSalesShippingDevice.java @@ -166,6 +166,10 @@ public class AfterSalesShippingDevice extends BaseEntity /** 是否添加出货设备(0代表是 1代表否) */ private String addShippingDeviceFlag; + /** 是否确认收货(0代表是 1代表否) 业务确认收货的时候使用 */ + private String isConfirmReceivingFlag; + + //生产开始时间 private Date startMakeTime; @@ -531,6 +535,15 @@ public class AfterSalesShippingDevice extends BaseEntity this.outOrderCode = outOrderCode; } + + public String getIsConfirmReceivingFlag() { + return isConfirmReceivingFlag; + } + + public void setIsConfirmReceivingFlag(String isConfirmReceivingFlag) { + this.isConfirmReceivingFlag = isConfirmReceivingFlag; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -574,6 +587,7 @@ public class AfterSalesShippingDevice extends BaseEntity .append("updateTime", getUpdateTime()) .append("addShippingDeviceFlag",getAddShippingDeviceFlag()) .append("outOrderCode",getOutOrderCode()) + .append("isConfirmReceivingFlag",getIsConfirmReceivingFlag()) .toString(); } } 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 ee55307a..23e7f330 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,16 +1,18 @@ package com.ruoyi.system.controller; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.erp.domain.ErpBom; import com.ruoyi.erp.domain.ErpBomVo; import com.ruoyi.purchase.domain.PurchaseOrder; import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.SysSalesOrderVo; import com.ruoyi.system.domain.SysSalesShippingInformDetail; +import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo; +import com.ruoyi.system.service.ISysSalesOrderService; import com.ruoyi.system.service.ISysSalesShippingInformDetailService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +49,9 @@ public class SysSalesShippingInformController extends BaseController @Autowired private ISysSalesShippingInformDetailService shippingInformDetailService; + @Autowired + private ISysSalesOrderService sysSalesOrderService; + @RequiresPermissions("system:salesShippingInform:view") @GetMapping() public String salesShippingInform() @@ -334,6 +339,60 @@ public class SysSalesShippingInformController extends BaseController return toAjax(sysSalesShippingInformService.updateCancelShipping(sysSalesShippingInform)); } + + + /** + * 确认收货 + */ + @GetMapping("/confirmReceiving/{shippingInformId}") + public String confirmReceiving(@PathVariable("shippingInformId") Long shippingInformId, ModelMap mmap) + { + SysSalesShippingInform sysSalesShippingInform = sysSalesShippingInformService.selectSysSalesShippingInformById(shippingInformId); + + List sysSalesOrders = new ArrayList<>(); + String salesOrderCode = sysSalesShippingInform.getSalesOrderCode(); + + List salesOrderCodes = new ArrayList<>(); + + if (StringUtils.isNotEmpty(salesOrderCode)){ + String[] splitSalesOrderCode = salesOrderCode.split(","); + salesOrderCodes = Arrays.asList(splitSalesOrderCode); + } + + sysSalesOrders = sysSalesOrderService.selectSysSalesOrderListByCodeList(salesOrderCodes); + mmap.put("sysSalesOrders", sysSalesOrders); + mmap.put("sysSalesShippingInform", sysSalesShippingInform); + return prefix + "/confirmReceiving"; + } + + /** + * 修改保存确认收货 + */ + @RequiresPermissions("system:salesShippingInform:confirmReceiving") + @Log(title = "销售确认收货", businessType = BusinessType.UPDATE) + @PostMapping("/confirmReceiving") + @ResponseBody + public AjaxResult confirmReceivingSave(@RequestBody SysSalesShippingInform sysSalesShippingInform) + { + return toAjax(sysSalesShippingInformService.updateConfirmReceiving(sysSalesShippingInform)); + } + + + + /** + * 客户确认发货 物料信息详情 + */ + @PostMapping("/confirmReceivingDetailList") + @ResponseBody + public TableDataInfo confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform) + { + startPage(); + List list = sysSalesShippingInformService.confirmReceivingDetailList(sysSalesShippingInform); + return getDataTable(list); + } + + + /** * 客户验收 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java new file mode 100644 index 00000000..c69dd819 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ConfirmReceivingDetailVo.java @@ -0,0 +1,19 @@ +package com.ruoyi.system.domain.Vo; + + +import com.ruoyi.system.domain.SysSalesShippingInformDetail; +import lombok.Data; + +/** +* 客户确认收货物料详情Vo类 +* */ +@Data +public class ConfirmReceivingDetailVo extends SysSalesShippingInformDetail { + + + /** 出货设备id */ + private String shippingDeviceId; + + /** SN号 */ + private String snCode; +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java index c78dd551..0ed04696 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java @@ -92,4 +92,8 @@ public interface SysSalesOrderMapper * */ List selectBatchSalesOrderById(List salesOrderIds); + /** + * 通过销售订单code批量查询销售订单 + * */ + List selectSysSalesOrderListByCodeList(List salesOrderCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java index 14c71045..0b0a46a3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java @@ -143,4 +143,9 @@ public interface ISysSalesOrderService * 通过销售订单id批量查询销售订单 * */ List selectBatchSalesOrderById(List salesOrderIds); + + /** + * 通过销售订单号集合查询销售订单集合 + * */ + List selectSysSalesOrderListByCodeList(List salesOrderCodes); } 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 85263a59..9fa15041 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 @@ -5,6 +5,7 @@ import java.util.List; import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.domain.SysSalesShippingInformDetail; +import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo; import javax.servlet.http.HttpServletResponse; @@ -148,4 +149,16 @@ public interface ISysSalesShippingInformService * 导出出货发票2模板 * */ void exportShippingInvoiceTwo(String outOrderCode, HttpServletResponse response); + + /** + * 确认收货 + * */ + int updateConfirmReceiving(SysSalesShippingInform sysSalesShippingInform); + + /** + * 展示确认收货物料详情 + * */ + List confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform); + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java index e09653eb..02724ab2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java @@ -141,6 +141,16 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService return sysSalesOrders; } + + /** + * 通过销售订单号集合查询销售订单集合 + * */ + @Override + public List selectSysSalesOrderListByCodeList(List salesOrderCodes) { + List sysSalesOrders = sysSalesOrderMapper.selectSysSalesOrderListByCodeList(salesOrderCodes); + return sysSalesOrders; + } + /** * 查询销售订单列表 * 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 194f023f..7fdf3499 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 @@ -26,6 +26,7 @@ import com.ruoyi.common.utils.file.FileDownloadUtils; import com.ruoyi.sales.domain.SalesShippingInformation; import com.ruoyi.sales.mapper.SalesShippingInformationMapper; import com.ruoyi.system.domain.*; +import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo; import com.ruoyi.system.dto.ExportShippingInformOrderDto; import com.ruoyi.system.dto.ExportShippingInvoiceDto; import com.ruoyi.system.dto.ExportShippingOrderDto; @@ -34,11 +35,13 @@ import com.ruoyi.system.mapper.*; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.service.ISysSalesShippingInformService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import javax.servlet.http.HttpServletResponse; @@ -374,6 +377,198 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor return 1; } + + /** + * 修改保存确认收货 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateConfirmReceiving(SysSalesShippingInform sysSalesShippingInform) { + + String loginName = ShiroUtils.getLoginName(); + + List shippingInformDetailList = sysSalesShippingInform.getShippingInformDetailList(); + + boolean anyNullThisReceivingNum = shippingInformDetailList.stream().anyMatch(item -> item.getThisReceivingNum() == null); + if (anyNullThisReceivingNum){ + throw new BusinessException("请填写每个本次收货数"); + } + + // 分组:有 shippingDeviceId 和没有 shippingDeviceId + Map> groupedDetails = shippingInformDetailList.stream() + .collect(Collectors.partitioningBy(detail -> detail.getShippingDeviceId() != null)); + + List withShippingDeviceIdList = groupedDetails.getOrDefault(true, new ArrayList<>()); + List withoutShippingDeviceIdList = groupedDetails.getOrDefault(false, new ArrayList<>()); + + // 处理没有出货设备ID的数据 + processWithoutShippingDeviceId(withoutShippingDeviceIdList); + + // 处理有出货设备ID的数据 + processWithShippingDeviceId(withShippingDeviceIdList); + + //更新收货维护设备出库单数据 + AftersalesOutOrder aftersalesOutOrder = new AftersalesOutOrder(); + aftersalesOutOrder.setOutOrderCode(sysSalesShippingInform.getOutOrderCode()); + //设置为待验收 + aftersalesOutOrder.setWarehouseOutStatus("10"); + aftersalesOutOrder.setUpdateBy(loginName); + aftersalesOutOrder.setUpdateTime(new Date()); + int updateAftersalesOutOrderResult = aftersalesOutOrderMapper.updateAftersalesOutOrderByOutOrderCode(aftersalesOutOrder); + if (updateAftersalesOutOrderResult <= 0){ + throw new BusinessException("更新售后出库单数据失败"); + } + + return updateAftersalesOutOrderResult; + } + + + + + private void processWithoutShippingDeviceId(List withoutShippingDeviceIdList) { + + + + for (SysSalesShippingInformDetail sysSalesShippingInformDetail : withoutShippingDeviceIdList) { + Long shippingInformDetailId = sysSalesShippingInformDetail.getShippingInformDetailId(); + SysSalesShippingInformDetail tempShippingInformDetail = shippingInformDetailMapper.selectSysSalesShippingInformDetailById(shippingInformDetailId); + + if (tempShippingInformDetail.getHasReceivingNum() == null || tempShippingInformDetail.getHasReceivingNum() == 0) { + sysSalesShippingInformDetail.setHasReceivingNum(sysSalesShippingInformDetail.getThisReceivingNum()); + } else { + sysSalesShippingInformDetail.setHasReceivingNum(tempShippingInformDetail.getHasReceivingNum() + sysSalesShippingInformDetail.getThisReceivingNum()); + } + + if (sysSalesShippingInformDetail.getHasReceivingNum() > sysSalesShippingInformDetail.getThisShippingNum()) { + throw new BusinessException("已收货数和本次收货数之和不能大于本次出货数"); + } + sysSalesShippingInformDetail.setThisReceivingNum(null); + int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(sysSalesShippingInformDetail); + if (updateShippingInformDetailResult <= 0) { + throw new BusinessException("更新销售出货通知单详情数据失败"); + } + } + } + + private void processWithShippingDeviceId(List withShippingDeviceIdList) { + String loginName = ShiroUtils.getLoginName(); + + List filterShippingDeviceIdList = withShippingDeviceIdList.stream() + .filter(item -> item.getHasReceivingNum() != 1) + .collect(Collectors.toList()); + + // 判断是否有收货数量大于1,因为收货数量要么为0要么为1 + boolean anyThisReceivingNum = filterShippingDeviceIdList.stream().anyMatch(item -> item.getThisReceivingNum() > 1); + if (anyThisReceivingNum){ + throw new BusinessException("本次收货数量只能为0或1"); + } + + for (SysSalesShippingInformDetail sysSalesShippingInformDetail : filterShippingDeviceIdList) { + String shippingDeviceId = sysSalesShippingInformDetail.getShippingDeviceId(); + AfterSalesShippingDevice afterSalesShippingDevice = salesShippingDeviceMapper.selectAfterSalesShippingDeviceByShippingDeviceId(shippingDeviceId); + if (sysSalesShippingInformDetail.getThisReceivingNum() == 1){ + afterSalesShippingDevice.setIsConfirmReceivingFlag("0"); //设置已添加 + } + afterSalesShippingDevice.setUpdateBy(loginName); + afterSalesShippingDevice.setUpdateTime(new Date()); + int updateShippingDeviceResult = salesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); + if (updateShippingDeviceResult <= 0){ + throw new BusinessException("更新出货设备数据失败"); + } + } + + + Integer allReceivingNum = filterShippingDeviceIdList.stream() + .mapToInt(SysSalesShippingInformDetail::getThisReceivingNum) + .sum(); + + SysSalesShippingInformDetail sysSalesShippingInformDetail = filterShippingDeviceIdList.get(0); + Long shippingInformDetailId = sysSalesShippingInformDetail.getShippingInformDetailId(); + SysSalesShippingInformDetail tempShippingInformDetail = shippingInformDetailMapper.selectSysSalesShippingInformDetailById(shippingInformDetailId); + + if (tempShippingInformDetail.getHasReceivingNum() == null) { + tempShippingInformDetail.setHasReceivingNum(allReceivingNum); + } else { + tempShippingInformDetail.setHasReceivingNum(tempShippingInformDetail.getHasReceivingNum() + allReceivingNum); + } + + int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(tempShippingInformDetail); + if (updateShippingInformDetailResult <= 0) { + throw new BusinessException("更新销售出货通知单详情数据失败"); + } + } + + + + + + /** + * 展示确认收货物料详情 + * */ + @Override + public List confirmReceivingDetailList(SysSalesShippingInform sysSalesShippingInform) { + + + List confirmReceivingDetailVos = new ArrayList<>(); + String outOrderCode = sysSalesShippingInform.getOutOrderCode(); + List sysSalesShippingInformDetails = shippingInformDetailMapper.selectSysSalesShippingInformDetailByCode(outOrderCode); + if (CollectionUtils.isEmpty(sysSalesShippingInformDetails)){ + log.warn("确认收货物料详情为空,出库单号为:{}",outOrderCode); + } + for (SysSalesShippingInformDetail sysSalesShippingInformDetail : sysSalesShippingInformDetails) { + ConfirmReceivingDetailVo confirmReceivingDetailVo = new ConfirmReceivingDetailVo(); + BeanUtils.copyProperties(sysSalesShippingInformDetail,confirmReceivingDetailVo); + confirmReceivingDetailVos.add(confirmReceivingDetailVo); + } + + + // 过滤 materialType 为 chcpsb 的设备 + List chcpsbDevices = confirmReceivingDetailVos.stream() + .filter(item -> "chcpsb".equals(item.getMaterialType())) + .collect(Collectors.toList()); + + // 存储最终要保留的 chcpsb 设备 + List validChcpsbDevices = new ArrayList<>(); + + for (ConfirmReceivingDetailVo chcpsbDevice : chcpsbDevices) { + String materialNo = chcpsbDevice.getMaterialNo(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(materialNo); + afterSalesShippingDevice.setOutOrderCode(outOrderCode); + + List afterSalesShippingDevices = salesShippingDeviceMapper.selectHasAddShippingDevice(afterSalesShippingDevice); + + if (!CollectionUtils.isEmpty(afterSalesShippingDevices)) { + for (AfterSalesShippingDevice device : afterSalesShippingDevices) { + ConfirmReceivingDetailVo detailVo = new ConfirmReceivingDetailVo(); + BeanUtils.copyProperties(chcpsbDevice, detailVo); + detailVo.setShippingDeviceId(device.getShippingDeviceId()); + detailVo.setSnCode(device.getSnCode()); + detailVo.setThisShippingNum(1); + detailVo.setHasOutOrderNum(1); + if ("0".equals(device.getIsConfirmReceivingFlag())){ + detailVo.setHasReceivingNum(1); + }else { + detailVo.setHasReceivingNum(0); + } + validChcpsbDevices.add(detailVo); + } + } + } + + // 从 confirmReceivingDetailVos 中移除没有对应 AfterSalesShippingDevice 的 chcpsb 设备 + confirmReceivingDetailVos = confirmReceivingDetailVos.stream() + .filter(item -> !"chcpsb".equals(item.getMaterialType()) || validChcpsbDevices.contains(item)) + .collect(Collectors.toList()); + + // 添加有效的 chcpsb 设备 + confirmReceivingDetailVos.addAll(validChcpsbDevices); + + return confirmReceivingDetailVos; + + } + + /** * 客户验收 */ @@ -959,6 +1154,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor } } + /** * 导出出货通知单模板 * */ diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index d3744d6e..7edd5296 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select shipping_device_code, shipping_device_id, make_no,sales_order_code, out_order_code, material_no, material_photoUrl, material_name, material_type, material_class, material_model_code, material_unit, material_brand, material_describe, device_model_code, device_running_number, make_photoUrl, sn_code, aftersales_photoUrl, factory_date, guarantee_period, guarantee_period_flag, lock_date, lock_date_flag, wastage_expire_date, wastage_expire_flag, component_guarantee_date, component_guarantee_flag, engineer_name, salesman_name, make_name,customer_id, customer_name, maintain_order_code, maintain_time, create_by, create_time, update_by, update_time, - add_shipping_device_flag, start_make_time, end_make_time, add_process_issue_record_flag,quality_status from aftersales_shipping_device + add_shipping_device_flag, is_confirm_receiving_flag, start_make_time, end_make_time, add_process_issue_record_flag,quality_status from aftersales_shipping_device + + insert into sys_sales_order diff --git a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html new file mode 100644 index 00000000..4f60d711 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/confirmReceiving.html @@ -0,0 +1,301 @@ + + + + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+ +
+
+
+
+
+
+
+
+ + + + + + + \ 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 ab16d680..63943ed4 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesShippingInform/salesShippingInform.html @@ -95,11 +95,15 @@ var restoreFlag = [[${@permission.hasPermi('system:salesShippingInform:restore')}]]; var confirmShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmShipping')}]]; var cancelShippingFlag = [[${@permission.hasPermi('system:salesShippingInform:cancelShipping')}]]; + var confirmReceivingFlag = [[${@permission.hasPermi('system:salesShippingInform:confirmReceiving')}]]; + var customerCheckGoodsFlag = [[${@permission.hasPermi('system:salesShippingInform:customerCheckGoods')}]]; var customerCheckGoodsDetailFlag = [[${@permission.hasPermi('system:salesShippingInform:customerCheckGoodsDetail')}]]; + + var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOutTypeDatas = [[${@dict.getType('warehouse_out_type')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; @@ -316,11 +320,14 @@ var actions = []; actions.push('详情 '); if(row.warehouseOutStatus == '2'){ - actions.push('确认发货 '); - actions.push('取消发货 '); + actions.push('确认发货 '); + actions.push('取消发货 '); + } + if(row.warehouseOutStatus == '9'){ + actions.push('确认收货 '); } if(row.warehouseOutStatus == '10' || row.warehouseOutStatus == '11'){ - actions.push('确认验收 '); + actions.push('确认验收 '); } var actionLinks = actions.join(''); @@ -347,6 +354,14 @@ $.modal.open("取消发货",url); } + + //确认收货 + function confirmReceiving(shippingInformId){ + var url = prefix +'/confirmReceiving/' + shippingInformId; + $.modal.open("确认收货",url); + } + + //客户验收 function customerCheckGoods(shippingInformId){ var url = prefix +'/customerCheckGoods/' + shippingInformId;