Browse Source

[feat] 售后管理

修改售后第一次维护设备前端列表页面;不需要维护设备的列表,去掉操作栏,去掉复选框;添加出货设备前端方法新增关联单号字段,传递给后端
第一次售后维护设备出库添加出货设备页面:新增关联销售订单的出货设备的前端列表;新增其他销售订单的出货设备的前端列表;两个列表的查询方法都加上 关联单号字段传递给后端
售后维护设备出库Controller层新增 售后第一次维护设备 成品添加出货设备信息后端接口;新增 售后第一次维护设备,添加出货设备信息,展示销售订单的出货设备信息后端接口:实现优先展示与销售订单号关联的出货设备,如果没有销售订单号,再根据关联单号查找到出货设备;新增售后第一次维护设备,添加出货设备信息,展示其他销售订单的出货设备信息后端接口:实现收集到除了当前成品订单号设备关联的所有其他出货设备
新增 根据销售单号批量查询出货设备信息列表
新增 查询所有出货设备信息列表
新增 根据设备id批量查询出货设备信息列表
dev
liuxiaoxu 3 weeks ago
parent
commit
e0183da41d
  1. 37
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java
  2. 16
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  3. 11
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java
  4. 70
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java
  5. 21
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  6. 21
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/addShippingDevicesOne.html
  7. 16
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html

37
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java

@ -3,6 +3,7 @@ package com.ruoyi.aftersales.controller;
import java.util.List; import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.aftersales.service.IAftersalesOutOrderDetailService; import com.ruoyi.aftersales.service.IAftersalesOutOrderDetailService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -227,14 +228,50 @@ public class AftersalesOutOrderController extends BaseController
public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOrderDetailId, public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOrderDetailId,
@RequestParam("salesOrderCode") String salesOrderCode, @RequestParam("salesOrderCode") String salesOrderCode,
@RequestParam("makeNo") String makeNo, @RequestParam("makeNo") String makeNo,
@RequestParam("relatedOrderCode") String relatedOrderCode,
ModelMap mmap) ModelMap mmap)
{ {
AftersalesOutOrderDetail aftersalesOutOrderDetail = aftersalesOutOrderDetailService.selectAftersalesOutOrderDetailById(outOrderDetailId); AftersalesOutOrderDetail aftersalesOutOrderDetail = aftersalesOutOrderDetailService.selectAftersalesOutOrderDetailById(outOrderDetailId);
mmap.put("salesOrderCode",salesOrderCode); mmap.put("salesOrderCode",salesOrderCode);
mmap.put("makeNo",makeNo); mmap.put("makeNo",makeNo);
mmap.put("relatedOrderCode",relatedOrderCode);
mmap.put("aftersalesOutOrderDetail", aftersalesOutOrderDetail); mmap.put("aftersalesOutOrderDetail", aftersalesOutOrderDetail);
return prefix + "/addShippingDevicesOne"; return prefix + "/addShippingDevicesOne";
} }
/**
* 售后第一次维护设备添加出货设备信息展示销售订单的出货设备信息
* */
@ResponseBody
@PostMapping("/getThisSalesOrderShippingDevices")
public TableDataInfo getThisSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder)
{
startPage();
List<SelectShippingDeviceVO> list = aftersalesOutOrderService.getThisSalesOrderShippingDevices(aftersalesOutOrder);
return getDataTable(list);
}
/**
* 售后第一次维护设备添加出货设备信息展示其他销售订单的出货设备信息
* */
@ResponseBody
@PostMapping("/getOtherSalesOrderShippingDevices")
public TableDataInfo getOtherSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder)
{
startPage();
List<SelectShippingDeviceVO> list = aftersalesOutOrderService.getOtherSalesOrderShippingDevices(aftersalesOutOrder);
return getDataTable(list);
}
// //
// /** // /**
// * 修改保存售后第一次维护设备 添加出货设备信息 // * 修改保存售后第一次维护设备 添加出货设备信息

16
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java

