From 4ea543a6ae44e9748cc7556f2a17cf9a9afcbd0c Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 22 Jul 2024 15:08:52 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E9=80=89=E6=8B=A9=E8=AE=BE=E5=A4=87Vo?= =?UTF-8?q?=E7=B1=BB=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=8F=91=E8=B5=B7=E5=94=AE=E5=90=8E=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=91=E8=B5=B7=E5=94=AE=E5=90=8E=E7=89=A9?= =?UTF-8?q?=E6=96=99=E9=80=89=E6=8B=A9=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=94=AE=E5=90=8E=E9=80=89=E6=8B=A9=E8=AE=BE=E5=A4=87Vo?= =?UTF-8?q?=E7=B1=BB=E9=9B=86=E5=90=88=E6=88=90=E5=91=98=E5=8F=98=E9=87=8F?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=A0=B9=E6=8D=AE=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=9F=A5=E8=AF=A2=E9=94=80=E5=94=AE=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E9=9B=86=E5=90=88=E5=90=8E=E7=AB=AF?= =?UT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?q?=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E5=92=8C=E5=94=AE=E5=90=8E=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalesAftersalesNoticeController.java | 35 +++ .../ISalesAftersalesNoticeService.java | 6 + .../SalesAftersalesNoticeServiceImpl.java | 40 ++- .../controller/SysSalesOrderController.java | 23 ++ .../ruoyi/system/domain/SysSalesOrder.java | 12 + .../domain/Vo/SelectAftersalesNoticeVO.java | 88 ++++++ .../system/SysSalesOrderChildMapper.xml | 2 +- .../system/salesOrder/salesOrder.html | 18 +- .../system/salesOrder/startAftersales.html | 283 ++++++++++++++++++ .../startAftersalesMaterialSelect.html | 86 ++++++ 10 files changed, 585 insertions(+), 8 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SelectAftersalesNoticeVO.java create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersales.html create mode 100644 ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersalesMaterialSelect.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java index 9beb6b1b..c7ca877a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAftersalesNoticeController.java @@ -5,7 +5,11 @@ import java.util.List; import com.ruoyi.aftersales.service.IAftersalesOrderService; import com.ruoyi.process.general.service.IProcessService; +import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO; +import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.Vo.SelectAftersalesNoticeVO; +import com.ruoyi.system.service.ISysSalesOrderService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; @@ -55,6 +59,9 @@ public class SalesAftersalesNoticeController extends BaseController @Autowired private IAftersalesOrderService aftersalesOrderService; + @Autowired + private ISysSalesOrderService sysSalesOrderService; + @RequiresPermissions("sales:afterSalesNotice:view") @GetMapping() @@ -115,6 +122,34 @@ public class SalesAftersalesNoticeController extends BaseController } + /** + * 修改保存发起售后 + */ + @RequiresPermissions("sales:afterSalesNotice:startAftersales") + @Log(title = "销售售后通知", businessType = BusinessType.UPDATE) + @PostMapping("/startAftersales") + @ResponseBody + public AjaxResult startAftersalesSave(@RequestBody SysSalesOrder sysSalesOrder) + { + + return AjaxResult.success(); + } + + + + + /** + * 查找与销售订单号有关的物料信息 + * */ + @ResponseBody + @PostMapping("/getMaterialInfoBySalesOrderCode") + public TableDataInfo getMaterialInfoBySalesOrderCode(@RequestParam String salesOrderCode){ + startPage(); + List list = salesAftersalesNoticeService.selectMaterialInfoBySalesOrderCode(salesOrderCode); + return getDataTable(list); + } + + /** * 加载审批弹窗 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java index 92208f86..3c0e5ceb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAftersalesNoticeService.java @@ -5,6 +5,7 @@ import java.util.List; import com.ruoyi.aftersales.domain.AftersalesOrder; import com.ruoyi.sales.domain.SalesAftersalesNotice; import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO; +import com.ruoyi.system.domain.Vo.SelectAftersalesNoticeVO; import org.activiti.engine.runtime.ProcessInstance; /** @@ -88,4 +89,9 @@ public interface ISalesAftersalesNoticeService * 根据售后单号查询销售售后通知单 * */ SalesAftersalesNoticeVO selectSalesAftersalesNoticeByCode(String aftersalesNoticeCode); + + /** + * 根据销售单号查询售后通知单Vo类 + * */ + List selectMaterialInfoBySalesOrderCode(String salesOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java index 5270a0b6..2b7322f6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAftersalesNoticeServiceImpl.java @@ -1,9 +1,6 @@ package com.ruoyi.sales.service.impl; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import com.github.pagehelper.Page; import com.ruoyi.common.core.domain.entity.SysUser; @@ -16,8 +13,12 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO; +import com.ruoyi.system.domain.SysSalesOrderChild; +import com.ruoyi.system.domain.Vo.SelectAftersalesNoticeVO; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysRoleService; +import lombok.extern.slf4j.Slf4j; import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.runtime.ProcessInstance; @@ -29,6 +30,7 @@ import com.ruoyi.sales.domain.SalesAftersalesNotice; import com.ruoyi.sales.service.ISalesAftersalesNoticeService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * 售后通知单Service业务层处理 @@ -36,6 +38,8 @@ import org.springframework.transaction.annotation.Transactional; * @author 刘晓旭 * @date 2024-04-15 */ + +@Slf4j @Service public class SalesAftersalesNoticeServiceImpl implements ISalesAftersalesNoticeService { @@ -60,6 +64,8 @@ public class SalesAftersalesNoticeServiceImpl implements ISalesAftersalesNoticeS @Autowired private BizTodoItemMapper todoItemMapper; + @Autowired + private SysSalesOrderChildMapper sysSalesOrderChildMapper; /** * 查询售后通知单 @@ -251,6 +257,32 @@ public class SalesAftersalesNoticeServiceImpl implements ISalesAftersalesNoticeS return salesAftersalesNoticeMapper.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode); } + /** + * 根据销售单号查询售后通知单Vo类 + * */ + @Override + public List selectMaterialInfoBySalesOrderCode(String salesOrderCode) { + + ArrayList selectAftersalesNoticeVOS = new ArrayList<>(); + List sysSalesOrderChildList = sysSalesOrderChildMapper.selectOrderChildListBySalesOrderCode(salesOrderCode); + if (CollectionUtils.isEmpty(sysSalesOrderChildList)){ + log.warn("与销售订单子表关联的销售单号为空:{}",salesOrderCode); + } + for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { + SelectAftersalesNoticeVO selectAftersalesNoticeVO = new SelectAftersalesNoticeVO(); + selectAftersalesNoticeVO.setMaterialNo(sysSalesOrderChild.getMaterialCode()); + selectAftersalesNoticeVO.setMaterialName(sysSalesOrderChild.getMaterialName()); + selectAftersalesNoticeVO.setMaterialBrand(sysSalesOrderChild.getBrand()); + selectAftersalesNoticeVO.setMaterialType(sysSalesOrderChild.getMaterialType()); + selectAftersalesNoticeVO.setMaterialUnit(sysSalesOrderChild.getUnit()); + selectAftersalesNoticeVO.setMaterialProcessMethod(sysSalesOrderChild.getProcessMethod()); + selectAftersalesNoticeVO.setMaterialDescribe(sysSalesOrderChild.getDescribe()); + selectAftersalesNoticeVO.setShippedGoodsSum(sysSalesOrderChild.getOutBoundQuantity()); + selectAftersalesNoticeVOS.add(selectAftersalesNoticeVO); + } + return selectAftersalesNoticeVOS; + } + /** * 创建售后单审核流程 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 45a0289d..15c48c7a 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 @@ -559,4 +559,27 @@ public class SysSalesOrderController extends BaseController List list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode); return getDataTable(list) ; } + + /** + * 发起售后 + */ + @GetMapping("/startAftersales/{salesOrderId}") + public String startAftersales(@PathVariable("salesOrderId") Long salesOrderId, ModelMap mmap) + { + SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(salesOrderId); + mmap.put("sysSalesOrder", sysSalesOrder); + return prefix + "/startAftersales"; + } + + + /** + * 发起售后加载销售单号有关的物料信息弹窗 + */ + @GetMapping("/startAftersalesMaterialSelect") + public String materialSelect(@RequestParam String salesOrderCode, ModelMap modelMap) + { + modelMap.put("salesOrderCode",salesOrderCode); + return prefix + "/startAftersalesMaterialSelect"; + } + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java index bfc77b27..65b06c5e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrder.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; import com.google.common.base.Objects; +import com.ruoyi.system.domain.Vo.SelectAftersalesNoticeVO; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -161,6 +162,9 @@ public class SysSalesOrder extends BaseEntity { private List sysSalesOrderChildList; + + private List selectAftersalesNoticeVOList; + public Long getSalesOrderId() { return salesOrderId; } @@ -657,6 +661,14 @@ public class SysSalesOrder extends BaseEntity { this.sysSalesOrderChildList = sysSalesOrderChildList; } + public List getSelectAftersalesNoticeVOList() { + return selectAftersalesNoticeVOList; + } + + public void setSelectAftersalesNoticeVOList(List selectAftersalesNoticeVOList) { + this.selectAftersalesNoticeVOList = selectAftersalesNoticeVOList; + } + @Override public String toString() { return Objects.toStringHelper(this) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SelectAftersalesNoticeVO.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SelectAftersalesNoticeVO.java new file mode 100644 index 00000000..68382592 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/SelectAftersalesNoticeVO.java @@ -0,0 +1,88 @@ +package com.ruoyi.system.domain.Vo; + +import com.ruoyi.common.annotation.Excel; +import lombok.Data; + +@Data +/*销售发起售后选择设备*/ +public class SelectAftersalesNoticeVO { + private static final long serialVersionUID = 1L; + + /** 售后通知单详情ID */ + private Long aftersalesNoticeDetailId; + + /** 售后通知单号 */ + @Excel(name = "售后通知单号") + private String aftersalesNoticeCode; + + /** 关联生产订单号 */ + private String makeNo; + + /** 关联销售订单编号 */ + private String salesOrderCode; + + /** 用户ID */ + private Long userId; + + /** 紧急程度(0一般、1紧急) */ + @Excel(name = "紧急程度", readConverterExp = "0=一般、1紧急") + private String emergencyDegree; + + /** 售后问题 */ + @Excel(name = "售后问题") + private String aftersalesProblem; + + /** 报告问题 */ + @Excel(name = "报告问题") + private String aftersalesReportUrl; + + /** 客户ID */ + private String customerId; + + /** 客户名称 */ + private String customerName; + + /** SN号(产品序列号) */ + @Excel(name = "SN号", readConverterExp = "产=品序列号") + private String snCode; + + /** 设备流水号 */ + @Excel(name = "设备流水号") + private String deviceRunningNumber; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 物料类型 */ + @Excel(name = "物料类型") + private String materialType; + + /** 物料图片地址 */ + @Excel(name = "物料图片地址") + private String materialPhotourl; + + /** 料号 */ + @Excel(name = "料号") + private String materialNo; + + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String materialBrand; + + /** 物料单位 */ + @Excel(name = "物料单位") + private String materialUnit; + + /** 物料描述 */ + @Excel(name = "物料描述") + private String materialDescribe; + + /** 物料加工方式 */ + @Excel(name = "物料加工方式") + private String materialProcessMethod; + + /** 已出库数量 */ + @Excel(name = "已出库数量") + private Integer shippedGoodsSum; +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml index 718ef843..899044ef 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml @@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html index 264c8800..9baf81f5 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html @@ -196,6 +196,10 @@ diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersales.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersales.html new file mode 100644 index 00000000..bf3b8505 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersales.html @@ -0,0 +1,283 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+ 选择物料 + + 选择物料 + +
+
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersalesMaterialSelect.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersalesMaterialSelect.html new file mode 100644 index 00000000..d1f04c36 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/startAftersalesMaterialSelect.html @@ -0,0 +1,86 @@ + + + + + + +
+
+
+
+
+
+
+ + + + \ No newline at end of file