diff --git a/oms_web/oms_vue/src/api/manage/service.js b/oms_web/oms_vue/src/api/manage/service.js index 4629ba25..c0da79b7 100644 --- a/oms_web/oms_vue/src/api/manage/service.js +++ b/oms_web/oms_vue/src/api/manage/service.js @@ -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) }) -} +} \ No newline at end of file diff --git a/oms_web/oms_vue/src/assets/images/company-QR-code.png b/oms_web/oms_vue/src/assets/images/company-QR-code.png new file mode 100644 index 00000000..64265910 Binary files /dev/null and b/oms_web/oms_vue/src/assets/images/company-QR-code.png differ diff --git a/oms_web/oms_vue/src/assets/images/companyLogoHD.png b/oms_web/oms_vue/src/assets/images/companyLogoHD.png new file mode 100644 index 00000000..fbb17352 Binary files /dev/null and b/oms_web/oms_vue/src/assets/images/companyLogoHD.png differ diff --git a/oms_web/oms_vue/src/assets/images/maintenance-background.png b/oms_web/oms_vue/src/assets/images/maintenance-background.png new file mode 100644 index 00000000..d545bafd Binary files /dev/null and b/oms_web/oms_vue/src/assets/images/maintenance-background.png differ diff --git a/oms_web/oms_vue/src/views/approve/finance/payment/components/PaymentDetail.vue b/oms_web/oms_vue/src/views/approve/finance/payment/components/PaymentDetail.vue index f420aae5..c51b1140 100644 --- a/oms_web/oms_vue/src/views/approve/finance/payment/components/PaymentDetail.vue +++ b/oms_web/oms_vue/src/views/approve/finance/payment/components/PaymentDetail.vue @@ -92,7 +92,7 @@ size="80%" append-to-body :modal-append-to-body="true" - :z-index="3000" + :z-index="pruchaseDrawerZIndex" > { diff --git a/oms_web/oms_vue/src/views/manage/service/index.vue b/oms_web/oms_vue/src/views/manage/service/index.vue index 8843f1ba..f1ef92ac 100644 --- a/oms_web/oms_vue/src/views/manage/service/index.vue +++ b/oms_web/oms_vue/src/views/manage/service/index.vue @@ -1,179 +1,1238 @@ diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/MaintenanceController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/MaintenanceController.java index b3252e43..c4f6210d 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/MaintenanceController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/MaintenanceController.java @@ -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 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(); + } +} \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/MaintenanceRecordsDto.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/MaintenanceRecordsDto.java index a5b5eb9e..4e9eed61 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/MaintenanceRecordsDto.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/MaintenanceRecordsDto.java @@ -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 serialNumbers; private String productCode; -} + public List getResolvedSerialNumbers() { + LinkedHashSet 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); + } +} \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java index 183eb9f6..4ed1f0ed 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/domain/ProjectOrderInfo.java @@ -180,6 +180,7 @@ public class ProjectOrderInfo extends BaseEntity { private Date updateTimeStart; private Date updateTimeEnd; private String productSn; + private List productSnList; /** * 公司直发 */ diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java index 7f4233af..441a46f5 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/dto/ApiDataQueryDto.java @@ -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 serialNumbers; -} + public List getResolvedSerialNumbers() { + LinkedHashSet 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); + } +} \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/MaintenanceServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/MaintenanceServiceImpl.java index bfe94942..990ce216 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/MaintenanceServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/MaintenanceServiceImpl.java @@ -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 query(MaintenanceRecordsDto dto) { - - ApiDataQueryDto apiDataQueryDto = new ApiDataQueryDto(); - apiDataQueryDto.setSerialNumber(dto.getSerialNumber()); - List numberInfo = deliveryService.getNumberInfo(apiDataQueryDto); - if (CollUtil.isEmpty(numberInfo)){ + List 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 numberInfo = deliveryService.getNumberInfo(apiDataQueryDto); + if (CollUtil.isEmpty(numberInfo)) { + return Collections.emptyList(); + } + + List 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; } -} +} \ No newline at end of file diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProductInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProductInfoServiceImpl.java index eddf2ff8..f380d992 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProductInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProductInfoServiceImpl.java @@ -120,7 +120,7 @@ public class ProductInfoServiceImpl implements IProductInfoService @Override public List 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); diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 32727881..c07a1575 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -1764,16 +1764,20 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To @Override public List 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 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); } /** diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/DeliveryInfoVo.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/DeliveryInfoVo.java index db9116d3..22e41ffb 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/DeliveryInfoVo.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/vo/DeliveryInfoVo.java @@ -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; //服务结束时间 diff --git a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml index 70a9f2c0..a72d77e9 100644 --- a/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/inventory/InventoryDeliveryMapper.xml @@ -111,9 +111,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and t1.update_time #{queryEndTime} - - and t2.product_sn = #{serialNumber} - + + + and t2.product_sn in + + #{item} + + + + and t2.product_sn = #{serialNumber} + + diff --git a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml index c877b062..c04a092c 100644 --- a/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/sip/ProjectOrderInfoMapper.xml @@ -374,9 +374,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - 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} ) ) - + + + 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 + + #{item} + + ) + ) + + + 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} ) ) + +