Merge branch 'refs/heads/dev' into test

This commit is contained in:
liss
2025-10-11 11:34:55 +08:00
23 changed files with 179 additions and 106 deletions

View File

@@ -1,7 +1,6 @@
package com.zt.plat.module.contractorder.api.dto; package com.zt.plat.module.contractorder.api.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -13,9 +12,6 @@ public class ContractCoefficientRespDTO {
@Schema(description = "主键") @Schema(description = "主键")
private Long id; private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键") @Schema(description = "条款主键")
private Long formulaId; private Long formulaId;
@@ -28,25 +24,21 @@ public class ContractCoefficientRespDTO {
@Schema(description = "金属元素名称") @Schema(description = "金属元素名称")
private String elementName; private String elementName;
@Schema(description = "系数值")
private String settlementCoefficient;
@Schema(description = "系数上限") @Schema(description = "系数上限")
private BigDecimal coefficientUp; private BigDecimal coefficientUp;
@Schema(description = "系数下限") @Schema(description = "系数下限")
private BigDecimal coefficientDown; private BigDecimal coefficientDown;
@Schema(description = "是否包含上限") @Schema(description = "区间方式(字典STLM_RNG_WY)")
private String isInUp; private String rangeWay;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "是否省内") @Schema(description = "是否省内")
@NotEmpty(message = "是否省内不能为空")
private String inState; private String inState;
@Schema(description = "类型") @Schema(description = "类型")
private String type; private String type;
@Schema(description = "系数值")
private BigDecimal settlementCoefficient;
} }

View File

@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "RPC 服务 - 调整价配置 Response DTO") @Schema(description = "RPC 服务 - 调整价配置 Response DTO")
@Data @Data
@@ -12,39 +13,18 @@ public class ContractDeductRespDTO {
@Schema(description = "主键") @Schema(description = "主键")
private Long id; private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键") @Schema(description = "条款主键")
private Long formulaId; private Long formulaId;
@Schema(description = "物料编码;推送ERP") @Schema(description = "数据项类型(字典:GRD_CFG_TP)")
private String materialNumber; private String configType;
@Schema(description = "物料名称")
private String materialName;
@Schema(description = "上限")
private BigDecimal gradeUp;
@Schema(description = "下限")
private BigDecimal gradeDown;
@Schema(description = "是否包含上限")
private String isInUp;
@Schema(description = "是否包含下限")
private String isInDown;
@Schema(description = "方式")
private String way;
@Schema(description = "类型")
private String type;
@Schema(description = "是否省内") @Schema(description = "是否省内")
private String inState; private String inState;
@Schema(description = "调整价") @Schema(description = "调整价")
private BigDecimal gradeAmount; private BigDecimal gradeAmount;
@Schema(description = "创建时间")
private LocalDateTime createTime;
} }

View File

@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "RPC 服务 - 品位等级价配置 Response DTO") @Schema(description = "RPC 服务 - 品位等级价配置 Response DTO")
@Data @Data
@@ -12,9 +13,6 @@ public class ContractGradeRespDTO {
@Schema(description = "主键") @Schema(description = "主键")
private Long id; private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键") @Schema(description = "条款主键")
private Long formulaId; private Long formulaId;
@@ -36,27 +34,30 @@ public class ContractGradeRespDTO {
@Schema(description = "品位下限") @Schema(description = "品位下限")
private BigDecimal gradeDown; private BigDecimal gradeDown;
@Schema(description = "是否包含上限;包含则是大于等于,不包含则是大于") @Schema(description = "区间方式(字典:STLM_RNG_WY)")
private String isInUp; private String rangeWay;
@Schema(description = "是否包含下限;包含则是小于等于,不包含则是小于") @Schema(description = "默认计价品位")
private String isInDown;
@Schema(description = "默认计价品位;计价方式为加时,默认为为下限,计价方式为减时,默认为为上限,可手动填写")
private BigDecimal gradeDefault; private BigDecimal gradeDefault;
@Schema(description = "系数;计价类型为阶梯价使用,标识没上升多少系数进行加款还是减款") @Schema(description = "系数")
private BigDecimal settlementCoefficient; private BigDecimal settlementCoefficient;
@Schema(description = "不足系数值按比例计算") @Schema(description = "是否比例计算(字典:ERP_CTRT_YN)")
private String useCoefficient; private String useCoefficient;
@Schema(description = "计价类型") @Schema(description = "计价类型(字典:STLM_GRD_TP)")
private String priceType; private String priceType;
@Schema(description = "是否省内") @Schema(description = "是否省内(字典:ERP_CTRT_YN)")
private String inState; private String inState;
@Schema(description = "等级单价") @Schema(description = "等级单价", example = "3565")
private BigDecimal unitPrice; private BigDecimal unitPrice;
@Schema(description = "创建时间")
private LocalDateTime createTime;
@Schema(description = "数据项类型(字典:GRD_CFG_TP)")
private String configType;
} }

