fix:新维保查询页面
parent
504379f3e3
commit
6a26d412c4
|
|
@ -1,28 +1,40 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品信息
|
||||
export function getProductInfo(serialNumber) {
|
||||
function normalizeSerialNumbers(input) {
|
||||
const values = Array.isArray(input) ? input : [input]
|
||||
return [...new Set(values
|
||||
.map(item => (item || '').toString().trim())
|
||||
.filter(Boolean))]
|
||||
}
|
||||
|
||||
function buildQueryPayload(input) {
|
||||
const serialNumbers = normalizeSerialNumbers(input)
|
||||
return {
|
||||
serialNumber: serialNumbers[0] || '',
|
||||
serialNumbers
|
||||
}
|
||||
}
|
||||
|
||||
export function getProductInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/product',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询相关合同信息
|
||||
export function getOrderInfo(serialNumber) {
|
||||
export function getOrderInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/order',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询标准保修信息
|
||||
export function getWarrantyInfo(serialNumber) {
|
||||
export function getWarrantyInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/query',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
|
|
@ -92,7 +92,7 @@
|
|||
size="80%"
|
||||
append-to-body
|
||||
:modal-append-to-body="true"
|
||||
:z-index="3000"
|
||||
:z-index="pruchaseDrawerZIndex"
|
||||
>
|
||||
<ApproveLayout title="采购单详情" v-if="showPruchaseDetailDrawer">
|
||||
<purchase-order-detail-view
|
||||
|
|
@ -143,7 +143,8 @@ export default {
|
|||
projectDrawerVisible: false,
|
||||
currentProjectId: null,
|
||||
showPruchaseDetailDrawer: false,
|
||||
pruchaseDetailOrderData: null
|
||||
pruchaseDetailOrderData: null,
|
||||
pruchaseDrawerZIndex: 5000
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
|
@ -212,6 +213,7 @@ export default {
|
|||
});
|
||||
},
|
||||
handleViewPruchaseDetail(row, purchaseItem) {
|
||||
this.pruchaseDrawerZIndex += 2;
|
||||
const purchaseId = purchaseItem && purchaseItem.purchaseId ? purchaseItem.purchaseId : (row.purchaseId || row.purchaseOrderId);
|
||||
if (purchaseId) {
|
||||
getPurchaseorder(purchaseId).then(response => {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,21 +1,26 @@
|
|||
package com.ruoyi.sip.controller;
|
||||
|
||||
|
||||
import com.ruoyi.common.annotation.Anonymous;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import com.ruoyi.sip.service.IMaintenanceService;
|
||||
import com.ruoyi.sip.service.IProductInfoService;
|
||||
import com.ruoyi.sip.service.IProjectOrderInfoService;
|
||||
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.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
|
|
@ -32,57 +37,92 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
@Controller
|
||||
@RequestMapping("/manage/service")
|
||||
public class MaintenanceController {
|
||||
private String prefix = "manage/service";
|
||||
|
||||
private final String prefix = "manage/service";
|
||||
|
||||
@Autowired
|
||||
private IMaintenanceService service;
|
||||
@Autowired
|
||||
private IProductInfoService productInfoService;
|
||||
@Autowired
|
||||
private IOrderInfoService orderInfoService;
|
||||
@Autowired
|
||||
private IProjectOrderInfoService projectOrderInfoService;
|
||||
|
||||
@Anonymous
|
||||
@GetMapping()
|
||||
public String service(@RequestParam(value = "code",required = false)String code, ModelMap modelMap)
|
||||
{
|
||||
modelMap.put("code",code);
|
||||
public String service(@RequestParam(value = "code", required = false) String code, ModelMap modelMap) {
|
||||
modelMap.put("code", code);
|
||||
return prefix + "/service";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/query")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult query(MaintenanceRecordsDto dto)
|
||||
{
|
||||
if (StringUtils.isEmpty(dto.getSerialNumber())){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.success(service.query(dto));
|
||||
public AjaxResult query(MaintenanceRecordsDto dto) {
|
||||
return doQuery(dto);
|
||||
}
|
||||
|
||||
@PostMapping("/query")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult queryPost(@RequestBody MaintenanceRecordsDto dto) {
|
||||
return doQuery(dto);
|
||||
}
|
||||
|
||||
@GetMapping("/product")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult product(MaintenanceRecordsDto dto)
|
||||
{
|
||||
return AjaxResult.success(productInfoService.query(dto));
|
||||
public AjaxResult product(MaintenanceRecordsDto dto) {
|
||||
return doProduct(dto);
|
||||
}
|
||||
|
||||
@PostMapping("/product")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult productPost(@RequestBody MaintenanceRecordsDto dto) {
|
||||
return doProduct(dto);
|
||||
}
|
||||
|
||||
@GetMapping("/order")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult order(MaintenanceRecordsDto dto)
|
||||
{
|
||||
if (StringUtils.isEmpty(dto.getSerialNumber())){
|
||||
return AjaxResult.success();
|
||||
public AjaxResult order(MaintenanceRecordsDto dto) {
|
||||
return doOrder(dto);
|
||||
}
|
||||
|
||||
@PostMapping("/order")
|
||||
@ResponseBody
|
||||
@Anonymous
|
||||
public AjaxResult orderPost(@RequestBody MaintenanceRecordsDto dto) {
|
||||
return doOrder(dto);
|
||||
}
|
||||
|
||||
private AjaxResult doQuery(MaintenanceRecordsDto dto) {
|
||||
if (!hasSerialNumbers(dto)) {
|
||||
return AjaxResult.success(Collections.emptyList());
|
||||
}
|
||||
return AjaxResult.success(service.query(dto));
|
||||
}
|
||||
|
||||
private AjaxResult doProduct(MaintenanceRecordsDto dto) {
|
||||
if (!hasSerialNumbers(dto) && StringUtils.isEmpty(dto.getProductCode())) {
|
||||
return AjaxResult.success(Collections.emptyList());
|
||||
}
|
||||
return AjaxResult.success(productInfoService.query(dto));
|
||||
}
|
||||
|
||||
private AjaxResult doOrder(MaintenanceRecordsDto dto) {
|
||||
List<String> serialNumbers = dto.getResolvedSerialNumbers();
|
||||
if (serialNumbers.isEmpty()) {
|
||||
return AjaxResult.success(Collections.emptyList());
|
||||
}
|
||||
ApiDataQueryDto queryDto = new ApiDataQueryDto();
|
||||
queryDto.setSerialNumbers(serialNumbers);
|
||||
if (serialNumbers.size() == 1) {
|
||||
queryDto.setSerialNumber(serialNumbers.get(0));
|
||||
}
|
||||
ApiDataQueryDto queryDto=new ApiDataQueryDto();
|
||||
queryDto.setSerialNumber(dto.getSerialNumber());
|
||||
return AjaxResult.success(projectOrderInfoService.getOrderInfo(queryDto));
|
||||
}
|
||||
|
||||
}
|
||||
private boolean hasSerialNumbers(MaintenanceRecordsDto dto) {
|
||||
return dto != null && !dto.getResolvedSerialNumbers().isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,12 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
* @version : 1.0
|
||||
|
|
@ -18,8 +22,22 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
public class MaintenanceRecordsDto {
|
||||
//序列号
|
||||
private String serialNumber;
|
||||
private List<String> serialNumbers;
|
||||
private String productCode;
|
||||
|
||||
}
|
||||
public List<String> getResolvedSerialNumbers() {
|
||||
LinkedHashSet<String> values = new LinkedHashSet<>();
|
||||
if (StringUtils.isNotEmpty(serialNumber)) {
|
||||
values.add(serialNumber.trim());
|
||||
}
|
||||
if (serialNumbers != null) {
|
||||
for (String item : serialNumbers) {
|
||||
if (StringUtils.isNotEmpty(item)) {
|
||||
values.add(item.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(values);
|
||||
}
|
||||
}
|
||||
|
|
@ -180,6 +180,7 @@ public class ProjectOrderInfo extends BaseEntity {
|
|||
private Date updateTimeStart;
|
||||
private Date updateTimeEnd;
|
||||
private String productSn;
|
||||
private List<String> productSnList;
|
||||
/**
|
||||
* 公司直发
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package com.ruoyi.sip.dto;
|
||||
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : ch
|
||||
|
|
@ -29,5 +32,20 @@ public class ApiDataQueryDto {
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date queryEndTime;
|
||||
private String serialNumber;
|
||||
private List<String> serialNumbers;
|
||||
|
||||
}
|
||||
public List<String> getResolvedSerialNumbers() {
|
||||
LinkedHashSet<String> values = new LinkedHashSet<>();
|
||||
if (StringUtils.isNotEmpty(serialNumber)) {
|
||||
values.add(serialNumber.trim());
|
||||
}
|
||||
if (serialNumbers != null) {
|
||||
for (String item : serialNumbers) {
|
||||
if (StringUtils.isNotEmpty(item)) {
|
||||
values.add(item.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(values);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.sip.domain.MaintenanceRecord;
|
||||
import com.ruoyi.sip.domain.MaintenanceRecordsDto;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.mapper.MaintenanceMapper;
|
||||
|
|
@ -15,6 +13,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -44,13 +43,33 @@ public class MaintenanceServiceImpl implements IMaintenanceService {
|
|||
|
||||
@Override
|
||||
public List<DeliveryInfoVo.ServiceInfo> query(MaintenanceRecordsDto dto) {
|
||||
|
||||
ApiDataQueryDto apiDataQueryDto = new ApiDataQueryDto();
|
||||
apiDataQueryDto.setSerialNumber(dto.getSerialNumber());
|
||||
List<DeliveryInfoVo> numberInfo = deliveryService.getNumberInfo(apiDataQueryDto);
|
||||
if (CollUtil.isEmpty(numberInfo)){
|
||||
List<String> serialNumbers = dto.getResolvedSerialNumbers();
|
||||
if (CollUtil.isEmpty(serialNumbers)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return numberInfo.get(0).getServiceInfo();
|
||||
|
||||
ApiDataQueryDto apiDataQueryDto = new ApiDataQueryDto();
|
||||
apiDataQueryDto.setSerialNumbers(serialNumbers);
|
||||
if (serialNumbers.size() == 1) {
|
||||
apiDataQueryDto.setSerialNumber(serialNumbers.get(0));
|
||||
}
|
||||
|
||||
List<DeliveryInfoVo> numberInfo = deliveryService.getNumberInfo(apiDataQueryDto);
|
||||
if (CollUtil.isEmpty(numberInfo)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<DeliveryInfoVo.ServiceInfo> result = new ArrayList<>();
|
||||
for (DeliveryInfoVo deliveryInfoVo : numberInfo) {
|
||||
if (CollUtil.isEmpty(deliveryInfoVo.getServiceInfo())) {
|
||||
continue;
|
||||
}
|
||||
for (DeliveryInfoVo.ServiceInfo serviceInfo : deliveryInfoVo.getServiceInfo()) {
|
||||
serviceInfo.setSerialNumber(deliveryInfoVo.getSerialNumber());
|
||||
serviceInfo.setProductCode(deliveryInfoVo.getProductCode());
|
||||
result.add(serviceInfo);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -120,7 +120,7 @@ public class ProductInfoServiceImpl implements IProductInfoService
|
|||
|
||||
@Override
|
||||
public List<ProductInfo> query(MaintenanceRecordsDto dto) {
|
||||
if (StringUtils.isEmpty(dto.getSerialNumber()) && StringUtils.isEmpty(dto.getProductCode())){
|
||||
if (CollUtil.isEmpty(dto.getResolvedSerialNumbers()) && StringUtils.isEmpty(dto.getProductCode())) {
|
||||
dto.setSerialNumber("-23232$$$$32");
|
||||
}
|
||||
return productInfoMapper.query(dto);
|
||||
|
|
|
|||
|
|
@ -1764,16 +1764,20 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
|||
@Override
|
||||
public List<OrderInfoVo> getOrderInfo(ApiDataQueryDto dto) {
|
||||
ProjectOrderInfo queryParams = new ProjectOrderInfo();
|
||||
if (dto.getQueryStartTime()!=null) {
|
||||
if (dto.getQueryStartTime() != null) {
|
||||
queryParams.setUpdateTimeStart(dto.getQueryStartTime());
|
||||
}
|
||||
if (dto.getQueryEndTime()!=null) {
|
||||
if (dto.getQueryEndTime() != null) {
|
||||
queryParams.setUpdateTimeEnd(dto.getQueryEndTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(dto.getSerialNumber())){
|
||||
queryParams.setProductSn(dto.getSerialNumber());
|
||||
List<String> serialNumbers = dto.getResolvedSerialNumbers();
|
||||
if (CollUtil.isNotEmpty(serialNumbers)) {
|
||||
queryParams.setProductSnList(serialNumbers);
|
||||
if (serialNumbers.size() == 1) {
|
||||
queryParams.setProductSn(serialNumbers.get(0));
|
||||
}
|
||||
}
|
||||
return projectOrderInfoMapper.listOrderInfoVo(queryParams);
|
||||
return projectOrderInfoMapper.listOrderInfoVo(queryParams);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.sip.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
|
@ -47,14 +46,14 @@ public class DeliveryInfoVo {
|
|||
@JsonIgnore
|
||||
private String productType;
|
||||
|
||||
|
||||
@Data
|
||||
public class ServiceInfo {
|
||||
//服务级别
|
||||
private String serviceLevel;
|
||||
//服务描述
|
||||
private String serviceDescribe;
|
||||
|
||||
private String serialNumber;
|
||||
private String productCode;
|
||||
//服务开始时间
|
||||
private Date serviceStartTime;
|
||||
//服务结束时间
|
||||
|
|
|
|||
|
|
@ -111,9 +111,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and t1.update_time <![CDATA[ <= ]]> #{queryEndTime}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="serialNumber!=null and serialNumber!=''">
|
||||
and t2.product_sn = #{serialNumber}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="serialNumbers != null and serialNumbers.size > 0">
|
||||
and t2.product_sn in
|
||||
<foreach item="item" collection="serialNumbers" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="serialNumber!=null and serialNumber!=''">
|
||||
and t2.product_sn = #{serialNumber}
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -374,9 +374,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</when>
|
||||
</choose>
|
||||
|
||||
<if test="productSn!=null and productSn!=''">
|
||||
and t1.order_code in (select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
|
||||
</if>
|
||||
<choose>
|
||||
<when test="productSnList != null and productSnList.size > 0">
|
||||
and t1.order_code in (
|
||||
select distinct order_code
|
||||
from oms_inventory_outer
|
||||
where outer_code in (
|
||||
select outer_code
|
||||
from oms_inventory_info
|
||||
where product_sn in
|
||||
<foreach item="item" collection="productSnList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
)
|
||||
</when>
|
||||
<when test="productSn!=null and productSn!=''">
|
||||
and t1.order_code in (select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
<select id="listByCodeList" resultType="com.ruoyi.sip.domain.ProjectOrderInfo">
|
||||
<include refid="selectProjectOrderInfoRelationVo"/>
|
||||
|
|
|
|||
|
|
@ -91,9 +91,17 @@
|
|||
FROM
|
||||
product_info t1 left join oms_inventory_info t2 on t1.product_code=t2.product_code
|
||||
<where>
|
||||
<if test="serialNumber!=null and serialNumber!=''">
|
||||
and t2.product_sn=#{serialNumber}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="serialNumbers != null and serialNumbers.size > 0">
|
||||
and t2.product_sn in
|
||||
<foreach item="item" collection="serialNumbers" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</when>
|
||||
<when test="serialNumber!=null and serialNumber!=''">
|
||||
and t2.product_sn=#{serialNumber}
|
||||
</when>
|
||||
</choose>
|
||||
<if test="productCode!=null and productCode!=''">
|
||||
and t1.product_code=#{productCode}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue