Merge branch 'refs/heads/dev' into test

This commit is contained in:
liss
2025-10-24 10:47:29 +08:00
16 changed files with 164 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
package com.zt.plat.module.api;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.api.dto.ElementDTO;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
@@ -23,4 +25,8 @@ public interface BaseApi {
@GetMapping(PREFIX + "/getMaterialOtherNoPage")
@Operation(summary = "物料拓展关系数据不分页查询")
List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO);
@GetMapping(PREFIX + "/getElementNoPage")
@Operation(summary = "金属元素数据不分页查询")
CommonResult<List<ElementDTO>> getElementNoPage(ElementDTO respVO);
}

View File

@@ -0,0 +1,33 @@
package com.zt.plat.module.api.dto;
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 = "管理后台 - 金属元素 Response VO")
@Data
public class ElementDTO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21884")
private Long id;
@Schema(description = "金属元素缩写", requiredMode = Schema.RequiredMode.REQUIRED)
private String abbreviation;
@Schema(description = "金属元素名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
private String name;
@Schema(description = "金属元素编码", requiredMode = Schema.RequiredMode.REQUIRED)
private String coding;
@Schema(description = "小数位数", requiredMode = Schema.RequiredMode.REQUIRED)
private Long decimalValue;
@Schema(description = "品位单位", requiredMode = Schema.RequiredMode.REQUIRED)
private String gradeUnit;
}

View File

@@ -1,16 +1,30 @@
package com.zt.plat.module.base.api;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.api.BaseApi;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.api.dto.ElementDTO;
import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
import com.zt.plat.module.base.dal.dataobject.base.ElementDO;
import com.zt.plat.module.base.service.base.AccountService;
import com.zt.plat.module.base.service.base.ElementService;
import com.zt.plat.module.base.service.base.MaterialOtherService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
/**
* ERP Api 实现类
*
@@ -27,6 +41,9 @@ public class BaseApiImpl implements BaseApi {
@Resource
private MaterialOtherService materialOtherService;
@Resource
private ElementService elementService;
@Override
public List<AccountDTO> getAccountNoPage(AccountDTO respVO) {
return accountService.getAccountNoPage(respVO);
@@ -36,4 +53,9 @@ public class BaseApiImpl implements BaseApi {
public List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO) {
return materialOtherService.getMaterialOtherNoPage(respVO);
}
public CommonResult<List<ElementDTO>> getElementNoPage(ElementDTO respVO) {
List<ElementDO> list = elementService.getElementNoPage(respVO);
return success(BeanUtils.toBean(list, ElementDTO.class));
}
}

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.ElementDTO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
import com.zt.plat.module.base.dal.dataobject.base.ElementDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 金属元素 Mapper
*
@@ -27,4 +30,14 @@ public interface ElementMapper extends BaseMapperX<ElementDO> {
}
String selectMaxCode();
default List<ElementDO> getElementNoPage(ElementDTO dto) {
return selectList(new LambdaQueryWrapperX<ElementDO>()
.eqIfPresent(ElementDO::getAbbreviation, dto.getAbbreviation())
.likeIfPresent(ElementDO::getName, dto.getName())
.eqIfPresent(ElementDO::getDecimalValue, dto.getDecimalValue())
.eqIfPresent(ElementDO::getCoding, dto.getCoding())
.eqIfPresent(ElementDO::getGradeUnit, dto.getGradeUnit())
.orderByDesc(ElementDO::getId));
}
}

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.ElementDTO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
@@ -62,4 +63,6 @@ public interface ElementService {
PageResult<ElementDO> getElementPage(ElementPageReqVO pageReqVO);
void enableElementList(List<ElementRespVO> saveReqVOS);
List<ElementDO> getElementNoPage(ElementDTO 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.ElementDTO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementPageReqVO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementRespVO;
import com.zt.plat.module.base.controller.admin.base.vo.ElementSaveReqVO;
@@ -107,4 +108,9 @@ public class ElementServiceImpl implements ElementService {
}
}
@Override
public List<ElementDO> getElementNoPage(ElementDTO respVO) {
return elementMapper.getElementNoPage(respVO);
}
}

View File

@@ -15,4 +15,5 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_ID_NOT_EXISTS = new ErrorCode(1_008_000_010, "订单id不能为空");
ErrorCode PRCH_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_001, "采购订单明细不存在");
ErrorCode PURCHASE_ORDER_STATUS_ERROR = new ErrorCode(1_008_001_020, "非法的订单状态");
ErrorCode Sales_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_001, "销售订单不存在");
}

View File

@@ -192,4 +192,8 @@ public class PurchaseOrderDetailsRespVO {
*/
private List<PrchOrdDtlDetailsRespVO> orderDetails;
/**
* 订单类型
*/
private String splyBsnTp;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.controller.admin.salesorder.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.zt.plat.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -134,4 +135,25 @@ public class SalesOrderPageReqVO extends PageParam {
private String splyBsnTp;
@Schema(description = "销售组织名称")
@ExcelProperty("销售组织名称")
private String saleOrgzName;
@Schema(description = "销售组织编码")
@ExcelProperty("销售组织编码")
private String saleOrgzCd;
@Schema(description = "销售部门名称")
@ExcelProperty("销售部门名称")
private String saleAcsName;
@Schema(description = "销售部门编码")
@ExcelProperty("销售部门编码")
private String saleAcsCdg;
@Schema(description = "产品组名")
@ExcelProperty("产品组名")
private String pdtGrpName;
@Schema(description = "产品组编码")
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
}

