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