解决冲突

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

View File

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

View File

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

View File

@ -207,9 +207,17 @@
title: "序号", title: "序号",
formatter: function (value, row, index) { formatter: function (value, row, index) {
// var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(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); 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; 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.IOrderDeliveryService;
import com.ruoyi.sip.service.IOrderInfoService;
import com.ruoyi.sip.service.IProductInfoService;
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;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/** /**
* @author : ch * @author : ch
@ -27,10 +34,41 @@ public class MaintenanceController {
private String prefix = "manage/service"; private String prefix = "manage/service";
@Autowired
private IMaintenanceService service;
@Autowired
private IProductInfoService productInfoService;
@Autowired
private IOrderInfoService orderInfoService;
@Anonymous
@GetMapping() @GetMapping()
public String service() public String service()
{ {
return prefix + "/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 java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -13,6 +15,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author mula * @author mula
* @date 2025-04-11 * @date 2025-04-11
*/ */
@Data
@EqualsAndHashCode(callSuper = false)
public class ProductInfo extends BaseEntity public class ProductInfo extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -46,99 +50,6 @@ public class ProductInfo extends BaseEntity
/** 删除时间 */ /** 删除时间 */
private Date deletedAt; 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=";"> <foreach item="item" index="index" collection="list" separator=";">
update order_list update order_list
<trim prefix="SET" suffixOverrides=","> <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.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(), updated_at = NOW(),
</trim> </trim>
where id = #{item.id} where id = #{item.id}

View File

@ -43,13 +43,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</select> </select>
<select id="query" resultType="com.ruoyi.sip.domain.ProductInfo"> <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> <where>
<if test="serialNumber!=null and serialNumber!=''"> <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>
<if test="productCode!=null and productCode!=''"> <if test="productCode!=null and productCode!=''">
and product_code=#{productCode} and t1.product_code=#{productCode}
</if> </if>
</where> </where>
</select> </select>