Browse Source

[feat] 售后管理 仓库管理

修改 第一次添加设备信息 前端提交设备出货信息 js方法
新增 根据 出货设备ID查询出货设备 后端接口
修改 修改保存售后第一次维护设备后端接口方法:新增 更新销售管理的销售出库的出库状态
新增 修改保存售后第一次维护设备
修改 第一次维护设备前端的提交方法,修复子表数据拿不到值的问题
加出货设备时新增出货设备列表新增 snCode字段
销售出库新增 根据出库单更新销售出货通知数据后端接口方法
出库单新增 出货设备列表集合字段
修改出库单销售准备物料后新增同时更新销售管理的销售出库的出库状态
dev
liuxiaoxu 4 months ago
committed by zhangsiqi
parent
commit
0db8a6d66b
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java
  5. 50
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java
  6. 10
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesShippingInformMapper.java
  7. 15
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java
  8. 23
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java
  9. 8
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  10. 36
      ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml
  11. 2
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html
  12. 66
      ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html

4
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));
}

2
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;
}

12
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);

4
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java

@ -125,4 +125,8 @@ public interface IAftersalesWarehouseOutService
* */
List<SelectShippingDeviceVO> showAftersalesShippingDeviceList(String materialNo);
/**
* 修改保存售后第一次维护设备
*/
int updateMaintenanceEquipmentOne(WarehouseOutOrder warehouseOutOrder);
}

50
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<SelectShippingDeviceVO> 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删除出货设备信息
* */

10
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);
/**
* 删除销售出货通知
*

15
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<WarehouseOutOrderDetail> warehouseOutOrderDetailList;
/** 添加出货设备列表*/
private List<SelectShippingDeviceVO> selectShippingDeviceVOList;
public void setOutOrderId(Long outOrderId)
{
this.outOrderId = outOrderId;
@ -428,6 +434,14 @@ public class WarehouseOutOrder extends BaseEntity
this.warehouseOutOrderDetailList = warehouseOutOrderDetailList;
}
public List<SelectShippingDeviceVO> getSelectShippingDeviceVOList() {
return selectShippingDeviceVOList;
}
public void setSelectShippingDeviceVOList(List<SelectShippingDeviceVO> 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();
}
}

23
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;

8
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}
</select>
<select id="selectAfterSalesShippingDeviceByShippingDeviceId" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where shipping_device_id = #{shippingDeviceId}
</select>
<select id="selectShippingDeviceByMakeNo" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}

36
ruoyi-admin/src/main/resources/mapper/system/SysSalesShippingInformMapper.xml

@ -151,6 +151,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where shipping_inform_id = #{shippingInformId}
</update>
<update id="updateSysSalesShippingInformByOutOrderCode" parameterType="SysSalesShippingInform">
update sys_sales_shipping_inform
<trim prefix="SET" suffixOverrides=",">
<if test="outOrderCode != null">out_order_code = #{outOrderCode},</if>
<if test="warehouseOutStatus != null">warehouse_out_status = #{warehouseOutStatus},</if>
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if>
<if test="warehouseOutType != null">warehouse_out_type = #{warehouseOutType},</if>
<if test="warehouseOrderType != null">warehouse_order_type = #{warehouseOrderType},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="businessMembers != null">business_members = #{businessMembers},</if>
<if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="enterpriseSum != null">enterprise_sum = #{enterpriseSum},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="customerContactAddress != null">customer_contact_address = #{customerContactAddress},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="allPriceExcludingTaxRmb != null">all_price_excluding_tax_rmb = #{allPriceExcludingTaxRmb},</if>
<if test="allPriceExcludingTaxDollar != null">all_price_excluding_tax_dollar = #{allPriceExcludingTaxDollar},</if>
<if test="allPriceIncludesTax != null">all_price_includes_tax = #{allPriceIncludesTax},</if>
<if test="plannedDeliveryTime != null">planned_delivery_time = #{plannedDeliveryTime},</if>
<if test="acceptanceTime != null">acceptance_time = #{acceptanceTime},</if>
<if test="paymentCondition != null">payment_condition = #{paymentCondition},</if>
<if test="deliveryCondition != null">delivery_condition = #{deliveryCondition},</if>
<if test="deliverTime != null">deliver_time = #{deliverTime},</if>
</trim>
where out_order_code = #{outOrderCode}
</update>
<delete id="deleteSysSalesShippingInformById" parameterType="Long">
delete from sys_sales_shipping_inform where shipping_inform_id = #{shippingInformId}
</delete>

2
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html

@ -111,7 +111,7 @@
focusCleanup: true
});
/*
/*
* 提交设备履历信息
* */
function submitHandler() {

66
ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html

@ -6,7 +6,7 @@
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-warehouseOutOrder-edit" th:object="${warehouseOutOrder}">
<form class="form-horizontal m" id="form-maintenanceEquipmentOne-edit" th:object="${warehouseOutOrder}">
<input name="outOrderId" th:field="*{outOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">出库单号:</label>
@ -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("确定要删除这条记录吗?")) {

Loading…
Cancel
Save