View File

@@ -13,9 +13,6 @@ public class ContractPriceRespDTO {
@Schema(description = "主键") @Schema(description = "主键")
private Long id; private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键") @Schema(description = "条款主键")
private Long formulaId; private Long formulaId;

View File

@@ -19,7 +19,6 @@ public class ContractApiImpl implements ContractApi {
@Override @Override
public List<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) { public List<ContractFormulaRespDTO> getFormulas(String contractPaperNumber) {
System.out.println("contract feign" + contractPaperNumber); return contractService.getFormulasByPaperNumber(contractPaperNumber);
return List.of();
} }
} }

View File

@@ -1,6 +1,5 @@
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract; package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -12,7 +11,6 @@ import java.time.LocalDateTime;
public class GradeRespVO { public class GradeRespVO {
@Schema(description = "主键") @Schema(description = "主键")
@ExcelProperty("主键")
private Long id; private Long id;
@Schema(description = "条款主键") @Schema(description = "条款主键")

View File

@@ -12,9 +12,6 @@ public class PriceRespVO {
@Schema(description = "主键") @Schema(description = "主键")
private Long id; private Long id;
@Schema(description = "配置主键")
private Long parameterId;
@Schema(description = "条款主键") @Schema(description = "条款主键")
private Long formulaId; private Long formulaId;

View File

@@ -12,9 +12,6 @@ public class PriceSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654") @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13654")
private Long id; private Long id;
@Schema(description = "配置主键", example = "1590")
private Long parameterId;
@Schema(description = "条款主键", example = "24677") @Schema(description = "条款主键", example = "24677")
private Long formulaId; private Long formulaId;

View File

@@ -30,11 +30,6 @@ public class ContractPriceDO extends BusinessBaseDO {
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
private Long id; private Long id;
/**
* 配置主键
*/
@TableField("PRM_ID")
private Long parameterId;
/** /**
* 条款主键 * 条款主键
*/ */

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.contractorder.service.contract; package com.zt.plat.module.contractorder.service.contract;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.contractorder.api.dto.ContractFormulaRespDTO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*; import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO; import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -85,4 +86,12 @@ public interface ContractService {
* @return 结算公式列表 * @return 结算公式列表
*/ */
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO); List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
/**
* 通过合同编号获取对应的结算条款数据
*
* @param contractPaperNumber 合同编号
* @return 结算条款数据
*/
List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber);
} }

View File

