feat(sip): 添加维保记录查询功能

- 在 OrderInfo 和 ProductInfo 模块中添加维保记录查询接口和实现
- 新增 MaintenanceRecordsDto 类用于维保记录查询参数
- 在 DeliveryList 中添加 model 字段
- 更新相关 Mapper 和 XML 文件以支持维保记录查询
master
chenhao 2025-04-23 09:58:45 +08:00
parent 3e4a0c6272
commit 300a842c6a
13 changed files with 119 additions and 6 deletions

View File

@ -2,16 +2,13 @@ package com.ruoyi.sip.controller;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.OrderList;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.sip.domain.OrderInfo;
@ -127,4 +124,12 @@ public class OrderInfoController extends BaseController
{
return toAjax(orderInfoService.deleteOrderInfoByIds(ids));
}
@Log(title = "合同档案", businessType = BusinessType.DELETE)
@GetMapping( "/query")
@ResponseBody
public AjaxResult query(MaintenanceRecordsDto dto)
{
return AjaxResult.success(orderInfoService.selectOrderInfoByMaintenance(dto));
}
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.controller;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -125,4 +127,17 @@ public class ProductInfoController extends BaseController
{
return toAjax(productInfoService.deleteProductInfoByIds(ids));
}
/**
*
*/
@GetMapping( "/query")
@ResponseBody
public AjaxResult query(MaintenanceRecordsDto dto)
{
return AjaxResult.success(productInfoService.query(dto));
}
}

View File

@ -38,6 +38,7 @@ public class DeliveryList extends BaseEntity
@Excel(name = "备注")
private String remark;
private String model;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
// @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
@ -141,11 +142,20 @@ public class DeliveryList extends BaseEntity
return deletedAt;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
@Override
public String toString() {
return new StringJoiner(", ", DeliveryList.class.getSimpleName() + "[", "]")
.add("id=" + id)
.add("deliveryId=" + deliveryId)
.add("model=" + model)
.add("orderCode='" + orderCode + "'")
.add("productCode='" + productCode + "'")
.add("serialNumber='" + serialNumber + "'")

View File

@ -0,0 +1,25 @@
package com.ruoyi.sip.domain;
import lombok.Data;
/**
* @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 MaintenanceRecordsDto {
//序列号
private String serialNumber;
private String productCode;
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.OrderInfo;
import com.ruoyi.sip.domain.OrderList;
@ -99,4 +101,6 @@ public interface OrderInfoMapper
void updateListBatch(List<OrderList> orderListList);
List<OrderList> listOrderListByDeliveryId(Long deliveryId);
List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto);
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.mapper;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.ProductInfo;
import org.apache.ibatis.annotations.Param;
@ -63,4 +65,7 @@ public interface ProductInfoMapper
List<ProductInfo> listByProductCodeList(@Param("list") List<String> productCodeList);
ProductInfo query(MaintenanceRecordsDto dto);
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.OrderInfo;
import com.ruoyi.sip.domain.OrderList;
@ -59,4 +61,6 @@ public interface IOrderInfoService
* @return
*/
public int deleteOrderInfoById(Long id);
List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto);
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.sip.service;
import java.util.List;
import com.ruoyi.sip.controller.ProductInfoController;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import com.ruoyi.sip.domain.ProductInfo;
/**
@ -58,4 +61,6 @@ public interface IProductInfoService
* @return
*/
public int deleteProductInfoById(Long id);
ProductInfo query(MaintenanceRecordsDto dto);
}

View File

@ -1,6 +1,9 @@
package com.ruoyi.sip.service.impl;
import java.util.Collections;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -129,6 +132,11 @@ public class OrderInfoServiceImpl implements IOrderInfoService
return orderInfoMapper.deleteOrderInfoById(id);
}
@Override
public List<OrderInfo> selectOrderInfoByMaintenance(MaintenanceRecordsDto dto) {
return orderInfoMapper.selectOrderInfoByMaintenance(dto);
}
/**
*
*

View File

@ -1,6 +1,8 @@
package com.ruoyi.sip.service.impl;
import java.util.List;
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sip.mapper.ProductInfoMapper;
@ -91,4 +93,9 @@ public class ProductInfoServiceImpl implements IProductInfoService
{
return productInfoMapper.deleteProductInfoById(id);
}
@Override
public ProductInfo query(MaintenanceRecordsDto dto) {
return productInfoMapper.query(dto);
}
}

View File

@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t1.id, t1.delivery_id,t1.product_code, t1.serial_number, t1.remark, t1.created_at, t1.updated_at, t1.deleted_at,
t2.delivery_code,
t3.product_code, t3.product_name,
t3.product_code, t3.product_name,t3.model,
t4.order_code
from delivery_list t1
left join order_delivery t2 on t1.delivery_id = t2.id

View File

@ -134,6 +134,20 @@
where order_id = (select order_id from order_delivery where id = #{deliveryId} and status=0)
and status=0
</select>
<select id="selectOrderInfoByMaintenance" resultType="com.ruoyi.sip.domain.OrderInfo">
<include refid="selectOrderInfoVo"/>
where status=0
<if test="serialNumber!=null and serialNumber!=''">
and id in (
select t2.order_id from delivery_list t1 left join order_delivery t2 on t1.delivery_id =t2.id where
t1.serial_number=#{serialNumber})
</if>
<if test="productCode!=null and productCode!=''">
and id in (
select t2.order_id from delivery_list t1 left join order_delivery t2 on t1.delivery_id =t2.id where
t1.product_code=#{productCode})
</if>
</select>
<insert id="insertOrderInfo" parameterType="OrderInfo" useGeneratedKeys="true" keyProperty="id">
insert into order_info

View File

@ -42,6 +42,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
</select>
<select id="query" resultType="com.ruoyi.sip.domain.ProductInfo">
<include refid="selectProductInfoVo"/>
<where>
<if test="serialNumber!=null and serialNumber!=''">
and product_code in (select product_code from delivery_list where serial_number=#{serialNumber})
</if>
<if test="productCode!=null and productCode!=''">
and product_code=#{productCode}
</if>
</where>
</select>
<insert id="insertProductInfo" parameterType="ProductInfo" useGeneratedKeys="true" keyProperty="id">