解决冲突

master
rdpnr_hemingxia 2025-04-24 10:05:00 +08:00
commit 7e47ffa2a3
13 changed files with 532 additions and 456 deletions

View File

@ -1,177 +1,177 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery-add">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">关联合同:</label>
<div class="col-sm-8">
<input style="display: none" name="orderId" class="form-control" readonly type="text" required>
<input name="orderName" class="form-control" readonly type="text" onclick="openList()" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货单号:</label>
<div class="col-sm-8">
<input name="deliveryCode" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货方式:</label>
<div class="col-sm-8">
<select name="deliveryType" class="form-control" th:with="type=${@dict.getType('delivery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流公司:</label>
<div class="col-sm-8">
<input name="logisticsCompany" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流单号:</label>
<div class="col-sm-8">
<input name="logisticsCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人姓名:</label>
<div class="col-sm-8">
<input name="receiverName" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input name="receiverPhone" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('delivery_status')}">
<input type="radio" th:id="${'deliveryStatus_' + dict.dictCode}" name="deliveryStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'deliveryStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">签收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="signTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "manage/delivery"
var prefixOrder = ctx + "manage/order";
let orderList=[]
$("#form-delivery-add").validate({
focusCleanup: true
});
$(function (){
})
// function getOrderList() {
// $.operate.post(prefixOrder + "/list",{isTable:0}, function (res){
// orderList=res.rows
// $("[name='orderId']").html(
// orderList.map((ele)=>{
// return `<option value="${ele.id}">${ele.orderName}</option>`
// }).join('')
// )
//
// })
// }
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-delivery-add').serialize());
}
}
$("input[name='deliveryDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='signTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function openList(id){
var options = {
title: "关联合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: ['关闭'],
yes:function(index){
$.modal.close(index)
},
maxmin: false,
full: false,
};
$.modal.openOptions(options)
}
</script>
</body>
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery-add">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">关联合同:</label>
<div class="col-sm-8">
<div class="input-group">
<input style="display: none" name="orderId" class="form-control" readonly type="text" required>
<input name="orderName" class="form-control" type="text" onclick="selectOrder()" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货单号:</label>
<div class="col-sm-8">
<input name="deliveryCode" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货方式:</label>
<div class="col-sm-8">
<select name="deliveryType" class="form-control" th:with="type=${@dict.getType('delivery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流公司:</label>
<div class="col-sm-8">
<input name="logisticsCompany" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流单号:</label>
<div class="col-sm-8">
<input name="logisticsCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人姓名:</label>
<div class="col-sm-8">
<input name="receiverName" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input name="receiverPhone" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('delivery_status')}">
<input type="radio" th:id="${'deliveryStatus_' + dict.dictCode}" name="deliveryStatus" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
<label th:for="${'deliveryStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">签收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="signTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "manage/delivery"
var prefixOrder = ctx + "manage/order";
let orderList=[]
$("#form-delivery-add").validate({
focusCleanup: true
});
$(function (){
})
// function getOrderList() {
// $.operate.post(prefixOrder + "/list",{isTable:0}, function (res){
// orderList=res.rows
// $("[name='orderId']").html(
// orderList.map((ele)=>{
// return `<option value="${ele.id}">${ele.orderName}</option>`
// }).join('')
// )
//
// })
// }
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-delivery-add').serialize());
}
}
$("input[name='deliveryDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='signTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function openList(id){
var options = {
title: "关联合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: false,
maxmin: false,
full: false,
index:1000
};
$.modal.openOptions(options)
}
</script>
</body>
</html>

View File

