Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 7 months ago
parent
commit
1048079a0b
  1. 64
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java
  2. 211
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectDeviceVO.java
  3. 9
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java
  4. 9
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesComplaintNoticeMapper.java
  5. 8
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java
  6. 37
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java
  7. 7
      ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml
  8. 5
      ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesComplaintNoticeMapper.xml
  9. 19
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html
  10. 252
      ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/sendOrders.html

64
ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOrderController.java

@ -1,6 +1,11 @@
package com.ruoyi.aftersales.controller;
import java.util.List;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.service.ISysUserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -34,6 +39,13 @@ public class AftersalesOrderController extends BaseController
@Autowired
private IAftersalesOrderService aftersalesOrderService;
@Autowired
private IAfterSalesShippingDeviceService afterSalesShippingDeviceService;
@Autowired
private ISysUserService sysUserService;
@RequiresPermissions("aftersales:aftersalesOrder:view")
@GetMapping()
public String aftersalesOrder()
@ -54,6 +66,8 @@ public class AftersalesOrderController extends BaseController
return getDataTable(list);
}
/**
* 导出售后单列表
*/
@ -112,6 +126,56 @@ public class AftersalesOrderController extends BaseController
return toAjax(aftersalesOrderService.updateAftersalesOrder(aftersalesOrder));
}
/**
* 派单
*/
@GetMapping("/sendOrders/{aftersalesOrderId}")
public String sendOrders(@PathVariable("aftersalesOrderId") Long aftersalesOrderId, ModelMap mmap)
{
AftersalesOrder aftersalesOrder = aftersalesOrderService.selectAftersalesOrderById(aftersalesOrderId);
mmap.put("sendOrders", aftersalesOrder);
return prefix + "/sendOrders";
}
/**
* 保存派单
*/
@RequiresPermissions("aftersales:aftersalesOrder:sendOrders")
@Log(title = "售后单", businessType = BusinessType.UPDATE)
@PostMapping("/sendOrders")
@ResponseBody
public AjaxResult sendOrdersSave(AftersalesOrder aftersalesOrder)
{
return toAjax(aftersalesOrderService.updateAftersalesOrder(aftersalesOrder));
}
/**
* 查询选择设备列表
*/
@RequiresPermissions("aftersales:aftersalesOrder:list")
@PostMapping("/optionDevices")
@ResponseBody
public TableDataInfo optionDevices(AftersalesOrder aftersalesOrder)
{
startPage();
List<SelectDeviceVO> list = afterSalesShippingDeviceService.selectOptionDevices(aftersalesOrder.getMakeNo());
return getDataTable(list);
}
/**
* 查找所有的工程员
* */
@ResponseBody
@PostMapping("/getAftersalesStaffList")
public AjaxResult getAftersalesStaffList(String roleKey){
List<SysUser> aftersalesStaffList = sysUserService.getSpecificRoleList(roleKey);
return AjaxResult.success(aftersalesStaffList);
}
/**
* 删除售后单
*/

211
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectDeviceVO.java

