From c852fdcc2c668ee3581701af134535f2261bc0f6 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 10 Jul 2024 08:48:10 +0800 Subject: [PATCH 01/10] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E6=96=B0=E5=A2=9E=20=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=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=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E5=90=8E=E7=AB=AF=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=8F=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=94=80=E5=94=AE=E5=8D=95=E5=8F=B7=E5=92=8C?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=8F=B7=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=8D=95=E5=AD=90=E8=A1=A8=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=8F=91=E8=B4=A7=E7=9A=84=E5=90=8C=E6=97=B6=20?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=93=E5=BA=93=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8F=91=E8=B4=A7=E7=9A=84=E5=90=8C=E6=97=B6?= =?UTF-8?q?=20=E7=94=9F=E6=88=90=E4=BB=93=E5=BA=93=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E6=98=8E=E7=BB=86=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=20=E9=94=80=E5=94=AE=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E7=9A=84=E5=90=8C=E6=97=B6=E7=94=9F=E6=88=90=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysSalesOrderController.java | 43 +++- .../system/domain/SysSalesOrderChild.java | 34 +++ .../mapper/SysSalesOrderChildMapper.java | 10 + .../service/ISysSalesOrderChildService.java | 4 + .../system/service/ISysSalesOrderService.java | 5 + .../ISysSalesShippingInformService.java | 7 + .../impl/SysSalesOrderChildServiceImpl.java | 9 + .../impl/SysSalesOrderServiceImpl.java | 48 ++++ .../SysSalesShippingInformServiceImpl.java | 51 ++++ .../service/IWarehouseOutOrderService.java | 6 + .../impl/WarehouseOutOrderServiceImpl.java | 69 +++++- .../WarehouseStorageOrderServiceImpl.java | 19 ++ .../system/SysSalesOrderChildMapper.xml | 68 ++++++ .../system/salesOrder/salesDeliverGoods.html | 231 ++++++++++++++++++ 14 files changed, 597 insertions(+), 7 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index 3caf45fe..45a0289d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -28,6 +28,8 @@ import com.ruoyi.system.domain.exportDto.SysSalesFinishDto; import com.ruoyi.system.domain.exportDto.SysSalesOrderDto; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.service.*; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; @@ -88,12 +90,11 @@ public class SysSalesOrderController extends BaseController @Autowired private ISysMakeOrderService sysMakeOrderService; - @Autowired - private SysSalesOrderMapper sysSalesOrderMapper; - @Autowired private IFinancialReceivablesService financialReceivablesService; + @Autowired + private ISysSalesOrderChildService sysSalesOrderChildService; @RequiresPermissions("system:salesOrder:view") @GetMapping() @@ -522,4 +523,40 @@ public class SysSalesOrderController extends BaseController List list = sysUserService.selectRoleToUserList("ywyRole,ywjlRole,ywzgRole,zozjRole,admin"); return getDataTable(list); } + + /** + * 发起出货 + */ + @GetMapping("/salesDeliverGoods/{salesOrderId}") + public String salesDeliverGoods(@PathVariable("salesOrderId") Long salesOrderId, ModelMap mmap) + { + SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(salesOrderId); + mmap.put("sysSalesOrder", sysSalesOrder); + return prefix + "/salesDeliverGoods"; + } + + /** + * 修改保存发起出货 + */ + @RequiresPermissions("system:salesOrder:salesDeliverGoods") + @Log(title = "销售出货通知", businessType = BusinessType.UPDATE) + @PostMapping("/salesDeliverGoods") + @ResponseBody + public AjaxResult salesDeliverGoodsSave(@RequestBody SysSalesOrder sysSalesOrder) + { + return toAjax(sysSalesOrderService.updateSalesDeliverGoods(sysSalesOrder)); + } + + + /** + * 发起出货 物料详情列表 + */ + @ResponseBody + @RequestMapping("/salesDeliverGoodsDetailList") + public TableDataInfo storageMakeDetailList(SysSalesOrder sysSalesOrder){ + startPage(); + String salesOrderCode = sysSalesOrder.getSalesOrderCode(); + List list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode); + return getDataTable(list) ; + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java index 67a69414..a21abd31 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderChild.java @@ -137,6 +137,15 @@ public class SysSalesOrderChild extends BaseEntity { @Excel(name = "未出库数量") private Integer unBoundQuantity; + //已完成数 + private Integer finishNum; + + //申请出货数 + private Integer applyShippingNum; + + //已申请出货数 + private Integer hasApplyShippingNum; + private String bomId; public Long getId() { @@ -436,7 +445,29 @@ public class SysSalesOrderChild extends BaseEntity { this.bomId = bomId; } + public Integer getFinishNum() { + return finishNum; + } + public void setFinishNum(Integer finishNum) { + this.finishNum = finishNum; + } + + public Integer getApplyShippingNum() { + return applyShippingNum; + } + + public void setApplyShippingNum(Integer applyShippingNum) { + this.applyShippingNum = applyShippingNum; + } + + public Integer getHasApplyShippingNum() { + return hasApplyShippingNum; + } + + public void setHasApplyShippingNum(Integer hasApplyShippingNum) { + this.hasApplyShippingNum = hasApplyShippingNum; + } @Override public String toString() { @@ -477,6 +508,9 @@ public class SysSalesOrderChild extends BaseEntity { .add("taxRate", taxRate) .add("outBoundQuantity", outBoundQuantity) .add("unBoundQuantity", unBoundQuantity) + .add("finishNum", finishNum) + .add("applyShippingNum", applyShippingNum) + .add("hasApplyShippingNum", hasApplyShippingNum) .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java index 8cdb9959..b1db1139 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderChildMapper.java @@ -27,4 +27,14 @@ public interface SysSalesOrderChildMapper { * 根据物料号和销售订单号查询销售订单子表数据 * */ SysSalesOrderChild selectSalesOrderChildByCodeAndNo(SysSalesOrderChild sysSalesOrderChild); + + /* + * 通过销售订单号查询销售订单子表 + * */ + List selectOrderChildListBySalesOrderCode(String salesOrderCode); + + /* + * 根据销售单号和物料号更新销售单子表数据 + * */ + int updateSysSalesOrderChildByCodeAndQuoteId(SysSalesOrderChild sysSalesOrderChild); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java index ff4fcaf0..f87f3d25 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java @@ -23,4 +23,8 @@ public interface ISysSalesOrderChildService { SysSalesOrderChild selectOneByQuoteIdAndMaterialCode(String quoteId,String materialCode); + /* + * 通过销售订单号查询销售订单子表 + * */ + List selectOrderChildListBySalesOrderCode(String salesOrderCode); } 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 40877029..91657cc7 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 @@ -87,4 +87,9 @@ public interface ISysSalesOrderService * 根据销售单号更新销售订单 * */ int updateSysSalesOrderBySalesOrderCode(SysSalesOrder sysSalesOrder); + + /** + * 修改保存发起出货 + */ + int updateSalesDeliverGoods(SysSalesOrder sysSalesOrder); } 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 3cd18bc3..2290f0b9 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 @@ -1,6 +1,8 @@ package com.ruoyi.system.service; import java.util.List; + +import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.system.domain.SysSalesShippingInform; /** @@ -72,4 +74,9 @@ public interface ISysSalesShippingInformService * @return */ int restoreSysSalesShippingInformById(Long shippingInformId); + + /** + * 通过销售发起出货生成销售出货通知单列表 + * */ + int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java index 255ed536..6a693507 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java @@ -51,4 +51,13 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService public SysSalesOrderChild selectOneByQuoteIdAndMaterialCode(String quoteId, String materialCode) { return sysCustomerQuoteChildMapper.selectOneByQuoteIdAndMaterialCode(quoteId,materialCode); } + + /* + * 通过销售订单号查询销售订单子表 + * */ + @Override + public List selectOrderChildListBySalesOrderCode(String salesOrderCode) { + + return sysCustomerQuoteChildMapper.selectOrderChildListBySalesOrderCode(salesOrderCode); + } } 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 cbaa4013..60a24051 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 @@ -6,6 +6,7 @@ import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.service.ICommonService; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; @@ -13,9 +14,11 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.*; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.*; +import com.ruoyi.warehouse.service.IWarehouseOutOrderService; import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.runtime.ProcessInstance; @@ -70,6 +73,15 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService @Autowired private ISysSalesOrderChildService sysSalesOrderChildService; + @Autowired + private SysSalesOrderChildMapper salesOrderChildMapper; + + @Autowired + private ISysSalesShippingInformService sysSalesShippingInformService; + + @Autowired + private IWarehouseOutOrderService warehouseOutOrderService; + /** * 查询销售订单 * @@ -352,6 +364,42 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); } + /** + * 修改保存发起出货 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateSalesDeliverGoods(SysSalesOrder sysSalesOrder) { + + String loginName = ShiroUtils.getLoginName(); + + sysSalesOrder.setUpdateBy(loginName); + sysSalesOrder.setUpdateTime(new Date()); + + for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrder.getSysSalesOrderChildList()) { + + sysSalesOrderChild.setUpdateTime(new Date()); + sysSalesOrderChild.setUpdateBy(loginName); + sysSalesOrderChild.setQuoteId(sysSalesOrder.getSalesOrderCode()); + sysSalesOrderChild.setHasApplyShippingNum(sysSalesOrderChild.getApplyShippingNum()); + int updateSysSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild); + if (updateSysSalesOrderChildResult <= 0){ + throw new BusinessException("更新销售订单子表数据失败"); + } + } + + + //两个表生成同一个出库单号 + String outOrderCode = redisCache.generateBillNo("CK"); + //通过销售发起出货生成仓库出库单 + int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrder,outOrderCode); + + //通过销售发起出货生成销售出货通知单列表 + int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrder,outOrderCode); + + return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); + } + private ProcessInstance startProcessInstance(String applyTitle,String instanceType,SysSalesOrder sysSalesOrder, SysUser user) { Long nessKey = sysSalesOrder.getSalesOrderId(); 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 44056899..a8e5460b 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 @@ -1,8 +1,18 @@ package com.ruoyi.system.service.impl; +import java.math.BigDecimal; +import java.util.Date; import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; 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.SysSalesOrderVo; +import com.ruoyi.system.mapper.SysSalesOrderMapper; +import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.SysSalesShippingInformMapper; @@ -16,12 +26,19 @@ import com.ruoyi.common.core.text.Convert; * @author 刘晓旭 * @date 2024-07-09 */ +@Slf4j @Service public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInformService { @Autowired private SysSalesShippingInformMapper sysSalesShippingInformMapper; + @Autowired + private SysSalesOrderMapper sysSalesOrderMapper; + + @Autowired + private RedisCache redisCache; + /** * 查询销售出货通知 * @@ -123,4 +140,38 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor { return sysSalesShippingInformMapper.restoreSysSalesShippingInformById(shippingInformId); } + + /** + * 通过销售发起出货生成销售出货通知单列表 + * */ + @Override + public int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode) { + + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + String salesOrderCode = sysSalesOrder.getSalesOrderCode(); + if (StringUtils.isEmpty(salesOrderCode)){ + log.warn("销售订单编号为空:{}",salesOrderCode); + } + //从数据库查询的数据 + SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode); + + sysSalesShippingInform.setOutOrderCode(outOrderCode); + //出库状态为 待仓库准备物料 + sysSalesShippingInform.setWarehouseOutStatus("0"); + sysSalesShippingInform.setSalesOrderCode(salesOrderCode); + //订单类型设置为 销售订单 + sysSalesShippingInform.setWarehouseOrderType("0"); + //出库类型设置为 销售出库 + sysSalesShippingInform.setWarehouseOutType("0"); + sysSalesShippingInform.setCustomerId(sysSalesOrderVo.getEnterpriseCode()); + sysSalesShippingInform.setCustomerName(sysSalesOrderVo.getEnterpriseName()); + sysSalesShippingInform.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); + sysSalesShippingInform.setCreateTime(new Date()); + sysSalesShippingInform.setCreateBy(ShiroUtils.getLoginName()); + sysSalesShippingInform.setAllPriceExcludingTaxDollar(BigDecimal.valueOf(sysSalesOrderVo.getNoUsdSum())); + sysSalesShippingInform.setAllPriceExcludingTaxRmb(BigDecimal.valueOf(sysSalesOrderVo.getNoRmbSum())); + sysSalesShippingInform.setAllPriceIncludesTax(BigDecimal.valueOf(sysSalesOrderVo.getRmbTaxSum())); + + return sysSalesShippingInformMapper.insertSysSalesShippingInform(sysSalesShippingInform); + } } 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 8aea63fe..38c02b65 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 @@ -3,6 +3,7 @@ package com.ruoyi.warehouse.service; import java.util.List; import com.ruoyi.system.domain.SysMakeorderPickVo; +import com.ruoyi.system.domain.SysSalesOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrder; /** @@ -100,4 +101,9 @@ public interface IWarehouseOutOrderService * 生产单-出库 * */ int updateMakeOutWarehouse(WarehouseOutOrder warehouseOutOrder); + + /** + * 通过销售发起出货生成仓库出库单 + * */ + int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder, String 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 eb5431d5..e1a7d6ba 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 @@ -8,15 +8,13 @@ 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.SysMakeOrder; -import com.ruoyi.system.domain.SysMakeorderPickDetail; -import com.ruoyi.system.domain.SysMakeorderPickVo; -import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.*; import com.ruoyi.system.mapper.SysMakeOrderMapper; import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper; import com.ruoyi.system.mapper.SysMakeorderPickMapper; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; import lombok.extern.slf4j.Slf4j; @@ -513,4 +511,67 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService } return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); } + + /** + * 通过销售发起出货生成仓库出库单 + * */ + @Override + public int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode) { + + String salesOrderCode = sysSalesOrder.getSalesOrderCode(); + if (StringUtils.isEmpty(salesOrderCode)){ + log.warn("销售订单编号为空:{}",salesOrderCode); + } + //从数据库查询的数据 + SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode); + + WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); + warehouseOutOrder.setOutOrderCode(outOrderCode); + //出库状态为 待仓库准备物料 + warehouseOutOrder.setWarehouseOutStatus("0"); + warehouseOutOrder.setRelatedOrderCode(salesOrderCode); + warehouseOutOrder.setSalesOrderCode(salesOrderCode); + //订单类型设置为 销售订单 + warehouseOutOrder.setWarehouseOrderType("0"); + //出库类型设置为 销售出库 + warehouseOutOrder.setWarehouseOutType("0"); + warehouseOutOrder.setBusinessName(sysSalesOrderVo.getBusinessMembers()); + warehouseOutOrder.setCustomerId(sysSalesOrderVo.getEnterpriseCode()); + warehouseOutOrder.setCustomerName(sysSalesOrderVo.getEnterpriseName()); + warehouseOutOrder.setApplyName(sysSalesOrderVo.getApplyUserName()); + warehouseOutOrder.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); + warehouseOutOrder.setCreateTime(new Date()); + warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName()); + //新增出库单明细 + CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder, salesOrderCode, sysSalesOrderVo, outOrderCode); + + return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder); + } + //新增出库单明细 + private void CreateOutOrderDetailBySalesOrderChildList(SysSalesOrder sysSalesOrder, String salesOrderCode, SysSalesOrderVo sysSalesOrderVo, String outOrderCode) { + List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); + for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { + WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); + warehouseOutOrderDetail.setOutOrderCode(outOrderCode); + warehouseOutOrderDetail.setRelatedOrderCode(salesOrderCode); + warehouseOutOrderDetail.setMaterialNo(sysSalesOrderChild.getMaterialCode()); + warehouseOutOrderDetail.setMaterialName(sysSalesOrderChild.getMaterialName()); + warehouseOutOrderDetail.setMaterialType(sysSalesOrderChild.getMaterialType()); + warehouseOutOrderDetail.setMaterialBrand(sysSalesOrderChild.getBrand()); + warehouseOutOrderDetail.setMaterialUnit(sysSalesOrderChild.getUnit()); + warehouseOutOrderDetail.setMaterialDescribe(sysSalesOrderChild.getDescribe()); + warehouseOutOrderDetail.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); + warehouseOutOrderDetail.setMakeNum(sysSalesOrderChild.getMaterialNum()); + warehouseOutOrderDetail.setApplyOutOrderSum(sysSalesOrderChild.getApplyShippingNum()); + warehouseOutOrderDetail.setCustomerId(sysSalesOrderVo.getEnterpriseCode()); + warehouseOutOrderDetail.setCustomerName(sysSalesOrderVo.getEnterpriseName()); + warehouseOutOrderDetail.setDeliveryCondition(sysSalesOrderVo.getDeliveryConditions()); + warehouseOutOrderDetail.setCreateTime(new Date()); + warehouseOutOrderDetail.setCreateBy(ShiroUtils.getLoginName()); + int insertOutOrderDetailResult = outOrderDetailMapper.insertWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (insertOutOrderDetailResult <= 0){ + throw new BusinessException("新增出库单明细数据失败"); + } + } + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java index 3e4b3320..9804fe0a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java @@ -20,7 +20,9 @@ import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; import com.ruoyi.quality.service.IQualityOrderService; import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.mapper.SysMakeOrderMapper; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysSalesOrderMapper; import com.ruoyi.system.service.ISysMakeOrderService; import com.ruoyi.system.service.ISysSalesOrderService; @@ -69,6 +71,8 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS @Autowired private SysMakeOrderMapper sysMakeOrderMapper; + @Autowired + private SysSalesOrderChildMapper salesOrderChildMapper; @Autowired private RedisCache redisCache; @@ -790,6 +794,7 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS throw new BusinessException("更新生产订单数据失败"); } + //更新销售订单数据 SysSalesOrder sysSalesOrder = salesOrderMapper.selectSysSalesOrderBySalesOrderCode(tempSysMakeOrder.getSaleNo()); //设置为全部完成 @@ -801,6 +806,20 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS throw new BusinessException("更新销售订单数据失败"); } + //更新销售订单子表的数据 + for (WarehouseStorageOrderDetail warehouseStorageOrderDetail : warehouseStorageOrderDetailList) { + SysSalesOrderChild sysSalesOrderChild = new SysSalesOrderChild(); + sysSalesOrderChild.setQuoteId(tempSysMakeOrder.getSaleNo()); + sysSalesOrderChild.setMaterialCode(warehouseStorageOrderDetail.getMaterialNo()); + sysSalesOrderChild.setFinishNum(warehouseStorageOrderDetail.getStorageNum()); + sysSalesOrderChild.setUpdateBy(loginName); + sysSalesOrderChild.setUpdateTime(new Date()); + int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(sysSalesOrderChild); + if (updateSalesOrderChildResult <= 0){ + throw new BusinessException("更新销售订单子表数据失败"); + } + } + // //更新生产单数据 // int updateMakeOrderResult = sysMakeOrderService.updateSysMakeOrderByWarehouseStorageOrder(warehouseStorageOrder, warehouseStorageOrderDetailList); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml index 862af4b3..616bc64a 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml @@ -32,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -84,6 +87,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and materialCode = #{materialCode} + + insert into sys_sales_order_child @@ -115,6 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" expiry_day, out_bound_quantity, un_bound_quantity, + finish_num, + apply_shipping_num, + has_apply_shipping_num, create_by, create_time, remark, @@ -151,6 +164,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{expiryDay}, #{outBoundQuantity}, #{unBoundQuantity}, + #{finishNum}, + #{applyShippingNum} + #{hasApplyShippingNum}, #{createBy}, #{createTime}, #{remark}, @@ -191,6 +207,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" expiry_day = #{expiryDay}, out_bound_quantity = #{outBoundQuantity}, un_bound_quantity = #{unBoundQuantity}, + finish_num = #{finishNum}, + apply_shipping_num = #{applyShippingNum}, + has_apply_shipping_num = #{hasApplyShippingNum}, update_by = #{updateBy}, remark = #{remark}, audit_status = #{auditStatus}, @@ -202,6 +221,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + + update sys_sales_order_child + + quoteId = #{quoteId}, + materialId = #{materialId}, + materialCode = #{materialCode}, + materialName = #{materialName}, + materialType = #{materialType}, + processMethod = #{processMethod}, + brand = #{brand}, + photoUrl = #{photoUrl}, + unit = #{unit}, + `describe` = #{describe}, + warehouseDept = #{warehouseDept}, + countTax = #{countTax}, + usdTax = #{usdTax}, + materialNum = #{materialNum}, + materialSole = #{materialSole}, + materialRmb = #{materialRmb}, + materialNoRmb = #{materialNoRmb}, + materialNoUsd = #{materialNoUsd}, + materialUsd = #{materialUsd}, + materialUsdSum = #{materialUsdSum}, + materialNoUsdSum = #{materialNoUsdSum}, + materialNoRmbSum = #{materialNoRmbSum}, + materialRmbSum = #{materialRmbSum}, + delivery_time = #{deliveryTime}, + expiry_day = #{expiryDay}, + out_bound_quantity = #{outBoundQuantity}, + un_bound_quantity = #{unBoundQuantity}, + finish_num = #{finishNum}, + apply_shipping_num = #{applyShippingNum}, + has_apply_shipping_num = #{hasApplyShippingNum}, + update_by = #{updateBy}, + remark = #{remark}, + audit_status = #{auditStatus}, + use_status = #{useStatus}, + create_time = #{createTime}, + update_time = #{updateTime}, + create_by = #{createBy}, + update_by = #{updateBy}, + + where quoteId = #{quoteId} + and materialCode = #{materialCode} + + + + delete from sys_sales_order_child where id = #{id} diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html new file mode 100644 index 00000000..073fe82e --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesDeliverGoods.html @@ -0,0 +1,231 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + + + + + + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file From 80bcbc538b17e913bea91b092abf172cdb4c12d4 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 10 Jul 2024 11:06:39 +0800 Subject: [PATCH 02/10] =?UTF-8?q?[feat]=20=E5=94=AE=E5=90=8E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E7=AE=A1=E7=90=86=20=E6=96=B0=E5=A2=9E=20=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E7=9A=84=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B1=A5=E5=8E=86=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6=E5=86=8D=E5=8A=A0=E4=B8=8A=20?= =?UTF-8?q?=E7=89=A9=E6=96=99=E5=8F=B7=20=E6=96=B0=E5=A2=9E=20=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E7=89=A9=E6=96=99=E5=8F=B7=E6=9F=A5=E8=AF=A2=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=88=97=E8=A1=A8?= =?UTF-8?q?=20=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=B1=95=E7=A4=BA=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=96=99=E5=8F=B7=E7=9B=B8=E5=85=B3=E5=87=BA=E8=B4=A7=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AF=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=B1=95=E7=A4=BA=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E6=96=99?= =?UTF-8?q?=E5=8F=B7=E7=9B=B8=E5=85=B3=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=94=B3=E8=AF=B7=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E7=AD=89=E5=AD=97=E6=AE=B5=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E7=9A=84=E6=96=B9=E6=B3=95=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=89=A9=E6=96=99=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=96=9D=E7=94=B3=E8=AF=B7=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E4=BF=9D=E5=AD=98=E9=94=80=E5=94=AE=E5=8D=95-?= =?UTF-8?q?=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99=20=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=97=B6=E6=9B=B4=E6=96=B0=20=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA=20=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWarehouseOutController.java | 36 +++ .../AfterSalesShippingDeviceMapper.java | 5 + .../IAftersalesWarehouseOutService.java | 5 + .../AftersalesWarehouseOutServiceImpl.java | 27 ++ .../controller/SysMakeOrderController.java | 1 + .../impl/WarehouseOutOrderServiceImpl.java | 15 +- .../AfterSalesShippingDeviceMapper.xml | 7 + .../warehouseOutOrder/addShippingDevices.html | 186 ------------ .../addShippingDevicesOne.html | 273 ++++++++++++++++++ .../maintenanceEquipmentOne.html | 39 ++- .../system/makeorder/addEquipmentResume.html | 3 +- .../warehouseOutOrder/prepareMaterial.html | 12 +- 12 files changed, 412 insertions(+), 197 deletions(-) delete mode 100644 ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html create mode 100644 ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html 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 96723c52..163c8516 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 @@ -263,6 +263,7 @@ public class AftersalesWarehouseOutController extends BaseController List list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); return getDataTable(list); } + /** * 展示售后第一次维护设备料号相关出货设备信息 */ @@ -276,6 +277,41 @@ public class AftersalesWarehouseOutController extends BaseController return getDataTable(list); } + + + + /** + * 售后第一次维护设备 添加出货设备信息 + */ + @GetMapping("/addShippingDevicesOne/{outOrderDetailId}") + public String addShippingDevicesOne(@PathVariable("outOrderDetailId") Long outOrderDetailId, ModelMap mmap) + { + WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId); + mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail); + return prefix + "/addShippingDevicesOne"; + } + + + + + + /** + * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 + */ + @PostMapping("/getEquipMaterialDetailByMaterialNo") + @ResponseBody + public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail) + { + + startPage(); + List list = warehouseOutOrderService.selectAftersalesShippingDeviceListByMaterialNo(warehouseOutOrderDetail); + return getDataTable(list); + } + + + + + /** * 第一次维护设备删除物料信息出货设备信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java index 2e1a3a3b..2fd79a99 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java @@ -102,4 +102,9 @@ public interface AfterSalesShippingDeviceMapper * 根据生产单号和关联销售单号查询出货设备履历信息 * */ List selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice); + + /* + * 根据物料号查询出货设备信息列表 + * */ + List selectShippingDeviceListByMaterialNo(AfterSalesShippingDevice afterSalesShippingDevice); } 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 77a7c7d0..2e95ce8b 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 @@ -114,4 +114,9 @@ public interface IAftersalesWarehouseOutService * 展示售后第一次维护设备物料相关信息 * */ List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); + + /** + * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 + * */ + List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail); } 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 5b4614a2..1291ad81 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 @@ -184,6 +184,33 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return warehouseOutOrderDetails; } + /** + * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 + * */ + @Override + public List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail) { + + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); + List afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice); + if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { + // 记录日志 + log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",warehouseOutOrderDetail.getMaterialNo()); + } + + for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) { + SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); + shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); + shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); + shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); + shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); + shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); + selectShippingDeviceVOs.add(shippingDeviceVO); + } + return selectShippingDeviceVOs; + } + /* * 售后第一次维护设备信息根据设备ID删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java index e227446b..444e367f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java @@ -257,6 +257,7 @@ public class SysMakeOrderController extends BaseController AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); afterSalesShippingDevice.setMakeNo(makeNo); afterSalesShippingDevice.setSalesOrderCode(salesOrderCode); + afterSalesShippingDevice.setMaterialNo(equipMaterialDto.getMaterialCode()); List equipDetailDtos = salesShippingDeviceService.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice); return getDataTable(equipDetailDtos); } 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 e1a7d6ba..f554a845 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 @@ -170,20 +170,27 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService String loginName = ShiroUtils.getLoginName(); warehouseOutOrder.setUpdateBy(loginName); warehouseOutOrder.setUpdateTime(new Date()); - warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + + //更改出库状态为 第一次维护设备信息 + warehouseOutOrder.setWarehouseOutStatus("1"); 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()); warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark()); //更新数据库记录 - updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + int updateOutOrderDetail = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (updateOutOrderDetail <= 0){ + throw new BusinessException("更新出库单详情数据失败"); + } } - return updateRows; + //出库单点击准备物料后生成售后单 + + int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + return updateWarehouseOutOrderResult; } diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index 33997e27..d5a9f599 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -98,6 +98,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where make_no = #{makeNo} and sales_order_code = #{salesOrderCode} + and material_no = #{materialNo} + + + + diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html deleted file mode 100644 index 316a5184..00000000 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - -
-
- - -
-

物料信息

-
-
-
-

出货设备

-
-
-
-
- - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html new file mode 100644 index 00000000..af49b115 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html @@ -0,0 +1,273 @@ + + + + + + + +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + +
+
+ +
+ +
+

出货设备

+
+
+
+
+ + +
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html index d35431fa..304c596e 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html @@ -124,13 +124,20 @@ columns: [{ checkbox: true }, + { title:'销售订单号', field:'quoteId', visible: false }, + { + title:'出库单详情Id', + field:'outOrderDetailId', + visible: false + + }, { title: '料号', - field: 'materialCode', + field: 'materialNo', }, { title: '图片', @@ -156,12 +163,28 @@ title: '描述', field: 'describe', }, + { + title: '订单数量', + field: 'makeNum', + }, + { + title: '已出库数', + field: 'hasOutOrderSum', + }, + { + title: '申请出库数', + field: 'applyOutOrderSum', + }, + { + title: '准备出库数', + field: 'prepareOutOrderSum', + }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('添加出货设备'); + actions.push('添加出货设备'); return actions.join(''); } } @@ -255,12 +278,18 @@ /*添加出货设备*/ - function addShippingDevices(quoteId, materialCode) { - // 确保URL编码,特别是如果materialCode中可能含有特殊字符 - var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevices/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); + // function addShippingDevicesOne(quoteId, materialCode) { + // // 确保URL编码,特别是如果materialCode中可能含有特殊字符 + // var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevicesOne/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); + // $.modal.open("添加出货设备", url); + // } + + function addShippingDevicesOne(outOrderDetailId) { + var url = prefix + '/addShippingDevicesOne/' + outOrderDetailId $.modal.open("添加出货设备", url); } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html index 6756d2b3..b00778cf 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html @@ -207,7 +207,8 @@ var curParams = { // 传递参数查询参数 makeNo: equipMaterial.makeNo, - quoteId: equipMaterial.quoteId + quoteId: equipMaterial.quoteId, + materialCode: equipMaterial.materialCode }; return curParams; } diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html index 5b0bc67b..367571f2 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html @@ -117,7 +117,17 @@ "outOrderDetailId":item.outOrderDetailId, "outOrderCode":item.outOrderCode, "materialNo": item.materialNo, // 假设id对应materialId - "prepareOutOrderSum":item.prepareOutOrderSum, + "materialName": item.materialName, + "materialType": item.materialType, + "materialPhotourl": item.materialPhotourl, + "materialDescribe": item.materialDescribe, + "materialBrand": item.materialBrand, + "materialUnit": item.materialUnit, + "materialProcessMethod": item.materialProcessMethod, + "makeNum": item.makeNum, + "hasOutOrderSum": item.hasOutOrderSum, + "applyOutOrderSum": item.applyOutOrderSum, + "prepareOutOrderSum": item.prepareOutOrderSum, // ...其他字段 }; }); From 5bc948d15298c0ad387e04d32b0fd759cf425e65 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 10 Jul 2024 14:46:04 +0800 Subject: [PATCH 03/10] =?UTF-8?q?[feat]=20=E5=94=AE=E5=90=8E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=94=AE=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E5=A4=87=20=E5=9B=BE=E7=89=87=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E4=B8=8D=E5=AF=B9=E9=97=AE=E9=A2=98=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=94=AE=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E5=A4=87=20=E6=8F=90=E4=BA=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=B1=A5=E5=8E=86=E4=BF=A1=E6=81=AFJS=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E8=A1=A8=E6=96=B0=E5=A2=9E=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E6=96=B0=E5=A2=9E=20=E5=94=AE=E5=90=8E=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E8=AE=BE=E5=A4=87=20=E4=BF=AE=E6=94=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=94=AE=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E8=AE=BE=E5=A4=87=20=E6=B7=BB=E5=8A=A0=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E4=BF=AE=E6=94=B9=20=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=96=99=E5=8F=B7=E5=B7=B2=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=87=BA=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=88=97=E8=A1=A8=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWarehouseOutController.java | 27 +++++---- .../domain/AfterSalesShippingDevice.java | 12 +++- .../IAftersalesWarehouseOutService.java | 6 ++ .../AftersalesWarehouseOutServiceImpl.java | 29 ++++++++++ .../domain/WarehouseOutOrderDetail.java | 16 ++++++ .../IWarehouseOutOrderDetailService.java | 5 ++ .../WarehouseOutOrderDetailServiceImpl.java | 24 ++++++++ .../AfterSalesShippingDeviceMapper.xml | 7 ++- .../addShippingDevicesOne.html | 55 +++++++++++++++---- .../maintenanceEquipmentOne.html | 4 +- 10 files changed, 160 insertions(+), 25 deletions(-) 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 163c8516..f083025a 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 @@ -11,11 +11,7 @@ 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.aftersales.service.IAftersalesWarehouseOutService; @@ -265,15 +261,15 @@ public class AftersalesWarehouseOutController extends BaseController } /** - * 展示售后第一次维护设备料号相关出货设备信息 + * 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 */ - @PostMapping("/showAftersalesShippingDevicelist") + @PostMapping("/showAftersalesShippingDeviceList") @ResponseBody - public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrder warehouseOutOrder) + public TableDataInfo showAftersalesShippingDeviceList(@RequestParam("materialNo") String materialNo) { startPage(); - List list = warehouseOutOrderService.selectAftersalesShippingDevicelistByCodeAndNo(warehouseOutOrder); + List list = warehouseOutOrderService.showAftersalesShippingDeviceList(materialNo); return getDataTable(list); } @@ -293,6 +289,17 @@ public class AftersalesWarehouseOutController extends BaseController + /** + * 修改保存售后第一次维护设备 添加出货设备信息 + */ + @ResponseBody + @PostMapping("/addShippingDevicesOne") + public AjaxResult addShippingDevicesOne(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail) + { + + return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail)); + } + /** @@ -310,8 +317,6 @@ public class AftersalesWarehouseOutController extends BaseController - - /** * 第一次维护设备删除物料信息出货设备信息 */ 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 1bdffb92..6bf4cece 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 @@ -158,7 +158,8 @@ public class AfterSalesShippingDevice extends BaseEntity @Excel(name = "维修时间", width = 30, dateFormat = "yyyy-MM-dd") private Date maintainTime; - + /** 是否添加出货设备(0代表是 1代表否) */ + private String addShippingDeviceFlag; public void setShippingDeviceCode(Long shippingDeviceCode) { this.shippingDeviceCode = shippingDeviceCode; @@ -464,6 +465,14 @@ public class AfterSalesShippingDevice extends BaseEntity this.maintainTime = maintainTime; } + public String getAddShippingDeviceFlag() { + return addShippingDeviceFlag; + } + + public void setAddShippingDeviceFlag(String addShippingDeviceFlag) { + this.addShippingDeviceFlag = addShippingDeviceFlag; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -505,6 +514,7 @@ public class AfterSalesShippingDevice extends BaseEntity .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("addShippingDeviceFlag",getAddShippingDeviceFlag()) .toString(); } } 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 2e95ce8b..1420df74 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 @@ -119,4 +119,10 @@ public interface IAftersalesWarehouseOutService * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 * */ List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail); + + /** + * 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 + * */ + List showAftersalesShippingDeviceList(String materialNo); + } 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 1291ad81..d4859b94 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 @@ -2,6 +2,7 @@ package com.ruoyi.aftersales.service.impl; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; import com.ruoyi.aftersales.domain.vo.SelectMaterialsVO; @@ -211,6 +212,34 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return selectShippingDeviceVOs; } + /** + * 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 + * */ + @Override + public List showAftersalesShippingDeviceList(String materialNo) { + + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(materialNo); + List afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice); + List filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList()); + if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) { + // 记录日志 + log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo); + } + + for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) { + SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); + shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); + shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); + shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); + shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); + shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); + selectShippingDeviceVOs.add(shippingDeviceVO); + } + return selectShippingDeviceVOs; + } + /* * 售后第一次维护设备信息根据设备ID删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java index 777e0796..57f887ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrderDetail.java @@ -1,7 +1,10 @@ package com.ruoyi.warehouse.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -199,6 +202,10 @@ public class WarehouseOutOrderDetail extends BaseEntity @Excel(name = "收货电话") private String deliveryNumber; + /** 添加出货设备列表*/ + private List SelectShippingDeviceVOList; + + public void setOutOrderDetailId(Long outOrderDetailId) { this.outOrderDetailId = outOrderDetailId; @@ -605,6 +612,14 @@ public class WarehouseOutOrderDetail extends BaseEntity return deliveryNumber; } + public List getSelectShippingDeviceVOList() { + return SelectShippingDeviceVOList; + } + + public void setSelectShippingDeviceVOList(List selectShippingDeviceVOList) { + SelectShippingDeviceVOList = selectShippingDeviceVOList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -658,6 +673,7 @@ public class WarehouseOutOrderDetail extends BaseEntity .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("selectShippingDeviceVOList",getSelectShippingDeviceVOList()) .toString(); } } 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 0739d3d2..ed3624bb 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 @@ -91,4 +91,9 @@ public interface IWarehouseOutOrderDetailService * 退换货-出库 供应商物料详情列表 */ List selectWarehouseOutOrderDetailListByCode(String outOrderCode); + + /** + * 修改保存售后第一次维护设备 添加出货设备信息 + */ + int addShippingDevicesOne(WarehouseOutOrderDetail warehouseOutOrderDetail); } 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 9b70eca2..c4dcb061 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 @@ -3,7 +3,9 @@ package com.ruoyi.warehouse.service.impl; import java.util.List; import com.ruoyi.aftersales.domain.AfterSalesShippingDevice; +import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; @@ -16,6 +18,7 @@ import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 出库单详情Service业务层处理 @@ -165,4 +168,25 @@ public class WarehouseOutOrderDetailServiceImpl implements IWarehouseOutOrderDet return warehouseOutOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode); } + + /** + * 修改保存售后第一次维护设备 添加出货设备信息 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int addShippingDevicesOne(WarehouseOutOrderDetail warehouseOutOrderDetail) { + List selectShippingDeviceVOList = warehouseOutOrderDetail.getSelectShippingDeviceVOList(); + int updateShippingDeviceResult = 0; + for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); + //设置为已经添加出货设备 + afterSalesShippingDevice.setAddShippingDeviceFlag("0"); + updateShippingDeviceResult += afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); + if (updateShippingDeviceResult <= 0){ + throw new BusinessException("更新出货设备信息失败"); + } + } + return updateShippingDeviceResult; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index d5a9f599..c93078fa 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -43,10 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select shipping_device_code, shipping_device_id, make_no,sales_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 from aftersales_shipping_device + select shipping_device_code, shipping_device_id, make_no,sales_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 from aftersales_shipping_device + @@ -111,12 +111,47 @@ focusCleanup: true }); + /* + * 提交设备履历信息 + * */ function submitHandler() { - if ($.validate.form()) { - $.operate.save(prefix + "/edit", $('#form-addShippingDevicesOne-edit').serialize()); + // 获取表单数据 + const shippingDevicesData = $("#form-addShippingDevicesOne-edit").serializeArray().reduce((obj, item) => { + obj[item.name] = item.value; + return obj; + }, {}); + // 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 + // var table = $('#table-shippingDevices').bootstrapTable('getData'); + //获取选中复选框行的数据 + const selectedRows = $("#table-shippingDevices").bootstrapTable('getSelections'); + // 检查表格数据是否为空 + if (selectedRows.length===0){ + $.modal.alertWarning("请至少选择一条出货设备信息后再保存!"); + return; } + // 将表数据转换成与complaintNoticeData格式一致的数组 + var equipDetailDataList = selectedRows.map(function(item) { + // 根据实际字段名调整 + return { + "shippingDeviceId": item.shippingDeviceId, + "deviceModelCode": item.deviceModelCode, + "deviceRunningNumber": item.deviceRunningNumber, + "makePhotoUrl": item.makePhotoUrl + // ...其他字段 + }; + }); + + // 合并表单数据和表格数据 + const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); + + console.log(combinedData) + // 使用 JSON.stringify() 序列化数据 + const jsonData = JSON.stringify(combinedData); + // 发送 AJAX 请求到后端接口 + $.operate.saveJson(prefix + "/addShippingDevicesOne", jsonData); } + $("input[name='outOrderTime']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", @@ -195,7 +230,7 @@ $(function(){ var options = { - id: "form-equipMaterialDetail-add", + id: "table-shippingDevices", url: prefix + "/getEquipMaterialDetailByMaterialNo", pagination: false, showSearch: false, @@ -217,22 +252,22 @@ } }, { - field: 'equipmentId', + field: 'shippingDeviceId', align: 'center', title: '出货设备id', }, { - field: 'equipmentModel', + field: 'deviceModelCode', align: 'center', title: '设备型号', }, { - field: 'serialNo', + field: 'deviceRunningNumber', align: 'center', title: '流水号', }, { - field: 'producePic', + field: 'makePhotoUrl', align: 'center', title: '生产图片', }, @@ -259,10 +294,10 @@ } function removeRow(index) { - var data = $('#form-equipMaterialDetail-add').bootstrapTable('getData'); + var data = $('#table-shippingDevices').bootstrapTable('getData'); var row = data[index]; // 获取要删除的行数据 if (row) { - $('#form-equipMaterialDetail-add').bootstrapTable('remove', { + $('#table-shippingDevices').bootstrapTable('remove', { field: 'equipmentIndex', values: [row.equipmentIndex] }); diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html index 304c596e..3adb18d3 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html @@ -200,12 +200,12 @@ var childTableId = 'child_table_'+index; $detail.html('
'); $('#'+childTableId).bootstrapTable({ - url: prefix + "/showAftersalesShippingDevicelist", + url: prefix + "/showAftersalesShippingDeviceList", method: 'post', sidePagination: "server", contentType: "application/x-www-form-urlencoded", queryParams : { - salesOrderCode: warehouseOutOrder.salesOrderCode, + // salesOrderCode: warehouseOutOrder.salesOrderCode, materialNo: parentRow.materialNo }, columns: [ From 03bf21d5463806d7cef8237d4c002ff8e064c9de Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 10 Jul 2024 20:07:24 +0800 Subject: [PATCH 04/10] =?UTF-8?q?[feat]=20=E5=94=AE=E5=90=8E=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20=E7=AC=AC=E4=B8=80=E6=AC=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AE=BE=E5=A4=87=E5=87=BA=E8=B4=A7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20js=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=20=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87ID?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E5=94=AE=E5=90=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=9A=84=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=8A=B6=E6=80=81=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98=E5=94=AE=E5=90=8E=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E7=AC=AC=E4=B8=80=E6=AC=A1=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=89=8D=E7=AB=AF=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=8B=BF=E4=B8=8D=E5=88=B0=E5=80=BC?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20=E5=8A=A0=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=97=B6=E6=96=B0=E5=A2=9E=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E=20snCode?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=20=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=A0=B9=E6=8D=AE=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B9=E6=B3=95=20=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=9B=86=E5=90=88=E5=AD=97=E6=AE=B5=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E5=8D=95=E9=94=80=E5=94=AE?= =?UTF-8?q?=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99=E5=90=8E=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=9A=84=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWarehouseOutController.java | 4 +- .../domain/vo/SelectShippingDeviceVO.java | 2 + .../AfterSalesShippingDeviceMapper.java | 12 +++- .../IAftersalesWarehouseOutService.java | 4 ++ .../AftersalesWarehouseOutServiceImpl.java | 50 ++++++++++++++ .../mapper/SysSalesShippingInformMapper.java | 10 +++ .../warehouse/domain/WarehouseOutOrder.java | 15 +++++ .../impl/WarehouseOutOrderServiceImpl.java | 23 +++++-- .../AfterSalesShippingDeviceMapper.xml | 8 +++ .../system/SysSalesShippingInformMapper.xml | 36 ++++++++++ .../addShippingDevicesOne.html | 2 +- .../maintenanceEquipmentOne.html | 66 +++++++++++++++++-- 12 files changed, 216 insertions(+), 16 deletions(-) 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 f083025a..230b3b2b 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 @@ -241,9 +241,9 @@ public class AftersalesWarehouseOutController extends BaseController @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) @PostMapping("/maintenanceEquipmentOne") @ResponseBody - public AjaxResult maintenanceEquipmentOneSave(WarehouseOutOrder warehouseOutOrder) + public AjaxResult maintenanceEquipmentOneSave(@RequestBody WarehouseOutOrder warehouseOutOrder) { - return toAjax(warehouseOutOrderService.updateWarehouseOutOrder(warehouseOutOrder)); + return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentOne(warehouseOutOrder)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java index 0fbae240..f6a0ec33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java @@ -18,5 +18,7 @@ public class SelectShippingDeviceVO { private String makePhotoUrl; + private String snCode; + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java index 2fd79a99..afe3d0d0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java @@ -14,12 +14,20 @@ public interface AfterSalesShippingDeviceMapper /** * 查询出货设备 * - * @param shippingDeviceCode 出货设备ID + * @param shippingDeviceCode 出货设备Code * @return 出货设备 */ public AfterSalesShippingDevice selectAfterSalesShippingDeviceById(Long shippingDeviceCode); + /** + * 查询出货设备 + * + * @param shippingDeviceId 出货设备ID + * @return 出货设备 + */ + public AfterSalesShippingDevice selectAfterSalesShippingDeviceByShippingDeviceId(String shippingDeviceId); + /** * 查询选择设备 * @@ -64,7 +72,7 @@ public interface AfterSalesShippingDeviceMapper /** * 删除出货设备 * - * @param shippingDeviceCode 出货设备ID + * @param shippingDeviceId 出货设备ID * @return 结果 */ public int deleteAfterSalesShippingDeviceById(String shippingDeviceId); 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 1420df74..b091fc29 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 @@ -125,4 +125,8 @@ public interface IAftersalesWarehouseOutService * */ List showAftersalesShippingDeviceList(String materialNo); + /** + * 修改保存售后第一次维护设备 + */ + int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder); } 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 d4859b94..e176bfef 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 @@ -1,6 +1,7 @@ package com.ruoyi.aftersales.service.impl; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -13,7 +14,9 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.SysSalesOrderChild; +import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.mapper.SysSalesOrderChildMapper; +import com.ruoyi.system.mapper.SysSalesShippingInformMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; @@ -23,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.aftersales.service.IAftersalesWarehouseOutService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 出库单Service业务层处理 @@ -46,6 +50,9 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu @Autowired private WarehouseOutOrderDetailMapper outOrderDetailMapper; + @Autowired + private SysSalesShippingInformMapper shippingInformMapper; + /** * 查询出库单 * @@ -240,6 +247,49 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return selectShippingDeviceVOs; } + /** + * 修改保存售后第一次维护设备 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder) { + + String loginName = ShiroUtils.getLoginName(); + + List selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList(); + for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); + afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); + afterSalesShippingDevice.setUpdateBy(loginName); + afterSalesShippingDevice.setUpdateTime(new Date()); + int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); + if (updateShippingDeviceResult <= 0){ + throw new BusinessException("更新出货设备数据失败"); + } + + } + + //设置出库单为待业务确认发货 + warehouseOutOrder.setWarehouseOutStatus("2"); + + //更新销售管理销售出库的出货状态 待业务确认发货 + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + sysSalesShippingInform.setWarehouseOutStatus("2"); + sysSalesShippingInform.setUpdateBy(loginName); + sysSalesShippingInform.setUpdateTime(new Date()); + int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + if (updateShippingInformResult <= 0){ + log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); + throw new BusinessException("更新销售出库单数据失败"); + } + + + + return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + } + /* * 售后第一次维护设备信息根据设备ID删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java index 3aae2e63..1118c835 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java @@ -43,6 +43,16 @@ public interface SysSalesShippingInformMapper */ public int updateSysSalesShippingInform(SysSalesShippingInform sysSalesShippingInform); + + /** + * 修改销售出货通知 + * + * @param sysSalesShippingInform 销售出货通知 + * @return 结果 + */ + public int updateSysSalesShippingInformByOutOrderCode(SysSalesShippingInform sysSalesShippingInform); + + /** * 删除销售出货通知 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java index ca862021..3304d077 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -130,6 +131,11 @@ public class WarehouseOutOrder extends BaseEntity /** 仓库出库单详情*/ private List warehouseOutOrderDetailList; + /** 添加出货设备列表*/ + + private List selectShippingDeviceVOList; + + public void setOutOrderId(Long outOrderId) { this.outOrderId = outOrderId; @@ -428,6 +434,14 @@ public class WarehouseOutOrder extends BaseEntity this.warehouseOutOrderDetailList = warehouseOutOrderDetailList; } + public List getSelectShippingDeviceVOList() { + return selectShippingDeviceVOList; + } + + public void setSelectShippingDeviceVOList(List selectShippingDeviceVOList) { + this.selectShippingDeviceVOList = selectShippingDeviceVOList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -469,6 +483,7 @@ public class WarehouseOutOrder extends BaseEntity .append("updateTime", getUpdateTime()) .append("remark", getRemark()) .append("warehouseOutOrderDetailList",getWarehouseOutOrderDetailList()) + .append("selectShippingDeviceVOList",getSelectShippingDeviceVOList()) .toString(); } } 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 f554a845..a189925d 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 @@ -9,10 +9,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.domain.*; -import com.ruoyi.system.mapper.SysMakeOrderMapper; -import com.ruoyi.system.mapper.SysMakeorderPickDetailMapper; -import com.ruoyi.system.mapper.SysMakeorderPickMapper; -import com.ruoyi.system.mapper.SysSalesOrderMapper; +import com.ruoyi.system.mapper.*; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; @@ -58,6 +55,10 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService @Autowired private RedisCache redisCache; + @Autowired + private SysSalesShippingInformMapper shippingInformMapper; + + /** * 查询仓库出库单 * @@ -187,7 +188,19 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService throw new BusinessException("更新出库单详情数据失败"); } } - //出库单点击准备物料后生成售后单 + + + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + //更新销售管理销售出库的出货状态 待售后维护设备1 + sysSalesShippingInform.setWarehouseOutStatus("1"); + sysSalesShippingInform.setUpdateBy(loginName); + sysSalesShippingInform.setUpdateTime(new Date()); + int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + if (updateShippingInformResult <= 0){ + log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); + throw new BusinessException("更新销售出库单数据失败"); + } int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); return updateWarehouseOutOrderResult; diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index c93078fa..c4468920 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -79,6 +79,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where shipping_device_code = #{shippingDeviceCode} + + + + +
@@ -85,16 +85,53 @@ var prefix = ctx + "aftersales/warehouseOutOrder"; var warehouseOutOrder = [[${warehouseOutOrder}]]; - $("#form-warehouseOutOrder-edit").validate({ + $("#form-maintenanceEquipmentOne-edit").validate({ focusCleanup: true }); + // function submitHandler() { + // if ($.validate.form()) { + // $.operate.save(prefix + "/maintenanceEquipmentOne", $('#form-maintenanceEquipmentOne-edit').serialize()); + // } + // } + + function submitHandler() { - if ($.validate.form()) { - $.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize()); - } + // 获取表单数据 + const shippingDevicesData = $("#form-maintenanceEquipmentOne-edit").serializeArray().reduce((obj, item) => { + obj[item.name] = item.value; + return obj; + }, {}); + + // 在需要收集所有子表数据的地方调用此函数 + var allSubData = getAllSubTablesData(); + + // 将表数据转换成与complaintNoticeData格式一致的数组 + var equipDetailDataList = allSubData.map(function(item) { + // 根据实际字段名调整 + return { + "shippingDeviceId": item.shippingDeviceId, + "deviceModelCode": item.deviceModelCode, + "deviceRunningNumber": item.deviceRunningNumber, + "makePhotoUrl": item.makePhotoUrl, + "snCode": item.snCode + // ...其他字段 + }; + }); + + // 合并表单数据和表格数据 + const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); + + console.log(combinedData) + // 使用 JSON.stringify() 序列化数据 + const jsonData = JSON.stringify(combinedData); + // 发送 AJAX 请求到后端接口 + $.operate.saveJson(prefix + "/maintenanceEquipmentOne", jsonData); } + + + $("input[name='outOrderTime']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", @@ -107,8 +144,10 @@ autoclose: true }); + $(function() { var options = { + id:'bootstrap-table', url: prefix + "/getMaintenanceEquipmentOneMaterials", modalName: "物料信息", showColumns: false, @@ -191,7 +230,6 @@ ] }; $.table.init(options); - }) @@ -237,6 +275,7 @@ }); }; + function queryParams(params) { var curParams = { // 传递参数查询参数 @@ -246,6 +285,21 @@ } + // 获取所有子表数据的函数 + // 获取所有子表数据的函数 + function getAllSubTablesData() { + var allSubData = []; + // 获取所有被展开的行 + var parentLength = $("#bootstrap-table").bootstrapTable("getData").length; + for (let i = 0; i < parentLength; i++) { + var sonData = $('#'+"child_table_" + i).bootstrapTable("getData"); + //循环获取子表中存在的行数据,每个行数据转换添加到allSubData数组中 + allSubData = allSubData.concat(sonData); + } + return allSubData; + } + + function deleteRow(shippingDeviceId) { // 弹出确认框询问用户是否确定删除 if (confirm("确定要删除这条记录吗?")) { From 81aef1730430160f0ffe2c4b74249d30c300dd1e Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Wed, 10 Jul 2024 20:31:40 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E4=B8=9A=E5=8A=A1=E7=BB=8F=E7=90=86=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=8A=A5=E4=BB=B7=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=9C=89=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/system/customerQuote/add.html | 89 +++++---- .../system/customerQuote/detail.html | 27 +-- .../templates/system/customerQuote/edit.html | 22 +-- .../system/customerQuote/taskModifyApply.html | 172 ++++++++++-------- .../system/customerQuote/taskYwjlVerify.html | 100 +++++----- .../system/customerQuote/taskYwzgVerify.html | 65 ++++--- .../system/customerQuote/taskZozjVerify.html | 87 ++++----- 7 files changed, 276 insertions(+), 286 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html index 2a1da822..f722f360 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/add.html @@ -145,6 +145,7 @@ var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]]; var userName = [[${@permission.getPrincipalProperty('userName')}]]; + var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var prefix = ctx + "system/customerQuote"; var commonCurrency = $("#commonCurrency_add option:selected").val(); $("#form-customerQuote-add").validate({focusCleanup: true}); @@ -166,11 +167,9 @@ } } } - //获取客户信息 - - // 监听客户编号下拉框的变化 - $('#customerCode').on('change', function() { + // 监听客户编号下拉框的变化 + $('#customerCode').on('change', function() { var selectedCustomerCode = $(this).val(); // 获取选中的客户ID if (selectedCustomerCode) { // 发起Ajax请求获取客户名称 @@ -208,14 +207,12 @@ $('input[name="customerName"]').val(''); } }); - - $(document).ready(function() { // 初始化时默认加载客户编号列表 loadCustomerIds(); }); // 假设的加载客户编号列表函数 - function loadCustomerIds() { + function loadCustomerIds() { var url = ctx + 'system/customer/getCustomers'; $.ajax({ type: 'GET', // 请求类型 @@ -245,9 +242,6 @@ } }); } - - - //添加收款明细 function insertNoMaterialNoRow() { // 生成一个简单的唯一标识,这里使用时间戳作为示例 @@ -270,8 +264,6 @@ } - - $(function() { var options = { id:'bootstrap-sub-table-quoteChild', @@ -544,46 +536,51 @@ // 可以选择取消这次编辑操作,但Bootstrap Table默认不会提供直接的API来取消编辑后的保存,您可能需要手动恢复数据或采取其他策略。 } }); - // 初始化时也需要根据当前的货币类型设置一次 $("#commonCurrency_add").trigger('change'); + getBusinessMembers(); + getCustomerCode(); }); - //获取单号 - $.ajax({ - url: prefix + "/getId", - type: "post", - dateType: "json", - success: function (resp) { - if (resp.code === 0) { - $("input[name='supplierCode']").val(resp.data); - } else { - $.modal.msgError("失败啦"); + function getCustomerCode(){ + //获取单号 + $.ajax({ + url: prefix + "/getId", + type: "post", + dateType: "json", + success: function (resp) { + if (resp.code === 0) { + $("input[name='supplierCode']").val(resp.data); + } else { + $.modal.msgError("失败啦"); + } + }, + error: function () { + $.modal.msgError("后台出错啦!"); } - }, - error: function () { - $.modal.msgError("后台出错啦!"); - } - }); - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - //alert(JSON.stringify(data)); - for (let i in usertData) { - // console.log(finishProductData[i].finishProductCode) - $("#form-customerQuote-add select[name='businessMembers']").append( - ""); + }); + } + function getBusinessMembers(){ + /*业务员列表*/ + $.ajax({ + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + //alert(JSON.stringify(data)); + for (let i in usertData) { + // console.log(finishProductData[i].finishProductCode) + $("#form-customerQuote-add select[name='businessMembers']").append( + ""); + } + $("#form-customerQuote-add select[name='businessMembers']").val(loginName).trigger("change"); + } else { + $.modal.msgError(res.msg); } - $("#form-customerQuote-add select[name='businessMembers']").val(userName).trigger("change"); - } else { - $.modal.msgError(res.msg); } - } - }); + }); + } function doSubmit(index, layero,uniqueId){ console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html index 4a5e27d6..df0750e0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/detail.html @@ -70,7 +70,10 @@
- +
+ + % +
@@ -142,28 +145,6 @@ var commonCurrency = $("#commonCurrency_edit option:selected").val(); $("#form-customerQuote-edit").validate({focusCleanup: true}); //计算 - $(function() { - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - //alert(JSON.stringify(data)); - for (let i in usertData) { - // console.log(finishProductData[i].finishProductCode) - $("#form-customerQuote-detail select[name='businessMembers']").append(""); - } - $("#form-customerQuote-detail select[name='businessMembers']").val(sysCustomerQuote.businessMembers); - } else { - $.modal.msgError(res.msg); - } - } - }); - }); $(function() { var options = { id: "bootstrap-table-Quote-child-detail", diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html index 79b379e2..54f3e6c0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/edit.html @@ -466,22 +466,22 @@ //计算 function getTotalAmount(){ let getData = $("#bootstrap-table-Quote-child-edit1").bootstrapTable('getData', true); - var enterprise = ""; + var enterprise = 0; let enterpriseSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0; let rmbSum = 0;let noUsd = 0;let usd = 0; let noUsdSum = 0;let usdSum = 0; for(var i=0;i + + @@ -16,13 +18,13 @@
- +
- +
@@ -31,7 +33,7 @@
- +
@@ -48,12 +50,11 @@
-
+
- + +
@@ -84,8 +85,8 @@
- -
+ +
@@ -96,7 +97,10 @@
- +
+ + % +
@@ -170,6 +174,9 @@
+ + + @@ -184,39 +191,16 @@ var sysCustomerQuote = [[${formData}]]; var prefix = ctx + "system/customerQuote" var commonCurrency = $("#commonCurrency_edit option:selected").val(); - $("#form-customerQuote-modify").validate({ - focusCleanup: true, - }); - $(function() { - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - for (let i in usertData) { - $("#form-customerQuote-modify select[name='businessMembers']").append(""); - } - $("#form-customerQuote-modify select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") - } else { - $.modal.msgError(res.msg); - } - } - }); - var confirmFax = $("input[name='confirmFax']"); - confirmFax.val([sysCustomerQuote.confirmFax]); - $("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); - confirmFax.change(function () { - if ($("input[name='confirmFax']").val() == "1") { - $("input[name='rmbTax']").val(sysCustomerQuote.taxRate); - } else { - $("input[name='rmbTax']").val(0); - } - }); - $("#commonCurrency_edit").val(sysCustomerQuote.commonCurrency).trigger('change'); + var businessMembers = [[${formData.businessMembers}]]; + var confirmFax = $("input[name='confirmFax']"); + $("#form-customerQuote-modify").validate({ focusCleanup: true}); + confirmFax.val([sysCustomerQuote.confirmFax]); + confirmFax.change(function () { + if ($("input[name='confirmFax']").val() == "1") { + $("input[name='rmbTax']").val(sysCustomerQuote.taxRate); + } else { + $("input[name='rmbTax']").val(0); + } }); $(function() { var options = { @@ -410,6 +394,25 @@ }; $.table.init(options); }); + function getBuniessMembers(){ + /*业务员列表*/ + $.ajax({ + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("#form-customerQuote-modify select[name='businessMembers']").append(""); + } + } else { + $.modal.msgError(res.msg); + } + } + }); + } function queryParams(params) { var curParams = { // 传递参数查询参数 @@ -422,11 +425,7 @@ } function submitHandler() { if ($.validate.form()) { - var formData = $("#form-customerQuote-modify").serializeArray(); - console.log("formData",formData); var tableData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData'); - console.log("tableData",JSON.stringify(tableData)); - var rows = tableData.length; var materialType = $('#selectMaterialType').select2('val'); $('#materialType').val(materialType); if ($('textarea[name="comment"]').val()) { @@ -495,43 +494,66 @@ }); getTotalAmount(); } - $("input[name='pricingDate']").datetimepicker({ - format: "yyyy-mm-dd", - minView: "month", - autoclose: true - }); //计算 function getTotalAmount(){ let getData = $("#bootstrap-table-Quote-child2").bootstrapTable('getData', true); - var enterprise = ""; + let enterprise = 0; let enterpriseSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0; let rmbSum = 0;let noUsd = 0;let usd = 0; let noUsdSum = 0;let usdSum = 0; - for(var i=0;i \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html index e1d261e9..b2b8310a 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html @@ -14,13 +14,13 @@
- +
- +
@@ -29,7 +29,7 @@
- +
@@ -46,12 +46,10 @@
-
+
- +
@@ -69,7 +67,7 @@
- @@ -78,7 +76,7 @@
- +
@@ -94,7 +92,10 @@
- +
+ + % +
@@ -116,7 +117,7 @@

计算

- +
@@ -174,6 +175,7 @@
+ @@ -188,39 +190,6 @@ var sysCustomerQuote = [[${formData}]]; var prefix = ctx + "system/customerQuote" var commonCurrency = $("#commonCurrency_edit option:selected").val(); - $("#form-customerQuote-ywjl").validate({ - focusCleanup: true, - }); - $(function() { - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - for (let i in usertData) { - $("#form-customerQuote-ywjl select[name='businessMembers']").append(""); - } - $("#form-customerQuote-ywjl select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") - } else { - $.modal.msgError(res.msg); - } - } - }); - var confirmFax = $("input[name='confirmFax']"); - confirmFax.val([sysCustomerQuote.confirmFax]); - $("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); - confirmFax.change(function () { - if ($("input[name='confirmFax']").val() == "1") { - $("input[name='rmbTax']").val(sysCustomerQuote.taxRate); - } else { - $("input[name='rmbTax']").val(0); - } - }); - $("#commonCurrency_edit").val(sysCustomerQuote.commonCurrency).trigger('change'); - }); $(function() { var options = { id: "bootstrap-table-Quote-child4", @@ -479,6 +448,24 @@ }) getTotalAmount(); } + function getBuniessMembers() { + $.ajax({ + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("#form-customerQuote-ywjl select[name='businessMembers']").append(""); + } + $("#form-customerQuote-ywjl select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") + } else { + $.modal.msgError(res.msg); + } + } + }); + } $("input[name='pricingDate']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", @@ -486,23 +473,24 @@ }); //计算 function getTotalAmount(){ - let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData', true); - var enterprise = ""; + let getData = $("#bootstrap-table-Quote-child4").bootstrapTable('getData'); + var enterprise = 0; let enterpriseSum = 0; let noRmb = 0;let rmb = 0;let noRmbSum = 0; let rmbSum = 0;let noUsd = 0;let usd = 0; let noUsdSum = 0;let usdSum = 0; for(var i=0;i
-
+
- + +
@@ -174,6 +173,7 @@
+ @@ -490,28 +490,43 @@ let noRmb = 0;let rmb = 0;let noRmbSum = 0; let rmbSum = 0;let noUsd = 0;let usd = 0; let noUsdSum = 0;let usdSum = 0; - for(var i=0;i sum + (parseInt(item.materialNum) || 0), 0); + + // 先累加数值,toFixed在累加后应用以避免精度损失 + for (let i = 0; i < getData.length; i++) { + noRmb += parseFloat(getData[i].materialNoRmb) || 0; + rmb += parseFloat(getData[i].materialRmb) || 0; + noRmbSum += parseFloat(getData[i].materialNoRmbSum) || 0; + rmbSum += parseFloat(getData[i].materialRmbSum) || 0; + noUsd += parseFloat(getData[i].materialNoUsd) || 0; + usd += parseFloat(getData[i].materialUsd) || 0; + noUsdSum += parseFloat(getData[i].materialNoUsdSum) || 0; + usdSum += parseFloat(getData[i].materialUsdSum) || 0; } - $("#enterprise_edit").val(enterprise); - $("#enterpriseSum_edit").val(enterpriseSum); - $("#noRmb_edit").val(noRmb); - $("#rmb_edit").val(rmb); - $("#noRmbSum_edit").val(noRmbSum); - $("#rmbSum_edit").val(rmbSum); - $("#noUsd_edit").val(noUsd); - $("#usd_edit").val(usd); - $("#noUsdSum_edit").val(noUsdSum); - $("#usdSum_edit").val(usdSum); + + // 将累加的结果格式化为两位小数 + noRmb = noRmb.toFixed(2); + rmb = rmb.toFixed(2); + noRmbSum = noRmbSum.toFixed(2); + rmbSum = rmbSum.toFixed(2); + noUsd = noUsd.toFixed(2); + usd = usd.toFixed(2); + noUsdSum = noUsdSum.toFixed(2); + usdSum = usdSum.toFixed(2); + + // 设置表单输入值 + $("input[name='enterprise']").val(enterprise); + $("input[name='enterpriseSum']").val(enterpriseSum); + $("input[name='noRmb']").val(noRmb); + $("input[name='noRmbSum']").val(noRmbSum); + $("input[name='rmb']").val(rmb); + $("input[name='rmbSum']").val(rmbSum); + $("input[name='noUsd']").val(noUsd); + $("input[name='noUsdSum']").val(noUsdSum); + $("input[name='usd']").val(usd); + $("input[name='usdSum']").val(usdSum); } function submitHandler() { if ($.validate.form()) { diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html index 56abf0c9..75ec7cf9 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html @@ -175,6 +175,7 @@
+ @@ -188,35 +189,6 @@ var prefix = ctx + "system/customerQuote" var commonCurrency = $("#commonCurrency_edit option:selected").val(); $("#form-customerQuote-zozj").validate({focusCleanup: true}); - $(function() { - /*业务员列表*/ - $.ajax({ - url: ctx + 'system/salesOrder/getBinessMembers', - type: 'get', - success: function (res) { - console.log(res) - if (res.rows.length > 0) { - var usertData = res.rows; - for (let i in usertData) { - $("#form-customerQuote-zozj select[name='businessMembers']").append(""); - } - $("#form-customerQuote-zozj select[name='businessMembers']").val(sysCustomerQuote.businessMembers).trigger("change") - } else { - $.modal.msgError(res.msg); - } - } - }); - var confirmFax = $("input[name='confirmFax']"); - confirmFax.val([sysCustomerQuote.confirmFax]).attr("checked", "check"); - $("input[name='rmbTax']").val([sysCustomerQuote.taxRate]); - confirmFax.change(function () { - if ($("input[name='confirmFax']").val() == "1") { - $("input[name='rmbTax']").val(sysCustomerQuote.taxRate); - } else { - $("input[name='rmbTax']").val(0); - } - }); - }); $(function() { var options = { id: "bootstrap-table-Quote-child5", @@ -423,28 +395,43 @@ let noRmb = 0;let rmb = 0;let noRmbSum = 0; let rmbSum = 0;let noUsd = 0;let usd = 0; let noUsdSum = 0;let usdSum = 0; - for(var i=0;i sum + (parseInt(item.materialNum) || 0), 0); + + // 先累加数值,toFixed在累加后应用以避免精度损失 + for (let i = 0; i < getData.length; i++) { + noRmb += parseFloat(getData[i].materialNoRmb) || 0; + rmb += parseFloat(getData[i].materialRmb) || 0; + noRmbSum += parseFloat(getData[i].materialNoRmbSum) || 0; + rmbSum += parseFloat(getData[i].materialRmbSum) || 0; + noUsd += parseFloat(getData[i].materialNoUsd) || 0; + usd += parseFloat(getData[i].materialUsd) || 0; + noUsdSum += parseFloat(getData[i].materialNoUsdSum) || 0; + usdSum += parseFloat(getData[i].materialUsdSum) || 0; } - $("#enterprise_edit").val(enterprise); - $("#enterpriseSum_edit").val(enterpriseSum); - $("#noRmb_edit").val(noRmb); - $("#rmb_edit").val(rmb); - $("#noRmbSum_edit").val(noRmbSum); - $("#rmbSum_edit").val(rmbSum); - $("#noUsd_edit").val(noUsd); - $("#usd_edit").val(usd); - $("#noUsdSum_edit").val(noUsdSum); - $("#usdSum_edit").val(usdSum); + + // 将累加的结果格式化为两位小数 + noRmb = noRmb.toFixed(2); + rmb = rmb.toFixed(2); + noRmbSum = noRmbSum.toFixed(2); + rmbSum = rmbSum.toFixed(2); + noUsd = noUsd.toFixed(2); + usd = usd.toFixed(2); + noUsdSum = noUsdSum.toFixed(2); + usdSum = usdSum.toFixed(2); + + // 设置表单输入值 + $("input[name='enterprise']").val(enterprise); + $("input[name='enterpriseSum']").val(enterpriseSum); + $("input[name='noRmb']").val(noRmb); + $("input[name='noRmbSum']").val(noRmbSum); + $("input[name='rmb']").val(rmb); + $("input[name='rmbSum']").val(rmbSum); + $("input[name='noUsd']").val(noUsd); + $("input[name='noUsdSum']").val(noUsdSum); + $("input[name='usd']").val(usd); + $("input[name='usdSum']").val(usdSum); } function submitHandler() { From af14da5c7b59e2fe8517abdb0aea85b97549254a Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Wed, 10 Jul 2024 20:32:56 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Abom=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E4=BF=AE=E6=94=B9=E7=BB=8F=E7=90=86=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=8F=AF=E5=85=A8=E9=83=A8=E6=9D=83=E9=99=90=E3=80=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=AE=A1=E6=A0=B8=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=A4=E5=AE=9A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/templates/erp/bom/add.html | 1 + .../main/resources/templates/erp/bom/bom.html | 2 +- .../resources/templates/erp/bom/detail.html | 22 ++++++++++++------- .../resources/templates/erp/bom/edit.html | 2 +- .../templates/erp/bom/taskGcjlVerify.html | 1 - 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html index d4e04253..fa8a082f 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html @@ -168,6 +168,7 @@ ""); } $("#selectEngineer").val(loginName); + $("input[name='engineer']").val(loginName); } else { $.modal.msgError(res.msg); } diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html index 4f1b3307..af806cde 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/bom.html @@ -220,7 +220,7 @@ // 有待办人展示审批按钮, if (row.todoUserId) { var todoUserIdList = row.todoUserId.split(","); - if(todoUserIdList.includes(loginName) || todoUserIdList.includes("admin")){ + if(todoUserIdList.includes(loginName)){ var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批'; actions.push(' '+nodeName+' '); } diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html index abd9b705..17cf99c2 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/detail.html @@ -231,19 +231,19 @@ editable : { editor: { defaultValue: '%', - title: '损耗率(%)', - mode: 'inline', + title : '损耗率(%)', + mode:'inline', type: 'text', // 编辑时同样附带百分比符号 - formatter: function (value) { + formatter: function(value) { return value + '%'; }, // 编辑后去除百分比符号 - custom_getter: function (value) { + custom_getter: function(value) { return value.replace('%', ''); } }, - validate : function (value) { + validate : function(value) { if (!value) { return '损耗率不能为空'; } @@ -256,13 +256,19 @@ if (num < 0 || num > 100) { return '损耗率必须大于等于0小于等于100'; } - } + }, }, formatter: function (value,row,index){ - if(value == null){ + if (value == null || value == ''){ return "%"; } - return value + "%"; + const regex = /(\d+(?:\.\d+)?)%/g; // 创建正则表达式,g标志表示全局匹配 + const match = value.match(regex); // 使用match方法查找所有匹配 + if (match) { + return value; + }else{ + return value + "%"; + } }, }, { diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html b/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html index 8b761f04..9c3b5c09 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html @@ -290,7 +290,7 @@ { field: 'processMethod', align: 'center', - title: '半成品类型', + title: '加工方式', formatter: function(value, row, index) { return $.table.selectDictLabel(processMethodDatas, value); } diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html b/ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html index 826598d4..e8410fb7 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/taskGcjlVerify.html @@ -263,7 +263,6 @@ $.operate.save(prefix + "/complete/" + taskId, $('#form-edit').serialize()); } } - \ No newline at end of file From 93732d2ed1f7778b87fad1260f66eae3f90c4d7d Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Wed, 10 Jul 2024 20:34:38 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=89=A9?= =?UTF-8?q?=E6=96=99=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0=E5=AD=90=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=BA=E9=80=9A=E8=BF=87=E5=90=8E=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E6=96=99=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erp/controller/ErpMaterialController.java | 15 ++++++++++++++- .../resources/templates/erp/material/select.html | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java index 29381023..f04db8c7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java @@ -95,7 +95,20 @@ public class ErpMaterialController extends BaseController List list = erpMaterialService.selectErpMaterialList(erpMaterialVo); return getDataTable(list); } - + /** + * 物料信息审核,通过物料查询*/ + @RequiresPermissions("erp:material:list") + @PostMapping("/selectList") + @ResponseBody + public TableDataInfo selectList(ErpMaterialVo erpMaterialVo) + { + erpMaterialVo.setUseStatus("1"); + erpMaterialVo.setAuditStatus("1"); + // 工程文员角色只能看到自己创建的数据 + startPage(); + List list = erpMaterialService.selectErpMaterialList(erpMaterialVo); + return getDataTable(list); + } /** * 导出物料信息列表 */ diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/select.html b/ruoyi-admin/src/main/resources/templates/erp/material/select.html index 88592cbd..f40e758b 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/select.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/select.html @@ -52,7 +52,7 @@ id: 'bootstrap-select-table', clickToSelect: true, // 点击选中行 singleSelect: true, // 单选 - url: prefix + "/list", + url: prefix + "/selectList", modalName: "物料信息", columns: [ {checkbox: true}, From 3f1404257560f66f883351ae0bb4059988fdc476 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Wed, 10 Jul 2024 20:35:33 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=87=87=E8=B4=AD=E9=A1=B5=E9=9D=A2=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/purchaseOrder/detail.html | 506 ++++++++++++++++++ .../purchaseOrder/taskCgjlVerify.html | 181 +++++++ .../purchaseOrder/taskCgzgVerify.html | 181 +++++++ .../purchaseOrder/taskFzjlVerify.html | 181 +++++++ .../purchaseOrder/taskModifyApply.html | 175 ++++++ 5 files changed, 1224 insertions(+) create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/detail.html create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgjlVerify.html create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgzgVerify.html create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskFzjlVerify.html create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/detail.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/detail.html new file mode 100644 index 00000000..87b289e3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/detail.html @@ -0,0 +1,506 @@ + + + + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ + +
+
+
+ +
+
+ +
+
+
+
+
+
+
+

+

选择采购信息

+  选择材料 +  删除材料 +
+
+
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgjlVerify.html new file mode 100644 index 00000000..a4ae33a1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgjlVerify.html @@ -0,0 +1,181 @@ + + + + + + + + +
+
+ + + + + + +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgzgVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgzgVerify.html new file mode 100644 index 00000000..2fb72b10 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskCgzgVerify.html @@ -0,0 +1,181 @@ + + + + + + + + +
+
+ + + + + + +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskFzjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskFzjlVerify.html new file mode 100644 index 00000000..d6366b0c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskFzjlVerify.html @@ -0,0 +1,181 @@ + + + + + + + + +
+
+ + + + + + +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html new file mode 100644 index 00000000..5cac9cb8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/taskModifyApply.html @@ -0,0 +1,175 @@ + + + + + + + + +
+
+ + + + + + + +
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file 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 09/10] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA=E5=BA=93=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=8D=95=20=E7=A1=AE=E8=AE=A4=E5=8F=91=E8=B4=A7=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=87=BA=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95=20?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8F=91=E8=B4=A7=E5=89=8D=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95=20=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=92=8C=E4=BF=AE=E6=94=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?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=E5=8F=96=E6=B6=88=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?=E5=87=BA=E5=BA=93=E5=8D=95=E6=96=B0=E5=A2=9E=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=87=BA=E5=BA=93=E5=8D=95=E5=8F=B7=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E6=95=B0=E6=8D=AE=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=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 From 6ecdd30021265920a8e97929b97931915c7e0c35 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 11 Jul 2024 13:49:11 +0800 Subject: [PATCH 10/10] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86=20=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=AD=97=E7=AC=A6=20=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=8E=BB=E6=8E=89=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E5=AD=97=E7=AC=A6=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E4=BF=AE=E6=94=B9=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=B1=95=E7=A4=BA=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=89=A9=E6=96=99=E4=BF=A1=E6=81=AF=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20=E5=B1=95=E7=A4=BA=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=96=99=E5=8F=B7=E5=B7=B2=E9=80=89=E6=8B=A9=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=87=BA=E8=B4=A7=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=20=E9=80=89=E6=8B=A9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AFVO=E7=B1=BB=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=20=E6=96=B0=E5=A2=9E=E7=AC=AC=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=9D=83=E9=99=90=E5=AD=97=E7=AC=A6=20=E5=94=AE?= =?UTF-8?q?=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesWarehouseOutController.java | 66 ++- .../domain/vo/SelectShippingDeviceVO.java | 20 + .../IAftersalesWarehouseOutService.java | 11 + .../AftersalesWarehouseOutServiceImpl.java | 86 ++++ .../maintenanceEquipmentOne.html | 4 +- .../maintenanceEquipmentTwo.html | 405 ++++++++++++++++++ .../warehouseOutOrder/warehouseOutOrder.html | 16 +- 7 files changed, 591 insertions(+), 17 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentTwo.html 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 230b3b2b..4abf6cf3 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 @@ -182,7 +182,6 @@ public class AftersalesWarehouseOutController extends BaseController /** * 添加出货设备查询物料信息 */ - @RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesMaterial") @PostMapping("/addShippingDevicesMaterial") @ResponseBody public TableDataInfo optionMaterial(SelectMaterialsVO selectMaterialsVO) @@ -196,7 +195,6 @@ public class AftersalesWarehouseOutController extends BaseController /** * 添加出货设备查询出货设备信息 */ - @RequiresPermissions("aftersales:warehouseOutOrder:addShippingDevicesOptions") @PostMapping("/addShippingDevicesOptions") @ResponseBody public TableDataInfo addShippingDevicesOptions(SelectMaterialsVO selectMaterialsVO) @@ -220,9 +218,6 @@ public class AftersalesWarehouseOutController extends BaseController } - - - /** * 售后第一次维护设备 */ @@ -263,9 +258,9 @@ public class AftersalesWarehouseOutController extends BaseController /** * 展示售后第一次维护设备料号已选择添加出货设备的相关出货设备信息 */ - @PostMapping("/showAftersalesShippingDeviceList") + @PostMapping("/showAftersalesShippingDeviceListOne") @ResponseBody - public TableDataInfo showAftersalesShippingDeviceList(@RequestParam("materialNo") String materialNo) + public TableDataInfo showAftersalesShippingDeviceListOne(@RequestParam("materialNo") String materialNo) { startPage(); @@ -287,14 +282,12 @@ public class AftersalesWarehouseOutController extends BaseController return prefix + "/addShippingDevicesOne"; } - - /** * 修改保存售后第一次维护设备 添加出货设备信息 */ @ResponseBody @PostMapping("/addShippingDevicesOne") - public AjaxResult addShippingDevicesOne(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail) + public AjaxResult addShippingDevicesOneSave(@RequestBody WarehouseOutOrderDetail warehouseOutOrderDetail) { return toAjax(outOrderDetailService.addShippingDevicesOne(warehouseOutOrderDetail)); @@ -330,4 +323,57 @@ public class AftersalesWarehouseOutController extends BaseController + + /** + * 售后第二次维护设备 + */ + @GetMapping("/maintenanceEquipmentTwo/{outOrderId}") + public String maintenanceEquipmentTwo(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) + { + WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); + mmap.put("warehouseOutOrder", warehouseOutOrder); + return prefix + "/maintenanceEquipmentTwo"; + } + + /** + * 修改保存售后第二次维护设备 + */ + @RequiresPermissions("aftersales:warehouseOutOrder:maintenanceEquipmentTwo") + @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) + @PostMapping("/maintenanceEquipmentTwo") + @ResponseBody + public AjaxResult maintenanceEquipmentTwoSave(@RequestBody WarehouseOutOrder warehouseOutOrder) + { + return toAjax(warehouseOutOrderService.updateMaintenanceEquipmentTwo(warehouseOutOrder)); + } + + + /** + * 展示售后第二次维护设备物料信息 + * */ + @PostMapping("/getMaintenanceEquipmentTwoMaterials") + @ResponseBody + public TableDataInfo getMaintenanceEquipmentTwoMaterials(WarehouseOutOrder warehouseOutOrder) + { + + startPage(); + List list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); + return getDataTable(list); + } + + + /** + * 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息 + */ + @PostMapping("/showAftersalesShippingDeviceListTwo") + @ResponseBody + public TableDataInfo showAftersalesShippingDeviceListTwo(@RequestParam("materialNo") String materialNo) + { + + startPage(); + List list = warehouseOutOrderService.showAftersalesShippingDeviceListTwo(materialNo); + return getDataTable(list); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java index f6a0ec33..cc4125b1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java @@ -1,5 +1,7 @@ package com.ruoyi.aftersales.domain.vo; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; import lombok.Data; /** * 添加出货设备时新增出货设备列表 @@ -20,5 +22,23 @@ public class SelectShippingDeviceVO { private String snCode; + /** 出厂日期 */ + private String factoryDate; + + /** 保修期 */ + private String guaranteePeriod; + + /** 锁机时间 */ + private String lockDate; + + /** 是否有锁机时间 */ + private String lockDateFlag; + + /** 损耗品到期时间 */ + private String wastageExpireDate; + + /** 二次维修后部件质保时间 */ + private String componentGuaranteeDate; + } 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 b091fc29..5a16ff02 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 @@ -129,4 +129,15 @@ public interface IAftersalesWarehouseOutService * 修改保存售后第一次维护设备 */ int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder); + + + /** + * 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息 + */ + List showAftersalesShippingDeviceListTwo(String materialNo); + + /** + * 修改保存售后第二次维护设备 + */ + int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder); } 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 e176bfef..ec33f164 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 @@ -290,6 +290,92 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); } + /** + * 展示售后第二次维护设备料号已选择添加出货设备的相关出货设备信息 + */ + @Override + public List showAftersalesShippingDeviceListTwo(String materialNo) { + + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(materialNo); + List afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice); + List filterAfterSalesShippingDevices = afterSalesShippingDevices.stream().filter(shippingDevice -> "0".equals(shippingDevice.getAddShippingDeviceFlag())).collect(Collectors.toList()); + if (!StringUtils.isNotEmpty(filterAfterSalesShippingDevices)) { + // 记录日志 + log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",materialNo); + } + + for (AfterSalesShippingDevice tempAfterSalesShippingDevice : filterAfterSalesShippingDevices) { + SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); + shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); + shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); + shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); + shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); + shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); + shippingDeviceVO.setSnCode(tempAfterSalesShippingDevice.getSnCode()); + shippingDeviceVO.setFactoryDate(tempAfterSalesShippingDevice.getFactoryDate()); + shippingDeviceVO.setGuaranteePeriod(tempAfterSalesShippingDevice.getGuaranteePeriod()); + shippingDeviceVO.setLockDate(tempAfterSalesShippingDevice.getLockDate()); + shippingDeviceVO.setLockDateFlag(tempAfterSalesShippingDevice.getLockDateFlag()); + shippingDeviceVO.setWastageExpireDate(tempAfterSalesShippingDevice.getWastageExpireDate()); + shippingDeviceVO.setComponentGuaranteeDate(tempAfterSalesShippingDevice.getComponentGuaranteeDate()); + selectShippingDeviceVOs.add(shippingDeviceVO); + + } + return selectShippingDeviceVOs; + } + + /** + * 修改保存售后第二次维护设备 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateMaintenanceEquipmentTwo(WarehouseOutOrder warehouseOutOrder) { + + String loginName = ShiroUtils.getLoginName(); + + List selectShippingDeviceVOList = warehouseOutOrder.getSelectShippingDeviceVOList(); + for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setShippingDeviceId(selectShippingDeviceVO.getShippingDeviceId()); + afterSalesShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); + afterSalesShippingDevice.setFactoryDate(selectShippingDeviceVO.getFactoryDate()); + afterSalesShippingDevice.setGuaranteePeriod(selectShippingDeviceVO.getGuaranteePeriod()); + afterSalesShippingDevice.setLockDate(selectShippingDeviceVO.getLockDate()); + afterSalesShippingDevice.setLockDateFlag(selectShippingDeviceVO.getLockDateFlag()); + afterSalesShippingDevice.setWastageExpireDate(selectShippingDeviceVO.getWastageExpireDate()); + afterSalesShippingDevice.setComponentGuaranteeDate(selectShippingDeviceVO.getComponentGuaranteeDate()); + afterSalesShippingDevice.setUpdateBy(loginName); + afterSalesShippingDevice.setUpdateTime(new Date()); + int updateShippingDeviceResult = shippingDeviceMapper.updateAfterSalesShippingDevice(afterSalesShippingDevice); + if (updateShippingDeviceResult <= 0){ + throw new BusinessException("更新出货设备数据失败"); + } + + } + + //设置出库单为待业务确认发货 + warehouseOutOrder.setWarehouseOutStatus("4"); + + //更新销售管理销售出库的出货状态 待业务确认发货 + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + sysSalesShippingInform.setOutOrderCode(warehouseOutOrder.getOutOrderCode()); + sysSalesShippingInform.setWarehouseOutStatus("4"); + sysSalesShippingInform.setUpdateBy(loginName); + sysSalesShippingInform.setUpdateTime(new Date()); + int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + if (updateShippingInformResult <= 0){ + log.warn("出库单号为空:{}",warehouseOutOrder.getOutOrderCode()); + throw new BusinessException("更新销售出库单数据失败"); + } + + + + return warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + + } + /* * 售后第一次维护设备信息根据设备ID删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html index d075be63..7d3b78f4 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html @@ -1,7 +1,7 @@ - + @@ -238,7 +238,7 @@ var childTableId = 'child_table_'+index; $detail.html('
'); $('#'+childTableId).bootstrapTable({ - url: prefix + "/showAftersalesShippingDeviceList", + url: prefix + "/showAftersalesShippingDeviceListOne", method: 'post', sidePagination: "server", contentType: "application/x-www-form-urlencoded", diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentTwo.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentTwo.html new file mode 100644 index 00000000..e1f67e66 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentTwo.html @@ -0,0 +1,405 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+

物料信息

+
+
+
+
+ + + + + + + \ No newline at end of file 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 fcc650d1..998b0854 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/warehouseOutOrder.html @@ -66,7 +66,7 @@ var removeFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:remove')}]]; var maintenanceEquipmentOneFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentOne')}]]; - + var maintenanceEquipmentTwoFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:maintenanceEquipmentTwo')}]]; var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; @@ -179,6 +179,9 @@ if (row.warehouseOutStatus== "1"){ actions.push('维护设备 '); } + if (row.warehouseOutStatus== "3"){ + actions.push('维护设备 '); + } return actions.join(''); } }] @@ -188,20 +191,23 @@ /*详情*/ function detail(outOrderId) { - // 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数 - // 示例逻辑: var url = ctx + 'aftersales/warehouseOutOrder/detail/'+outOrderId; $.modal.open("详情",url); } /*售后第一次维护设备*/ function maintenanceEquipmentOne(outOrderId) { - // 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数 - // 示例逻辑: var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentOne/'+outOrderId; $.modal.open("售后第一次维护设备",url); } + + /*售后第二次维护设备*/ + function maintenanceEquipmentTwo(outOrderId) { + var url = ctx + 'aftersales/warehouseOutOrder/maintenanceEquipmentTwo/'+outOrderId; + $.modal.open("售后第二次维护设备",url); + } + \ No newline at end of file