@ -125,4 +125,20 @@ public interface AfterSalesShippingDeviceMapper
* 根据sn号查询出货设备信息列表 * 根据sn号查询出货设备信息列表
* */ * */
List<AfterSalesShippingDevice> selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode); List<AfterSalesShippingDevice> selectShippingDeviceListBySnCodeAndMaterialNo(String[] snCode);
/*
* 根据销售单号批量查询出货设备信息列表
* */
List<AfterSalesShippingDevice> selectBatchShippingDeviceBySalesOrderCode(String[] splitRelatedOrderCode);
/*
* 查询所有出货设备信息列表
* */
List<AfterSalesShippingDevice> selectAllShippingDevices();
/*
* 根据设备id批量查询出货设备信息列表
* */
List<AfterSalesShippingDevice> selectBatchShippingDeviceById(List<String> otherShippingDeviceIds);
} }

11
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java

@ -3,6 +3,7 @@ package com.ruoyi.aftersales.service;
import java.util.List; import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesOutOrder; import com.ruoyi.aftersales.domain.AftersalesOutOrder;
import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
/** /**
* 售后维护设备出库Service接口 * 售后维护设备出库Service接口
@ -95,4 +96,14 @@ public interface IAftersalesOutOrderService
* @return * @return
*/ */
List<AftersalesOutOrderDetail> getNoShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder); List<AftersalesOutOrderDetail> getNoShippingDeviceMaterialsOne(AftersalesOutOrder aftersalesOutOrder);
/**
* 售后第一次维护设备添加出货设备信息展示销售订单的出货设备信息
* */
List<SelectShippingDeviceVO> getThisSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder);
/**
* 售后第一次维护设备添加出货设备信息展示其他销售订单的出货设备信息
* */
List<SelectShippingDeviceVO> getOtherSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder);
} }

70
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java

@ -1,12 +1,19 @@
package com.ruoyi.aftersales.service.impl; package com.ruoyi.aftersales.service.impl;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail; import com.ruoyi.aftersales.domain.AftersalesOutOrderDetail;
import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
import com.ruoyi.aftersales.mapper.AftersalesOutOrderDetailMapper; import com.ruoyi.aftersales.mapper.AftersalesOutOrderDetailMapper;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.mapper.AftersalesOutOrderMapper; import com.ruoyi.aftersales.mapper.AftersalesOutOrderMapper;
@ -29,6 +36,9 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
@Autowired @Autowired
private AftersalesOutOrderDetailMapper aftersalesOutOrderDetailMapper; private AftersalesOutOrderDetailMapper aftersalesOutOrderDetailMapper;
@Autowired
private AfterSalesShippingDeviceMapper afterSalesShippingDeviceMapper;
/** /**
* 查询售后维护设备出库 * 查询售后维护设备出库
* *
@ -171,4 +181,64 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService
return filterList; return filterList;
} }
/**
* 售后第一次维护设备添加出货设备信息展示销售订单的出货设备信息
* */
@Override
public List<SelectShippingDeviceVO> getThisSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder) {
List<SelectShippingDeviceVO> selectShippingDeviceVOS = new ArrayList<>();
String relatedOrderCode = aftersalesOutOrder.getRelatedOrderCode();
String salesOrderCode = aftersalesOutOrder.getSalesOrderCode();
//优先使用销售订单号关联
if (StringUtils.isNotEmpty(salesOrderCode)){
List<AfterSalesShippingDevice> afterSalesShippingDevices = afterSalesShippingDeviceMapper.selectShippingDeviceBySalesOrderCode(salesOrderCode);
convertToDeviceVOs(afterSalesShippingDevices, selectShippingDeviceVOS);
}else {
// 关联订单号可能存在逗号分隔的情况
String[] splitRelatedOrderCode = relatedOrderCode.split(",");
List<AfterSalesShippingDevice> afterSalesShippingDevices = afterSalesShippingDeviceMapper.selectBatchShippingDeviceBySalesOrderCode(splitRelatedOrderCode);
convertToDeviceVOs(afterSalesShippingDevices, selectShippingDeviceVOS);
}
return selectShippingDeviceVOS;
}
/**
* 售后第一次维护设备添加出货设备信息展示其他销售订单的出货设备信息
* */
@Override
public List<SelectShippingDeviceVO> getOtherSalesOrderShippingDevices(AftersalesOutOrder aftersalesOutOrder) {
List<SelectShippingDeviceVO> selectShippingDeviceVOS = new ArrayList<>();
List<SelectShippingDeviceVO> thisSalesOrderShippingDevices = this.getThisSalesOrderShippingDevices(aftersalesOutOrder);
//查找到当前销售订单的出货设备id集合
List<String> collectShippingDeviceId = thisSalesOrderShippingDevices.stream().map(SelectShippingDeviceVO::getShippingDeviceId).collect(Collectors.toList());
//查找到所有出货设备id集合
List<AfterSalesShippingDevice> afterSalesShippingDevices = afterSalesShippingDeviceMapper.selectAllShippingDevices();
List<String> allShippingDeviceIds = afterSalesShippingDevices.stream().map(AfterSalesShippingDevice::getShippingDeviceId).collect(Collectors.toList());
//筛选出所有出货设备id集合中,不在当前销售订单的出货设备id集合中的数据
List<String> otherShippingDeviceIds = allShippingDeviceIds.stream().filter(item -> !collectShippingDeviceId.contains(item)).collect(Collectors.toList());
List<AfterSalesShippingDevice> list = afterSalesShippingDeviceMapper.selectBatchShippingDeviceById(otherShippingDeviceIds);
//转换成vo类
this.convertToDeviceVOs(list, selectShippingDeviceVOS);
return selectShippingDeviceVOS;
}
//转换成vo类
private void convertToDeviceVOs(List<AfterSalesShippingDevice> afterSalesShippingDevices, List<SelectShippingDeviceVO> selectShippingDeviceVOS) {
for (AfterSalesShippingDevice device : afterSalesShippingDevices) {
SelectShippingDeviceVO selectShippingDeviceVO = new SelectShippingDeviceVO();
selectShippingDeviceVO.setShippingDeviceId(device.getShippingDeviceId());
selectShippingDeviceVO.setDeviceModelCode(device.getDeviceModelCode());
selectShippingDeviceVO.setDeviceRunningNumber(device.getDeviceRunningNumber());
selectShippingDeviceVO.setMakePhotoUrl(device.getMakePhotourl());
selectShippingDeviceVOS.add(selectShippingDeviceVO);
}
}
} }