@ -1,180 +1,184 @@
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery-edit" th:object="${orderDelivery}">
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">关联合同:</label>
<div class="col-sm-8">
<input style="display: none" th:orderId="*{orderId}" name="orderId" class="form-control" readonly type="text" required>
<input name="orderName" th:orderName="*{orderName}" class="form-control" readonly type="text" onclick="openList()" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货单号:</label>
<div class="col-sm-8">
<input name="deliveryCode" th:field="*{deliveryCode}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryDate" th:value="${#dates.format(orderDelivery.deliveryDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货方式:</label>
<div class="col-sm-8">
<select name="deliveryType" class="form-control" th:with="type=${@dict.getType('delivery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deliveryType}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流公司:</label>
<div class="col-sm-8">
<input name="logisticsCompany" th:field="*{logisticsCompany}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流单号:</label>
<div class="col-sm-8">
<input name="logisticsCode" th:field="*{logisticsCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人姓名:</label>
<div class="col-sm-8">
<input name="receiverName" th:field="*{receiverName}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input name="receiverPhone" th:field="*{receiverPhone}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" th:field="*{receiverAddress}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('delivery_status')}">
<input type="radio" th:id="${'deliveryStatus_' + dict.dictCode}" name="deliveryStatus" th:value="${dict.dictValue}" th:field="*{deliveryStatus}" required>
<label th:for="${'deliveryStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">签收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="signTime" th:value="${#dates.format(orderDelivery.signTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "manage/delivery";
var prefixOrder = ctx + "manage/order";
$("#form-delivery-edit").validate({
focusCleanup: true
});
$(function (){
setTimeout( getOrderList(),500)
})
function getOrderList() {
$.operate.post(prefixOrder + "/list",{isTable:0}, function (res){
orderList=res.rows
var orderId=$("[name='orderId']").attr('orderid')
orderList.forEach((ele)=>{
if(ele.id==orderId){
$("[name='orderName']").val(ele.orderName)
$("[name='orderId']").val(ele.id)
}
})
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-delivery-edit').serialize());
}
}
$("input[name='deliveryDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='signTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function openList(){
var options = {
title: "关联合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: ['关闭'],
yes:function(index){
$.modal.close(index)
},
maxmin: false,
full: false,
};
$.modal.openOptions(options)
}
</script>
</body>
<!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" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-delivery-edit" th:object="${orderDelivery}">
<input name="id" th:field="*{id}" type="hidden">
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">关联合同:</label>
<div class="col-sm-8">
<div class="input-group">
<input style="display: none" th:orderId="*{orderId}" name="orderId" class="form-control" readonly type="text" required>
<input name="orderName" th:orderName="*{orderName}" class="form-control" type="text" onclick="selectOrder()" required>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货单号:</label>
<div class="col-sm-8">
<input name="deliveryCode" th:field="*{deliveryCode}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryDate" th:value="${#dates.format(orderDelivery.deliveryDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货方式:</label>
<div class="col-sm-8">
<select name="deliveryType" class="form-control" th:with="type=${@dict.getType('delivery_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deliveryType}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流公司:</label>
<div class="col-sm-8">
<input name="logisticsCompany" th:field="*{logisticsCompany}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">物流单号:</label>
<div class="col-sm-8">
<input name="logisticsCode" th:field="*{logisticsCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人姓名:</label>
<div class="col-sm-8">
<input name="receiverName" th:field="*{receiverName}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货人电话:</label>
<div class="col-sm-8">
<input name="receiverPhone" th:field="*{receiverPhone}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">收货地址:</label>
<div class="col-sm-8">
<input name="receiverAddress" th:field="*{receiverAddress}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label is-required">发货状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('delivery_status')}">
<input type="radio" th:id="${'deliveryStatus_' + dict.dictCode}" name="deliveryStatus" th:value="${dict.dictValue}" th:field="*{deliveryStatus}" required>
<label th:for="${'deliveryStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">签收时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="signTime" th:value="${#dates.format(orderDelivery.signTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "manage/delivery";
var prefixOrder = ctx + "manage/order";
$("#form-delivery-edit").validate({
focusCleanup: true
});
$(function (){
setTimeout( getOrderList(),500)
})
function getOrderList() {
$.operate.post(prefixOrder + "/list",{isTable:0}, function (res){
orderList=res.rows
var orderId=$("[name='orderId']").attr('orderid')
orderList.forEach((ele)=>{
if(ele.id==orderId){
$("[name='orderName']").val(ele.orderName)
$("[name='orderId']").val(ele.id)
}
})
})
}
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-delivery-edit').serialize());
}
}
$("input[name='deliveryDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("input[name='signTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function openList(){
var options = {
title: "关联合同",
url: prefix + '/selectOrder',
skin: 'layui-layer-gray',
btn: true,
btn: ['关闭'],
yes:function(index){
$.modal.close(index)
},
maxmin: false,
full: false,
index:1000
};
$.modal.openOptions(options)
}
</script>
</body>
</html>

View File

@ -39,6 +39,10 @@
</div>
<table id="bootstrap-table"></table>
</div>
<div class="col-sm-12 select-table table-striped" >
<table id="bootstrap-table"></table>
</div>
<th:block th:include="include :: footer" />

View File

@ -207,9 +207,17 @@
title: "序号",
formatter: function (value, row, index) {
// var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
//var html = $.common.sprintf("<input class='form-control' type='text' name='orderListList[%s].id' value='%s'>", index, value);
var html = $.common.sprintf("<input type='hidden' name='orderListList[%s].id' value='%s'>", index, value);
return html+$.table.serialNumber(index);
return $.table.serialNumber(index);
}
},
{
field: 'id',
align: 'center',
title: "id",
formatter: function (value, row, index) {
var html = $.common.sprintf("<input type='hidden' name='orderListList[%s].id' value='%s'>", index, value);
return html;
}
},
{

View File

@ -1,12 +1,19 @@
package com.ruoyi.sip.controller;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.service.IMaintenanceService;
import com.ruoyi.sip.service.IOrderDeliveryService;
import com.ruoyi.sip.service.IOrderInfoService;
import com.ruoyi.sip.service.IProductInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author : ch
@ -27,10 +34,41 @@ public class MaintenanceController {
private String prefix = "manage/service";
@Autowired
private IMaintenanceService service;
@Autowired
private IProductInfoService productInfoService;
@Autowired
private IOrderInfoService orderInfoService;
@Anonymous
@GetMapping()
public String service()
{
return prefix + "/service";
}
@GetMapping("/query")
@ResponseBody
@Anonymous
public AjaxResult query(MaintenanceRecordsDto dto)
{
return AjaxResult.success(service.query(dto));
}
@GetMapping("/product")
@ResponseBody
@Anonymous
public AjaxResult product(MaintenanceRecordsDto dto)
{
return AjaxResult.success(productInfoService.query(dto));
}
@GetMapping("/order")
@ResponseBody
@Anonymous
public AjaxResult order(MaintenanceRecordsDto dto)
{
return AjaxResult.success(orderInfoService.selectOrderInfoByMaintenance(dto));
}
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.sip.domain;
import lombok.Data;
import java.util.Date;
/**
* @author : ch
* @version : 1.0
* @ClassName : MaintenanceRecordsDto
* @Description :
* @DATE : Created in 17:50 2025/4/22
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/04/22 ch 1.0 Why & What is modified: <> *
*/
@Data
public class MaintenanceRecord {
//开始时间
private Date startDate;
}

View File

@ -2,6 +2,8 @@ package com.ruoyi.sip.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -13,6 +15,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author mula
* @date 2025-04-11
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class ProductInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -46,99 +50,6 @@ public class ProductInfo extends BaseEntity
/** 删除时间 */
private Date deletedAt;
private String serialNumber;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setProductCode(String productCode)
{
this.productCode = productCode;
}
public String getProductCode()
{
return productCode;
}
public void setProductName(String productName)
{
this.productName = productName;
}
public String getProductName()
{
return productName;
}
public void setModel(String model)
{
this.model = model;
}
public String getModel()
{
return model;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setCreatedAt(Date createdAt)
{
this.createdAt = createdAt;
}
public Date getCreatedAt()
{
return createdAt;
}
public void setUpdatedAt(Date updatedAt)
{
this.updatedAt = updatedAt;
}
public Date getUpdatedAt()
{
return updatedAt;
}
public void setDeletedAt(Date deletedAt)
{
this.deletedAt = deletedAt;
}
public Date getDeletedAt()
{
return deletedAt;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("model", getModel())
.append("description", getDescription())
.append("remark", getRemark())
.append("createdAt", getCreatedAt())
.append("updatedAt", getUpdatedAt())
.append("deletedAt", getDeletedAt())
.toString();
}
}

View File

@ -0,0 +1,8 @@
package com.ruoyi.sip.mapper;
import com.ruoyi.sip.domain.MaintenanceRecord;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
public interface MaintenanceMapper {
MaintenanceRecord query(MaintenanceRecordsDto dto);
}

View File

@ -0,0 +1,8 @@
package com.ruoyi.sip.service;
import com.ruoyi.sip.domain.MaintenanceRecord;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
public interface IMaintenanceService {
MaintenanceRecord query(MaintenanceRecordsDto dto);
}

View File

@ -0,0 +1,38 @@
package com.ruoyi.sip.service.impl;
import com.ruoyi.sip.domain.MaintenanceRecord;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.mapper.MaintenanceMapper;
import com.ruoyi.sip.service.IMaintenanceService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* @author : ch
* @version : 1.0
* @ClassName : MaintenanceServiceImpl
* @Description :
* @DATE : Created in 17:36 2025/4/23
* <pre> Copyright: Copyright(c) 2025 </pre>
* <pre> Company : </pre>
* Modification History:
* Date Author Version Discription
* --------------------------------------------------------------------------
* 2025/04/23 ch 1.0 Why & What is modified: <> *
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class MaintenanceServiceImpl implements IMaintenanceService {
@Resource
private MaintenanceMapper mapper;
@Override
public MaintenanceRecord query(MaintenanceRecordsDto dto) {
return mapper.query(dto);
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.sip.mapper.MaintenanceMapper">
<resultMap type="MaintenanceRecord" id="MaintenanceRecordResult">
<result property="startDate" column="start_date"/>
</resultMap>
<select id="query" resultMap="MaintenanceRecordResult">
select delivery_date as start_date from order_delivery
where id in (select delivery_id from delivery_list where serial_number=#{serialNumber})
</select>
</mapper>

View File

@ -221,9 +221,9 @@
<foreach item="item" index="index" collection="list" separator=";">
update order_list
<trim prefix="SET" suffixOverrides=",">
<if test="item.quantity != null ">quantity = #{item.quantity},</if>
<if test="item.quantity != null">quantity = #{item.quantity},</if>
<if test="item.amount != null">amount = #{item.amount},</if>
<if test="item.remark != null and item.remark!=''">remark = #{item.remark},</if>
<if test="item.remark != null">remark = #{item.remark},</if>
updated_at = NOW(),
</trim>
where id = #{item.id}

View File

@ -43,13 +43,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</select>
<select id="query" resultType="com.ruoyi.sip.domain.ProductInfo">
<include refid="selectProductInfoVo"/>
SELECT
t1.id,
t1.product_code,
t1.product_name,
t1.model,
t1.description,
t1.remark,
t1.created_at,
t1.updated_at,
t1.deleted_at ,
t2.serial_number
FROM
product_info t1 left join delivery_list t2 on t1.product_code=t2.product_code
<where>
<if test="serialNumber!=null and serialNumber!=''">
and product_code in (select product_code from delivery_list where serial_number=#{serialNumber})
and t2.serial_number=#{serialNumber}
</if>
<if test="productCode!=null and productCode!=''">
and product_code=#{productCode}
and t1.product_code=#{productCode}
</if>
</where>
</select>