@@ -17,6 +17,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi;
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO; import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
import com.zt.plat.module.contractorder.api.dto.*;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*; import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.*; import com.zt.plat.module.contractorder.dal.dataobject.contract.*;
import com.zt.plat.module.contractorder.dal.mysql.contract.*; import com.zt.plat.module.contractorder.dal.mysql.contract.*;
@@ -727,6 +728,60 @@ public class ContractServiceImpl implements ContractService {
return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName()); return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
} }
@Override
public List<ContractFormulaRespDTO> getFormulasByPaperNumber(String contractPaperNumber) {
// 通过合同编号查询合同信息
ContractMainDO contractMainDO = contractMainMapper
.selectOne(TableFieldConstants.BSE_CTRT_MAIN_CTRT_PPR_NUM, contractPaperNumber);
// 合同不存在
if (contractMainDO == null) {
throw exception(CONTRACT_NOT_EXISTS);
}
// 合同ID
Long contractId = contractMainDO.getId();
// 查询并设置价款结算条款
List<ContractFormulaRespDTO> formulas = new ArrayList<>();
List<ContractFormulaDO> formulaDOS = contractFormulaMapper
.selectList(TableFieldConstants.BSE_CTRT_FMU_CTRT_ID, contractId);
if (formulaDOS != null && !formulaDOS.isEmpty()) {
formulas = BeanUtils.toBean(formulaDOS, ContractFormulaRespDTO.class);
formulas.forEach(formula -> {
// 查询并设置基础系数配置
List<ContractCoefficientDO> coefficientDOS = contractCoefficientMapper
.selectList(TableFieldConstants.BSE_CTRT_COEF_FMU_ID, formula.getId());
if (coefficientDOS != null && !coefficientDOS.isEmpty()) {
formula.setCoefficients(BeanUtils.toBean(coefficientDOS, ContractCoefficientRespDTO.class));
}
// 查询并设置品位等级价配置
List<ContractGradeDO> gradeDOS = contractGradeMapper
.selectList(TableFieldConstants.BSE_CTRT_GRD_FMU_ID, formula.getId());
if (gradeDOS != null && !gradeDOS.isEmpty()) {
formula.setGrades(BeanUtils.toBean(gradeDOS, ContractGradeRespDTO.class));
}
// 查询并设置调整价配置
List<ContractDeductDO> deductDOS = contractDeductMapper
.selectList(TableFieldConstants.BSE_CTRT_DDCT_FMU_ID, formula.getId());
if (deductDOS != null && !deductDOS.isEmpty()) {
formula.setDeducts(BeanUtils.toBean(deductDOS, ContractDeductRespDTO.class));
}
// 查询并设置市场价配置
List<ContractPriceDO> priceDOS = contractPriceMapper
.selectList(TableFieldConstants.BSE_CTRT_PRC_FMU_ID, formula.getId());
if (priceDOS != null && !priceDOS.isEmpty()) {
formula.setPrices(BeanUtils.toBean(priceDOS, ContractPriceRespDTO.class));
}
});
}
return formulas;
}
/** /**
* 校验合同内容 * 校验合同内容
* *

View File

@@ -1,15 +1,18 @@
package com.zt.plat.module.erp.api; package com.zt.plat.module.erp.api;
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO; import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
import com.zt.plat.module.erp.enums.ApiConstants; import com.zt.plat.module.erp.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
@FeignClient(name = ApiConstants.NAME) @FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - ERP") @Tag(name = "RPC 服务 - ERP")
@@ -21,4 +24,8 @@ public interface ErpExternalApi {
@Operation(summary = "erp数据提交") @Operation(summary = "erp数据提交")
HashMap<String, String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO); HashMap<String, String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO);
@GetMapping(PREFIX + "/query")
@Operation(summary = "erp数据查询")
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
} }

View File

@@ -0,0 +1,21 @@
package com.zt.plat.module.erp.api.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Map;
@Schema(description = "RPC 服务 - 查询 ERP DTO")
@Data
public class ErpQueryReqDTO {
/**
* 调用ERP接口查询erp数据
*
* 请求参数说明:
* "funcnr": 接口编号必须参见RFC功能列表可调用接口编号范围001-021
* "req": {具体参数参见RFC功能列表}
*/
private String funcnr;
private Map<String, Object> req;
}

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.erp.api; package com.zt.plat.module.erp.api;
import com.zt.plat.module.erp.api.dto.ErpQueryReqDTO;
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO; import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
import com.zt.plat.module.erp.utils.ErpConfig; import com.zt.plat.module.erp.utils.ErpConfig;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -7,6 +8,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
/** /**
* ERP Api 实现类 * ERP Api 实现类
@@ -25,4 +27,11 @@ public class ErpExternalApiImpl implements ErpExternalApi {
public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) { public HashMap<String, String> submitDataToErp(ErpSubmitReqDTO reqDTO) {
return erpConfig.pushDataToErp(reqDTO); return erpConfig.pushDataToErp(reqDTO);
} }
@Override
public HashMap<String, Object> queryDataToErp(ErpQueryReqDTO reqDTO) {
String funcnr = reqDTO.getFuncnr();
Map<String, Object> req = new HashMap<>();
return erpConfig.fetchDataFromERP(funcnr, req);
}
} }

View File

@@ -16,10 +16,10 @@ public class ErpFactoryPageReqVO extends PageParam {
private String number; private String number;
@Schema(description = "公司编号") @Schema(description = "公司编号")
private String companyNumber; private String erpCompanyNumber;
@Schema(description = "公司名称") @Schema(description = "公司名称")
private String companyName; private String erpCompanyName;
@Schema(description = "类型") @Schema(description = "类型")
private String type; private String type;

View File

@@ -23,7 +23,10 @@ public class ErpFactoryRespVO {
private String number; private String number;
@Schema(description = "公司编号") @Schema(description = "公司编号")
private String companyNumber; private String erpCompanyNumber;
@Schema(description = "公司编号")
private String erpCompanyName;
@Schema(description = "类型") @Schema(description = "类型")
private String type; private String type;

View File

@@ -20,10 +20,7 @@ public class ErpFactorySaveReqVO {
private String number; private String number;
@Schema(description = "公司编号") @Schema(description = "公司编号")
private String companyNumber; private String erpCompanyNumber;
@Schema(description = "公司编号")
private String companyName;
@Schema(description = "类型") @Schema(description = "类型")
private String type; private String type;

View File

@@ -2,6 +2,7 @@ package com.zt.plat.module.erp.controller.admin.erp.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -18,6 +19,9 @@ public class ErpWarehouseRespVO {
@ExcelProperty("工厂编码;将查询参数存入") @ExcelProperty("工厂编码;将查询参数存入")
private String factoryNumber; private String factoryNumber;
@Schema(description = "工厂名称")
private String factoryName;
@Schema(description = "库位描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三") @Schema(description = "库位描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@ExcelProperty("库位描述") @ExcelProperty("库位描述")
private String name; private String name;

View File

@@ -41,13 +41,13 @@ public class ErpFactoryDO extends BusinessBaseDO {
* 公司编号 * 公司编号
*/ */
@TableField("CPN_ID") @TableField("CPN_ID")
private String companyNumber; private String erpCompanyNumber;
/** /**
* 公司名称 * 公司名称
*/ */
@TableField(exist = false) @TableField(exist = false)
private String companyName; private String erpCompanyName;
/** /**
* 类型 * 类型

View File

@@ -220,7 +220,7 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
ErpFactoryDO DO = new ErpFactoryDO(); ErpFactoryDO DO = new ErpFactoryDO();
DO.setName(dataJson.getString("NAME1")); DO.setName(dataJson.getString("NAME1"));
DO.setNumber(number); DO.setNumber(number);
DO.setCompanyNumber(dataJson.getString("BUKRS")); DO.setErpCompanyNumber(dataJson.getString("BUKRS"));
DO.setType("ERP"); DO.setType("ERP");
if (numbers.get(number)!=null) { if (numbers.get(number)!=null) {
// 更新 // 更新

View File

@@ -5,10 +5,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO; import com.zt.plat.module.erp.api.dto.ErpSubmitReqDTO;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity; import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@@ -16,7 +14,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*; import static com.zt.plat.module.erp.enums.ErrorCodeConstants.*;
@@ -25,7 +22,6 @@ import static dm.jdbc.util.DriverUtil.log;
@Configuration @Configuration
public class ErpConfig { public class ErpConfig {
@Value("${erp.address}") @Value("${erp.address}")
private String erpAddress; private String erpAddress;

View File

@@ -10,23 +10,31 @@
--> -->
<select id="getPageByReq" resultType="com.zt.plat.module.erp.dal.dataobject.erp.ErpFactoryDO"> <select id="getPageByReq" resultType="com.zt.plat.module.erp.dal.dataobject.erp.ErpFactoryDO">
select f.*, c.NAME as companyName select f.id,
from sply_erp_fact f left join sply_erp_company c on f.CPN_ID = c.NUM; f.name as name,
f.NUM as number,
f.CPN_ID as erpCompanyNumber,
f.TP as type,
f.REL_NAME as relName,
f.REL_NUM as relnumber,
f.IS_ENB as isEnable,
c.NAME as erpCompanyName
from sply_erp_fact f left join sply_erp_cpn c on f.CPN_ID = c.NUM
where f.DELETED = 0 where f.DELETED = 0
<if test="reqVO.name != null"> <if test="name != null">
and f.NAME like concat('%', #{reqVO.name}, '%') and f.NAME like concat('%', #{name}, '%')
</if> </if>
<if test="reqVO.number != null"> <if test="number != null">
and f.NUM like concat('%', #{reqVO.number}, '%') and f.NUM like concat('%', #{number}, '%')
</if> </if>
<if test="reqVO.companyNumber != null"> <if test="erpCompanyNumber != null">
and f.CPN_ID = like concat('%', #{reqVO.companyNumber}, '%') and f.CPN_ID = like concat('%', #{erpCompanyNumber}, '%')
</if> </if>
<if test="reqVO.companyName != null"> <if test="erpCompanyName != null">
and c.NAME like concat('%', #{reqVO.companyName}, '%') and c.NAME like concat('%', #{erpCompanyName}, '%')
</if> </if>
<if test="reqVO.type != null"> <if test="type != null">
and f.TP like concat('%', #{reqVO.type}, '%') and f.TP like concat('%', #{type}, '%')
</if> </if>
</select> </select>

View File

@@ -14,23 +14,31 @@
</select> </select>
<select id="getPageByReq" resultType="com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO"> <select id="getPageByReq" resultType="com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO">
select f.*, c.NAME as f select f.id,
f.name as name,
f.NUM as number,
f.TP as type,
f.REL_NAME as relName,
f.REL_NUM as relnumber,
f.IS_ENB as isEnable,
f.FACT_NUM as factoryNumber,
c.NAME as factoryName
from sply_erp_wrh f left join sply_erp_fact c on f.FACT_NUM = c.NUM; from sply_erp_wrh f left join sply_erp_fact c on f.FACT_NUM = c.NUM;
where f.DELETED = 0 where f.DELETED = 0
<if test="reqVO.name != null"> <if test="name != null">
and f.NAME like concat('%', #{reqVO.name}, '%') and f.NAME like concat('%', #{name}, '%')
</if> </if>
<if test="reqVO.number != null"> <if test="number != null">
and f.NUM like concat('%', #{reqVO.number}, '%') and f.NUM like concat('%', #{number}, '%')
</if> </if>
<if test="reqVO.factoryNumber != null"> <if test="factoryNumber != null">
and f.FACT_NUM = like concat('%', #{factoryNumber}, '%') and f.FACT_NUM = like concat('%', #{factoryNumber}, '%')
</if> </if>
<if test="reqVO.factoryName != null"> <if test="factoryName != null">
and c.NAME like concat('%', #{factoryName}, '%') and c.NAME like concat('%', #{factoryName}, '%')
</if> </if>
<if test="reqVO.type != null"> <if test="type != null">
and f.TP like concat('%', #{reqVO.type}, '%') and f.TP like concat('%', #{type}, '%')
</if> </if>
</select> </select>
</mapper> </mapper>