21
ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml

@ -134,6 +134,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</select> </select>
<select id="selectBatchShippingDeviceBySalesOrderCode" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
where sales_order_code in
<foreach item="salesOrderCode" collection="array" open="(" separator="," close=")">
#{salesOrderCode}
</foreach>
and add_shipping_device_flag = '1'
</select>
<select id="selectAllShippingDevices" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where add_shipping_device_flag = '1'
</select>
<select id="selectBatchShippingDeviceById" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
select * from aftersales_shipping_device
where shipping_device_id in
<foreach item="shippingDeviceId" collection="list" open="(" separator="," close=")">
#{shippingDeviceId}
</foreach>
</select>
<insert id="insertAfterSalesShippingDevice" parameterType="AfterSalesShippingDevice" useGeneratedKeys="true" keyProperty="shippingDeviceCode"> <insert id="insertAfterSalesShippingDevice" parameterType="AfterSalesShippingDevice" useGeneratedKeys="true" keyProperty="shippingDeviceCode">
insert into aftersales_shipping_device insert into aftersales_shipping_device

21
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/addShippingDevicesOne.html

@ -104,10 +104,11 @@
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; // var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; // var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]];
var prefix = ctx + "aftersales/warehouseOutOrder"; var prefix = ctx + "aftersales/aftersalesOutOrder";
var aftersalesOutOrderDetail = [[${aftersalesOutOrderDetail}]]; var aftersalesOutOrderDetail = [[${aftersalesOutOrderDetail}]];
var salesOrderCode = [[${salesOrderCode}]]; var salesOrderCode = [[${salesOrderCode}]];
var makeNo = [[${makeNo}]]; var makeNo = [[${makeNo}]];
var relatedOrderCode = [[${relatedOrderCode}]];
$("#form-addShippingDevicesOne-edit").validate({ $("#form-addShippingDevicesOne-edit").validate({
focusCleanup: true focusCleanup: true
@ -234,13 +235,13 @@
var options = { var options = {
id: "thisSalesOrderShippingDevice-table", id: "thisSalesOrderShippingDevice-table",
url: prefix + "/getAllMaterialShippingDevices", url: prefix + "/getThisSalesOrderShippingDevices",
pagination: false, pagination: false,
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
showColumns: false, showColumns: false,
queryParams:queryParams, queryParams:thisQueryParams,
sidePagination: "client", sidePagination: "client",
columns: [{ columns: [{
checkbox: true checkbox: true
@ -281,12 +282,13 @@
}) })
function queryParams(params) { function thisQueryParams(params) {
var curParams = { var curParams = {
// 传递参数查询参数 // 传递参数查询参数
materialNo: aftersalesOutOrderDetail.materialNo, materialNo: aftersalesOutOrderDetail.materialNo,
salesOrderCode:salesOrderCode, salesOrderCode:salesOrderCode,
makeNo:makeNo makeNo:makeNo,
relatedOrderCode:relatedOrderCode
}; };
return curParams; return curParams;
} }
@ -302,13 +304,13 @@
var options = { var options = {
id: "otherSalesOrderShippingDevice-table", id: "otherSalesOrderShippingDevice-table",
url: prefix + "/getAllMaterialShippingDevices", url: prefix + "/getOtherSalesOrderShippingDevices",
pagination: false, pagination: false,
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
showColumns: false, showColumns: false,
queryParams:queryParams, queryParams:otherQueryParams,
sidePagination: "client", sidePagination: "client",
columns: [{ columns: [{
checkbox: true checkbox: true
@ -349,12 +351,13 @@
}) })
function queryParams(params) { function otherQueryParams(params) {
var curParams = { var curParams = {
// 传递参数查询参数 // 传递参数查询参数
materialNo: aftersalesOutOrderDetail.materialNo, materialNo: aftersalesOutOrderDetail.materialNo,
salesOrderCode:salesOrderCode, salesOrderCode:salesOrderCode,
makeNo:makeNo makeNo:makeNo,
relatedOrderCode:relatedOrderCode
}; };
return curParams; return curParams;
} }

16
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html

@ -327,10 +327,7 @@
showRefresh:false, showRefresh:false,
showSearch:false, showSearch:false,
queryParams:queryParams, queryParams:queryParams,
columns: [{ columns: [
checkbox: true
},
{ title:'销售订单号', { title:'销售订单号',
field:'quoteId', field:'quoteId',
visible: false visible: false
@ -389,15 +386,6 @@
title: '准备出库数', title: '准备出库数',
field: 'prepareOutOrderSum', field: 'prepareOutOrderSum',
}, },
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevicesOne(\'' + row.outOrderDetailId + '\')"><i class="fa fa-add"></i>添加出货设备</a>');
return actions.join('');
}
}
] ]
}; };
$.table.init(options); $.table.init(options);
@ -461,11 +449,13 @@
function addShippingDevicesOne(outOrderDetailId) { function addShippingDevicesOne(outOrderDetailId) {
var salesOrderCode = [[${aftersalesOutOrder.salesOrderCode}]]; var salesOrderCode = [[${aftersalesOutOrder.salesOrderCode}]];
var relatedOrderCode = [[${aftersalesOutOrder.relatedOrderCode}]];
var makeNo = [[${aftersalesOutOrder.makeNo}]]; var makeNo = [[${aftersalesOutOrder.makeNo}]];
var queryParams = new URLSearchParams(); var queryParams = new URLSearchParams();
queryParams.append('outOrderDetailId', outOrderDetailId); queryParams.append('outOrderDetailId', outOrderDetailId);
queryParams.append('salesOrderCode', encodeURIComponent(salesOrderCode)); queryParams.append('salesOrderCode', encodeURIComponent(salesOrderCode));
queryParams.append('makeNo',encodeURIComponent(makeNo)); queryParams.append('makeNo',encodeURIComponent(makeNo));
queryParams.append('relatedOrderCode',encodeURIComponent(relatedOrderCode));
var url = prefix + '/addShippingDevicesOne?' + queryParams.toString(); var url = prefix + '/addShippingDevicesOne?' + queryParams.toString();
$.modal.open("添加出货设备", url); $.modal.open("添加出货设备", url);
} }

Loading…
Cancel
Save