fix:供应商接口调整、物料接口复用比较多的新增业务场景字段。

This commit is contained in:
shusir
2026-03-19 09:26:08 +08:00
parent da2d9f640c
commit 8074f8b473
13 changed files with 121 additions and 25 deletions

View File

@@ -1,12 +1,13 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
@@ -95,6 +96,7 @@ public class SupplierController extends AbstractFileUploadController implements
// @PreAuthorize("@ss.hasPermission('qms:supplier:query')")
public CommonResult<SupplierExtendRespVO> getSupplier(@RequestParam("id") Long id) {
SupplierExtendRespVO supplier = supplierService.getSupplier(id);
return success(supplier);
}

View File

@@ -1,12 +1,14 @@
package com.zt.plat.module.qms.office.supplier.controller.admin;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.common.service.BusinessFileService;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPropertiesSaveReqVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
@@ -55,6 +57,9 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
@Resource
private SupplierPropertiesService supplierPropertiesService;
@Autowired
private BusinessFileService businessFileService;
@PostMapping("/create")
@Operation(summary = "创建供应商属性")
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')")
@@ -65,9 +70,9 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
@PutMapping("/update")
@Operation(summary = "更新供应商属性")
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')")
public CommonResult<Boolean> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
supplierPropertiesService.updateSupplierProperties(updateReqVO);
return success(true);
public CommonResult<SupplierPropertiesRespVO> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
SupplierPropertiesRespVO respVO = supplierPropertiesService.updateSupplierProperties(updateReqVO);
return success(respVO);
}
@DeleteMapping("/delete")
@@ -94,7 +99,10 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
public CommonResult<SupplierPropertiesRespVO> getSupplierProperties(@RequestParam("id") Long id) {
SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id);
return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class));
CommonResult<List<BusinessFileWithUrlRespDTO>> result = businessFileService.getBusinessFileList(id);
SupplierPropertiesRespVO respVO = BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class);
respVO.setBusinessFileRet(result.getData());
return success(respVO);
}
@GetMapping("/page")

View File

@@ -1,24 +1,19 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
@Data
public class SupplierExtendRespVO extends SupplierRespVO {
private String certification;
private List<String> certifications;
public String getCertification() {
if (CollUtil.isNotEmpty(this.supplierPropertiesList)) {
return this.supplierPropertiesList.stream().map(m -> m.getSubitemCode()).collect(Collectors.joining(""));
}
return null;
}
private List<String> certsOfExistFiles;
private List<String> types;
private List<SupplierPropertiesDO> supplierPropertiesList;

View File

@@ -1,11 +1,14 @@
package com.zt.plat.module.qms.office.supplier.controller.vo;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 供应商属性 Response VO")
@@ -62,4 +65,7 @@ public class SupplierPropertiesRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "附件对象")
private List<BusinessFileWithUrlRespDTO> businessFileRet;
}

View File

@@ -28,8 +28,9 @@ public interface SupplierPropertiesService {
* 更新供应商属性
*
* @param updateReqVO 更新信息
* @return
*/
void updateSupplierProperties(@Valid SupplierPropertiesSaveReqVO updateReqVO);
SupplierPropertiesRespVO updateSupplierProperties(@Valid SupplierPropertiesSaveReqVO updateReqVO);
/**
* 删除供应商属性

View File

@@ -42,12 +42,13 @@ public class SupplierPropertiesServiceImpl implements SupplierPropertiesService
}
@Override
public void updateSupplierProperties(SupplierPropertiesSaveReqVO updateReqVO) {
public SupplierPropertiesRespVO updateSupplierProperties(SupplierPropertiesSaveReqVO updateReqVO) {
// 校验存在
validateSupplierPropertiesExists(updateReqVO.getId());
// 更新
SupplierPropertiesDO updateObj = BeanUtils.toBean(updateReqVO, SupplierPropertiesDO.class);
supplierPropertiesMapper.updateById(updateObj);
return BeanUtils.toBean(updateObj, SupplierPropertiesRespVO.class);
}
@Override

View File

@@ -2,15 +2,21 @@ package com.zt.plat.module.qms.office.supplier.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.module.qms.common.service.BusinessFileService;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import java.util.stream.Collectors;
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
import com.zt.plat.framework.common.pojo.PageResult;
@@ -34,6 +40,9 @@ public class SupplierServiceImpl implements SupplierService {
@Resource
private SupplierMapper supplierMapper;
@Autowired
private BusinessFileService businessFileService;
@Override
public SupplierRespVO createSupplier(SupplierSaveReqVO createReqVO) {
// 插入
@@ -83,7 +92,23 @@ public class SupplierServiceImpl implements SupplierService {
@Override
public SupplierExtendRespVO getSupplier(Long id) {
return supplierMapper.selectOneWithCertifications(id);
SupplierExtendRespVO supplier = supplierMapper.selectOneWithCertifications(id);
List<SupplierPropertiesDO> supplierPropertiesList = supplier.getSupplierPropertiesList();
if (CollUtil.isNotEmpty(supplierPropertiesList)) {
List<String> certs = supplierPropertiesList.stream().map(SupplierPropertiesDO::getSubitemCode).toList();
supplier.setCertifications(certs);
List<String> certsOfExistFiles = new ArrayList<>();
for (SupplierPropertiesDO propertiesDO : supplierPropertiesList) {
CommonResult<List<BusinessFileWithUrlRespDTO>> result = businessFileService.getBusinessFileList(propertiesDO.getId());
if (CollUtil.isNotEmpty(result.getData()))
certsOfExistFiles.add(propertiesDO.getSubitemCode());
}
supplier.setCertsOfExistFiles(certsOfExistFiles);
}
supplier.setTypes(supplier.getType() != null
? List.of(supplier.getType().split(""))
: Collections.emptyList());
return supplier;
}
@Override

View File

@@ -20,8 +20,8 @@ public class MaterialBatchPageReqVO extends PageParam {
@Schema(description = "物料大类id", example = "9381")
private Long productId;
@Schema(description = "功能操作类型 batch_manage-批次管理acceptance-验收inbound-入库return_exchange-退换货")
private String operationType;
@Schema(description = "业务场景 batch_manage-批次管理acceptance-验收inbound-入库return_exchange-退换货")
private String businessType;
@Schema(description = "是否需要组装 children")
private Boolean children = false;

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.qms.resource.material.controller.vo.query;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zt.plat.module.qms.resource.material.enums.MaterialInfomationBusinessType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@@ -14,6 +15,10 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class MaterialInfomationQueryVO {
@Schema(description = "业务场景 outbound-出库use_record-使用记录used_mark-用完标记open_seal-开封")
private MaterialInfomationBusinessType businessType;
@Schema(description = "物料大类id", example = "2691")
private Long productId;

View File

@@ -1,10 +1,10 @@
package com.zt.plat.module.qms.resource.material.enums;
/**
* 物料批次操作类型
* 物料批次-工段操作类型
*
*/
public enum MaterialBatchOperationType {
public enum MaterialBatchGongBusinessType {
/**
* 批次管理
*/

Some files were not shown because too many files have changed in this diff Show More