物料查询关联拓展关系

This commit is contained in:
liss
2025-10-17 11:46:08 +08:00
parent f7155565d4
commit d8c795742e
16 changed files with 164 additions and 35 deletions

View File

@@ -1,11 +1,10 @@
package com.zt.plat.module.api;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.api.dto.AccountRespDto;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@@ -17,7 +16,11 @@ public interface BaseApi {
String PREFIX = ApiConstants.PREFIX + "/base";
@GetMapping(PREFIX + "/getNoPage")
@Operation(summary = "数据查询")
List<AccountRespDto> getNoPage(@Valid AccountRespDto respVO);
@GetMapping(PREFIX + "/getAccountNoPage")
@Operation(summary = "账户条款数据不分页查询")
List<AccountDTO> getAccountNoPage(AccountDTO respVO);
@GetMapping(PREFIX + "/getMaterialOtherNoPage")
@Operation(summary = "物料拓展关系数据不分页查询")
List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO);
}

View File

@@ -7,7 +7,7 @@ import java.time.LocalDateTime;
@Schema(description = "RPC 服务 DTO")
@Data
public class AccountRespDto {
public class AccountDTO {
private Long id;
private String type;

View File

@@ -0,0 +1,53 @@
package com.zt.plat.module.api.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 物料拓展数据分页 Request VO")
@Data
public class MaterialOtherDTO extends PageParam {
@Schema(description = "物料编码")
private String materialNumber;
@Schema(description = "物料名称", example = "王五")
private String materialName;
@Schema(description = "ERP物料编码")
private String erpMaterialNumber;
@Schema(description = "ERP物料名称", example = "李四")
private String erpMaterialName;
@Schema(description = "ERP物料计量单位")
private String unit;
@Schema(description = "金属元素缩写")
private String abbreviation;
@Schema(description = "金属元素名称", example = "赵六")
private String name;
@Schema(description = "金属元素编码")
private String coding;
@Schema(description = "品位单位")
private String gradeUnit;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "小数位数")
private Long decimalValue;
@Schema(description = "是否启用")
private String isEnable;
}

View File

@@ -1,10 +1,10 @@
package com.zt.plat.module.base.api;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.api.BaseApi;
import com.zt.plat.module.api.dto.AccountRespDto;
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.service.base.AccountService;
import com.zt.plat.module.base.service.base.MaterialOtherService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;
@@ -24,8 +24,16 @@ public class BaseApiImpl implements BaseApi {
@Resource
private AccountService accountService;
@Resource
private MaterialOtherService materialOtherService;
@Override
public List<AccountRespDto> getNoPage(AccountRespDto respVO) {
public List<AccountDTO> getAccountNoPage(AccountDTO respVO) {
return accountService.getAccountNoPage(respVO);
}
@Override
public List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO) {
return materialOtherService.getMaterialOtherNoPage(respVO);
}
}

View File

@@ -3,9 +3,8 @@ package com.zt.plat.module.base.dal.mysql.base;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.api.dto.AccountRespDto;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
import org.apache.ibatis.annotations.Mapper;
@@ -35,18 +34,18 @@ public interface AccountMapper extends BaseMapperX<AccountDO> {
.orderByDesc(AccountDO::getId));
}
default List<AccountDO> selectNoPage(AccountRespDto reqVO){
default List<AccountDO> selectNoPage(AccountDTO dto){
return selectList(new LambdaQueryWrapperX<AccountDO>()
.eqIfPresent(AccountDO::getType, reqVO.getType())
.likeIfPresent(AccountDO::getAccountName, reqVO.getAccountName())
.likeIfPresent(AccountDO::getAddress, reqVO.getAddress())
.likeIfPresent(AccountDO::getPhone, reqVO.getPhone())
.eqIfPresent(AccountDO::getBankAccount, reqVO.getBankAccount())
.eqIfPresent(AccountDO::getCustomerName, reqVO.getCustomerName())
.eqIfPresent(AccountDO::getCustomerNumber, reqVO.getCustomerNumber())
.eqIfPresent(AccountDO::getIsEnable, reqVO.getIsEnable())
.eqIfPresent(AccountDO::getAccountNumber, reqVO.getAccountNumber())
.eqIfPresent(AccountDO::getTaxNumber, reqVO.getTaxNumber())
.eqIfPresent(AccountDO::getType, dto.getType())
.likeIfPresent(AccountDO::getAccountName, dto.getAccountName())
.likeIfPresent(AccountDO::getAddress, dto.getAddress())
.likeIfPresent(AccountDO::getPhone, dto.getPhone())
.eqIfPresent(AccountDO::getBankAccount, dto.getBankAccount())
.eqIfPresent(AccountDO::getCustomerName, dto.getCustomerName())
.eqIfPresent(AccountDO::getCustomerNumber, dto.getCustomerNumber())
.eqIfPresent(AccountDO::getIsEnable, dto.getIsEnable())
.eqIfPresent(AccountDO::getAccountNumber, dto.getAccountNumber())
.eqIfPresent(AccountDO::getTaxNumber, dto.getTaxNumber())
.orderByDesc(AccountDO::getId));
}
}