@ -0,0 +1,211 @@
package com.ruoyi.aftersales.domain.vo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* 选择设备Vo类
* */
public class SelectDeviceVO extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 售后数量 */
private String deliveryGoodsNum;
/** 紧急程度 */
private String emergencyDegree;
/** 售后问题 */
private String complaintProblem;
/** 是否结案 */
private String closingProcedures;
/** 售后报告 */
private String adverseReportUrl;
/** SN号(产品序列号) */
private String snCode;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
private String materialType;
/** 物料图片地址 */
@Excel(name = "物料图片地址")
private String materialPhotourl;
/** 物料品牌 */
@Excel(name = "物料品牌")
private String materialBrand;
/** 物料单位 */
@Excel(name = "物料单位")
private String materialUnit;
/** 物料描述 */
@Excel(name = "物料描述")
private String materialDescribe;
public void setDeliveryGoodsNum(String deliveryGoodsNum)
{
this.deliveryGoodsNum = deliveryGoodsNum;
}
public String getDeliveryGoodsNum()
{
return deliveryGoodsNum;
}
public void setEmergencyDegree(String emergencyDegree)
{
this.emergencyDegree = emergencyDegree;
}
public String getEmergencyDegree()
{
return emergencyDegree;
}
public void setComplaintProblem(String complaintProblem)
{
this.complaintProblem = complaintProblem;
}
public String getComplaintProblem()
{
return complaintProblem;
}
public void setClosingProcedures(String closingProcedures)
{
this.closingProcedures = closingProcedures;
}
public String getClosingProcedures()
{
return closingProcedures;
}
public void setAdverseReportUrl(String adverseReportUrl)
{
this.adverseReportUrl = adverseReportUrl;
}
public String getAdverseReportUrl()
{
return adverseReportUrl;
}
public void setSnCode(String snCode)
{
this.snCode = snCode;
}
public String getSnCode()
{
return snCode;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialType(String materialType)
{
this.materialType = materialType;
}
public String getMaterialType()
{
return materialType;
}
public void setMaterialPhotourl(String materialPhotourl)
{
this.materialPhotourl = materialPhotourl;
}
public String getMaterialPhotourl()
{
return materialPhotourl;
}
public void setMaterialBrand(String materialBrand)
{
this.materialBrand = materialBrand;
}
public String getMaterialBrand()
{
return materialBrand;
}
public void setMaterialUnit(String materialUnit)
{
this.materialUnit = materialUnit;
}
public String getMaterialUnit()
{
return materialUnit;
}
public void setMaterialDescribe(String materialDescribe)
{
this.materialDescribe = materialDescribe;
}
public String getMaterialDescribe()
{
return materialDescribe;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("deliveryGoodsNum", getDeliveryGoodsNum())
.append("emergencyDegree", getEmergencyDegree())
.append("complaintProblem", getComplaintProblem())
.append("closingProcedures", getClosingProcedures())
.append("adverseReportUrl", getAdverseReportUrl())
.append("snCode", getSnCode())
.append("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("materialPhotourl", getMaterialPhotourl())
.append("materialBrand", getMaterialBrand())
.append("materialUnit", getMaterialUnit())
.append("materialDescribe", getMaterialDescribe())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

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

@ -19,6 +19,15 @@ public interface AfterSalesShippingDeviceMapper
*/
public AfterSalesShippingDevice selectAfterSalesShippingDeviceById(Long shippingDeviceCode);
/**
* 查询选择设备
*
* @param makeNo 关联生产订单号
* @return 选择设备信息
*/
public AfterSalesShippingDevice selectShippingDeviceByMakeNo(String makeNo);
/**
* 查询出货设备列表
*

9
ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AftersalesComplaintNoticeMapper.java

@ -19,6 +19,15 @@ public interface AftersalesComplaintNoticeMapper
*/
public AftersalesComplaintNotice selectAftersalesComplaintNoticeById(Long complaintNoticeId);
/**
* 查询售后单中选择设备有关的售后客诉通知单
*
* @param makeNo 关联生产订单号
* @return 售后客诉通知单
*/
public AftersalesComplaintNotice selectComplaintNoticeByMakeNo(String makeNo);
/**
* 查询售后客诉通知单列表
*

8
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAfterSalesShippingDeviceService.java

@ -2,6 +2,7 @@ package com.ruoyi.aftersales.service;
import java.util.List;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
/**
* 出货设备Service接口
@ -72,4 +73,11 @@ public interface IAfterSalesShippingDeviceService
* @return
*/
int restoreAfterSalesShippingDeviceById(Long shippingDeviceCode);
/**
* 查询选择设备列表
* @param makeNo 生产单号
* @return
*/
List<SelectDeviceVO> selectOptionDevices(String makeNo);
}

37
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AfterSalesShippingDeviceServiceImpl.java

@ -1,8 +1,14 @@
package com.ruoyi.aftersales.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.ruoyi.aftersales.domain.AftersalesComplaintNotice;
import com.ruoyi.aftersales.domain.vo.SelectDeviceVO;
import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.aftersales.mapper.AfterSalesShippingDeviceMapper;
@ -22,6 +28,9 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD
@Autowired
private AfterSalesShippingDeviceMapper afterSalesShippingDeviceMapper;
@Autowired
private AftersalesComplaintNoticeMapper aftersalesComplaintNoticeMapper;
/**
* 查询出货设备
*
@ -123,4 +132,32 @@ public class AfterSalesShippingDeviceServiceImpl implements IAfterSalesShippingD
{
return afterSalesShippingDeviceMapper.restoreAfterSalesShippingDeviceById(shippingDeviceCode);
}
/**
* 查询选择设备列表
* */
@Override
public List<SelectDeviceVO> selectOptionDevices(String makeNo) {
List<SelectDeviceVO> selectDeviceVos = new ArrayList<>();
SelectDeviceVO selectDeviceVo = new SelectDeviceVO();
AfterSalesShippingDevice afterSalesShippingDevice = afterSalesShippingDeviceMapper.selectShippingDeviceByMakeNo(makeNo);
if (StringUtils.isNotNull(afterSalesShippingDevice)){
selectDeviceVo.setMaterialNo(afterSalesShippingDevice.getMaterialNo());
selectDeviceVo.setMaterialPhotourl(afterSalesShippingDevice.getMaterialPhotourl());
selectDeviceVo.setMaterialName(afterSalesShippingDevice.getMaterialName());
selectDeviceVo.setMaterialType(afterSalesShippingDevice.getMaterialType());
selectDeviceVo.setMaterialUnit(afterSalesShippingDevice.getMaterialUnit());
selectDeviceVo.setMaterialBrand(afterSalesShippingDevice.getMaterialBrand());
selectDeviceVo.setMaterialDescribe(afterSalesShippingDevice.getMaterialDescribe());
selectDeviceVo.setSnCode(afterSalesShippingDevice.getSnCode());
}
AftersalesComplaintNotice aftersalesComplaintNotice = aftersalesComplaintNoticeMapper.selectComplaintNoticeByMakeNo(makeNo);
if (StringUtils.isNotNull(aftersalesComplaintNotice)){
selectDeviceVo.setComplaintProblem(aftersalesComplaintNotice.getRemark());
}
selectDeviceVos.add(selectDeviceVo);
return selectDeviceVos;
}
}

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

@ -74,7 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectAfterSalesShippingDeviceVo"/>
where shipping_device_code = #{shippingDeviceCode}
</select>
<select id="selectShippingDeviceByMakeNo" parameterType="String" resultMap="AfterSalesShippingDeviceResult">
<include refid="selectAfterSalesShippingDeviceVo"/>
where make_no = #{makeNo}
</select>
<insert id="insertAfterSalesShippingDevice" parameterType="AfterSalesShippingDevice" useGeneratedKeys="true" keyProperty="shippingDeviceCode">
insert into aftersales_shipping_device
<trim prefix="(" suffix=")" suffixOverrides=",">

5
ruoyi-admin/src/main/resources/mapper/aftersales/AftersalesComplaintNoticeMapper.xml

@ -46,6 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectAftersalesComplaintNoticeVo"/>
where complaint_notice_id = #{complaintNoticeId}
</select>
<select id="selectComplaintNoticeByMakeNo" parameterType="String" resultMap="AftersalesComplaintNoticeResult">
<include refid="selectAftersalesComplaintNoticeVo"/>
where make_no= #{makeNo}
</select>
<insert id="insertAftersalesComplaintNotice" parameterType="AftersalesComplaintNotice" useGeneratedKeys="true" keyProperty="complaintNoticeId">
insert into aftersales_complaint_notice

19
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/aftersalesOrder.html

@ -73,6 +73,7 @@
var removeFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:restore')}]];
var sendOrdersFlag = [[${@permission.hasPermi('aftersales:aftersalesOrder:sendOrders')}]];
var aftersalesStatusDatas = [[${@dict.getType('sales_aftersales_status')}]];
var prefix = ctx + "aftersales/aftersalesOrder";
@ -85,6 +86,7 @@
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
sendOrdersUrl: prefix + "/sendOrders/{id}",
modalName: "售后单",
columns: [{
checkbox: true
@ -169,6 +171,7 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-remove"></i>删除</a> ');
actions.push('<a class="btn btn-success btn-xs ' + sendOrdersFlag + '" href="javascript:void(0)" onclick="sendOrders(\'' + row.aftersalesOrderId + '\')"><i class="fa fa-edit"></i>派单</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
@ -180,6 +183,22 @@
};
$.table.init(options);
});
/*派单*/
function sendOrders(aftersalesOrderId) {
// 在这里编写派单操作的逻辑,使用传入的aftersalesOrderId参数
// 示例逻辑:
// 1. 确认用户操作
if (confirm('确认要派单吗?')) {
var url = ctx + 'aftersales/aftersalesOrder/sendOrders/'+aftersalesOrderId;
console.log(url);
$.modal.open("派单",url);
}
}
</script>
</body>
</html>

252
ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOrder/sendOrders.html

@ -0,0 +1,252 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改售后单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: summernote-css" />
<style>
.device-container {
margin-top: 1rem; /* 调整此值以达到所需的间距效果 */
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-aftersalesOrder-edit" th:object="${sendOrders}">
<input name="aftersalesOrderId" th:field="*{aftersalesOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-4 control-label">销售单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">生产单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="customerId" th:field="*{customerId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户名称:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">公司地址:</label>
<div class="col-sm-8">
<input name="companyAddress" th:field="*{companyAddress}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">收货联系人:</label>
<div class="col-sm-8">
<input name="deliveryName" th:field="*{deliveryName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">收货电话:</label>
<div class="col-sm-8">
<input name="deliveryNumber" th:field="*{deliveryNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">客户要求出发日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="startDate" class="form-control" th:value="*{startDate}" placeholder="yyyy-mm-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
<div class="form-row">
<div class="col-sm-12 select-table table-striped">
<h3 class="mb-4">选择设备</h3>
<table id="bootstrap-table"></table>
</div>
</div>
<div class="form-group">
<h3 class="mb-4">派单</h3>
<label class="col-sm-3 control-label">售后员:</label>
<div class="col-sm-9">
<select id="userId_add" name="aftersalesName" th:field="*{aftersalesName}" class="form-control m-b">
<option th:each="user : ${userData}" th:value="${user.userName}" th:text="${user.userName}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: summernote-js" />
<script th:inline="javascript">
var prefix = ctx + "aftersales/aftersalesOrder";
var sendOrders = [[${sendOrders}]];
$("#form-aftersalesOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-aftersalesOrder-edit').serialize());
}
}
$("input[name='startDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
$('.summernote').each(function(i) {
$('#' + this.id).summernote({
lang: 'zh-CN',
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
onImageUpload: function(files) {
var obj = this;
var data = new FormData();
data.append("file", files[0]);
$.ajax({
type: "post",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$('#' + obj.id).summernote('insertImage', result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
}
}
});
var content = $("input[name='" + this.id + "']").val();
$('#' + this.id).summernote('code', content);
})
});
$(function() {
var options = {
url: prefix + "/optionDevices",
modalName: "出货设备",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
queryParams:queryParams,
columns: [{
checkbox: true
},
{
title: '出货设备编号',
field: 'shippingDeviceCode',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '流水号',
field: 'deviceRunningNumber',
},
{
title: '生产图片',
field: 'makePhotourl',
},
{
title: 'SN号',
field: 'snCode',
},
{
title: '售后图片',
field: 'aftersalesPhotourl',
},
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
makeNo: sendOrders.makeNo
};
return curParams;
}
$(function () {
$.ajax({
url: ctx + 'aftersales/aftersalesOrder/getAftersalesStaffList',
type: 'post',
data: { roleKey: 'shgcsRole' },
success: function (res) {
if (res.data.length > 0) {
var userData = res.data;
for (let i in userData) {
$("#userId_add").append(
"<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>" // 使用 userName 作为 option 的 value
);
}
// 初始化时触发 change 事件,以确保首次加载时也能正确赋值
$("#userId_add").trigger("change");
} else {
$.modal.msgError(res.msg);
}
}
});
})
</script>
</body>
</html>
Loading…
Cancel
Save