View File

@@ -191,10 +191,28 @@ public class SalesOrderRespVO {
@Schema(description = "流程当前任务节点id")
@ExcelProperty("流程当前任务节点id")
private String taskId;
@Schema(description = " 审批意见")
@ExcelProperty(" 审批意见")
private String reviewOpinion;
@Schema(description = "销售组织名称")
@ExcelProperty("销售组织名称")
private String saleOrgzName;
@Schema(description = "销售组织编码")
@ExcelProperty("销售组织编码")
private String saleOrgzCd;
@Schema(description = "分销聚道名称")
@ExcelProperty("分销聚道名称")
private String saleAcsName;
@Schema(description = "分销聚道编码")
@ExcelProperty("分销聚道编码")
private String saleAcsCdg;
@Schema(description = "产品组名")
@ExcelProperty("产品组名")
private String pdtGrpName;
@Schema(description = "产品组编码")
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
}

View File

@@ -186,4 +186,18 @@ public class SalesOrderSaveReqVO {
@Schema(description = "销售组织名称", example = "2")
@ExcelProperty("销售组织名称")
private String saleOrgzName;
@Schema(description = "销售部门名称")
@ExcelProperty("销售部门名称")
private String saleAcsName;
@Schema(description = "销售部门编码")
@ExcelProperty("销售部门编码")
private String saleAcsCdg;
@Schema(description = "产品组名")
@ExcelProperty("产品组名")
private String pdtGrpName;
@Schema(description = "产品组编码")
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
}

View File