View File

@@ -3,10 +3,13 @@ package com.zt.plat.module.base.dal.mysql.base;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherPageReqVO;
import com.zt.plat.module.base.dal.dataobject.base.MaterialOtherDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 物料拓展数据 Mapper
*
@@ -32,4 +35,20 @@ public interface MaterialOtherMapper extends BaseMapperX<MaterialOtherDO> {
.orderByDesc(MaterialOtherDO::getId));
}
default List<MaterialOtherDO> selectList(MaterialOtherDTO dto) {
return selectList(new LambdaQueryWrapperX<MaterialOtherDO>()
.eqIfPresent(MaterialOtherDO::getMaterialNumber, dto.getMaterialNumber())
.likeIfPresent(MaterialOtherDO::getMaterialName, dto.getMaterialName())
.eqIfPresent(MaterialOtherDO::getErpMaterialNumber, dto.getErpMaterialNumber())
.likeIfPresent(MaterialOtherDO::getErpMaterialName, dto.getErpMaterialName())
.eqIfPresent(MaterialOtherDO::getUnit, dto.getUnit())
.eqIfPresent(MaterialOtherDO::getAbbreviation, dto.getAbbreviation())
.likeIfPresent(MaterialOtherDO::getName, dto.getName())
.eqIfPresent(MaterialOtherDO::getCoding, dto.getCoding())
.eqIfPresent(MaterialOtherDO::getGradeUnit, dto.getGradeUnit())
.betweenIfPresent(MaterialOtherDO::getCreateTime, dto.getCreateTime())
.eqIfPresent(MaterialOtherDO::getDecimalValue, dto.getDecimalValue())
.eqIfPresent(MaterialOtherDO::getIsEnable, dto.getIsEnable())
.orderByDesc(MaterialOtherDO::getId));
}
}

View File

@@ -1,7 +1,7 @@
package com.zt.plat.module.base.service.base;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.api.dto.AccountRespDto;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
@@ -69,5 +69,5 @@ public interface AccountService {
*/
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
List<AccountRespDto> getAccountNoPage(AccountRespDto respVO);
List<AccountDTO> getAccountNoPage(AccountDTO respVO);
}

View File

@@ -3,7 +3,7 @@ package com.zt.plat.module.base.service.base;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.api.dto.AccountRespDto;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
@@ -98,8 +98,8 @@ public class AccountServiceImpl implements AccountService {
}
@Override
public List<AccountRespDto> getAccountNoPage(AccountRespDto respVO) {
List<AccountDO> entityList = accountMapper.selectNoPage(respVO);
return BeanUtils.toBean(entityList, AccountRespDto.class);
public List<AccountDTO> getAccountNoPage(AccountDTO dto) {
List<AccountDO> entityList = accountMapper.selectNoPage(dto);
return BeanUtils.toBean(entityList, AccountDTO.class);
}
}

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.base.service.base;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherSaveReqVO;
@@ -62,4 +63,6 @@ public interface MaterialOtherService {
PageResult<MaterialOtherDO> getMaterialOtherPage(MaterialOtherPageReqVO pageReqVO);
void enableMaterialOtherList(List<MaterialOtherRespVO> saveReqVOS);
List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO);
}

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.base.service.base;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.MaterialOtherSaveReqVO;
@@ -96,4 +97,10 @@ public class MaterialOtherServiceImpl implements MaterialOtherService {
}
}
@Override
public List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO dto) {
List<MaterialOtherDO> list = materialOtherMapper.selectList(dto);
return BeanUtils.toBean(list, MaterialOtherDTO.class);
}
}