@@ -257,25 +257,24 @@ public class SalesOrderDO extends BusinessBaseDO {
@TableField("SPLY_BSN_TP")
private String splyBsnTp;
/**
* 订单子分类
* 产品组编码
*
*/
@TableField("PDT_GRP_CDG")
private String pdtGrpCdg;
/**
* 订单子分类名称
*
* 产品组名
*/
@TableField("PDT_GRP_NAME")
private String pdtGrpName;
/**
* 销售账户
* 分销聚道编码
*
*/
@TableField("SALE_ACS_CDG")
private String saleAcsCdg;
/**
* 销售账户名称
* 分销聚道名称
*
*/
@TableField("SALE_ACS_NAME")
@@ -292,4 +291,5 @@ public class SalesOrderDO extends BusinessBaseDO {
*/
@TableField("SALE_ORGZ_NAME")
private String saleOrgzName;
}

View File

@@ -40,7 +40,12 @@ public interface SalesOrderMapper extends BaseMapperX<SalesOrderDO> {
.eqIfPresent(SalesOrderDO::getRemark, reqVO.getRemark())
.eqIfPresent(SalesOrderDO::getAgentNumber, reqVO.getAgentNumber())
.likeIfPresent(SalesOrderDO::getAgentName, reqVO.getAgentName())
// .eqIfPresent(SalesOrderDO::getOrderNumber, reqVO.getOrderNumber())
.eqIfPresent(SalesOrderDO::getSaleOrgzCd, reqVO.getSaleOrgzCd())
.likeIfPresent(SalesOrderDO::getSaleOrgzName, reqVO.getSaleOrgzName())
.likeIfPresent(SalesOrderDO::getSaleAcsName, reqVO.getSaleAcsName())
.eqIfPresent(SalesOrderDO::getSaleAcsCdg, reqVO.getSaleAcsCdg())
.likeIfPresent(SalesOrderDO::getPdtGrpName, reqVO.getPdtGrpName())
.likeIfPresent(SalesOrderDO::getPdtGrpCdg, reqVO.getPdtGrpCdg())
.eqIfPresent(SalesOrderDO::getContractNumber, reqVO.getContractNumber())
.eqIfPresent(SalesOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
.likeIfPresent(SalesOrderDO::getMaterialName, reqVO.getMaterialName())

View File

@@ -23,6 +23,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.PURCHASE_ORDER_NOT_EXISTS;
import static com.zt.plat.module.contractorder.enums.purchaseorder.ErrorCodeConstants.Sales_ORDER_NOT_EXISTS;
/**
@@ -91,19 +92,20 @@ public class SalesOrderServiceImpl implements SalesOrderService {
private void validateSalesOrderExists(List<Long> ids) {
List<SalesOrderDO> list = salesOrderMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(PURCHASE_ORDER_NOT_EXISTS);
throw exception(Sales_ORDER_NOT_EXISTS);
}
}
private void validateSalesOrderExists(Long id) {
if (salesOrderMapper.selectById(id) == null) {
throw exception(PURCHASE_ORDER_NOT_EXISTS);
throw exception(Sales_ORDER_NOT_EXISTS);
}
}
@Override
public SalesOrderDO getSalesOrder(Long id, String splyBsnTp) {
return salesOrderMapper.selectOne(new LambdaQueryWrapper<SalesOrderDO>().eq(SalesOrderDO::getId, id).eq(splyBsnTp != null && !splyBsnTp.isEmpty(), SalesOrderDO::getSplyBsnTp, splyBsnTp));
return salesOrderMapper.selectOne(new LambdaQueryWrapper<SalesOrderDO>().eq(SalesOrderDO::getId, id)
.eq(splyBsnTp != null && !splyBsnTp.isEmpty(), SalesOrderDO::getSplyBsnTp, splyBsnTp));
}
@Override

View File

@@ -126,7 +126,7 @@ public class ErpCompanyController {
}
@PostMapping("/test2")
@Operation(summary = "获取base的账户条款")
@Operation(summary = "获取base的金属元素")
@PreAuthorize("@ss.hasPermission('sply:erp-company:get')")
public CommonResult<String> test2() {
String TEST = erpCompanyService.test2();

View File

@@ -4,11 +4,13 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.api.BaseApi;
import com.zt.plat.module.api.dto.AccountDTO;
import com.zt.plat.module.api.dto.ElementDTO;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
@@ -287,9 +289,8 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
@Override
public String test2() {
AccountDTO respVO = new AccountDTO();
respVO.setCustomerNumber("50000760");
List<AccountDTO> dtos = baseApi.getAccountNoPage(respVO);
ElementDTO respVO = new ElementDTO();
CommonResult<List<ElementDTO>> dtos = baseApi.getElementNoPage(respVO);
return dtos.toString();
}
}