2022-04-14 10:03:49 +08:00
package com.engine.salary.service.impl ;
2022-05-08 12:34:05 +08:00
import com.engine.common.util.ServiceUtil ;
2022-04-14 10:03:49 +08:00
import com.engine.core.impl.Service ;
2022-05-08 12:34:05 +08:00
import com.engine.salary.entity.datacollection.DataCollectionEmployee ;
2022-04-14 20:46:17 +08:00
import com.engine.salary.entity.salaryformula.ExpressFormula ;
2023-03-06 19:45:48 +08:00
import com.engine.salary.entity.salaryformula.param.SalaryFormulaMockParam ;
2022-04-14 20:46:17 +08:00
import com.engine.salary.entity.salaryformula.param.SalaryFormulaSaveParam ;
import com.engine.salary.entity.salaryformula.po.FormulaPO ;
import com.engine.salary.entity.salaryformula.po.FormulaVar ;
2022-04-27 17:20:33 +08:00
import com.engine.salary.enums.salaryformula.ReferenceTypeEnum ;
import com.engine.salary.enums.salaryformula.ReturnTypeEnum ;
import com.engine.salary.enums.salaryformula.ValidateTypeEnum ;
2022-04-14 10:03:49 +08:00
import com.engine.salary.exception.SalaryRunTimeException ;
2023-05-15 09:28:22 +08:00
import com.engine.salary.formlua.entity.standard.ExcelResult ;
2022-04-14 10:03:49 +08:00
import com.engine.salary.mapper.formula.FormulaMapper ;
import com.engine.salary.mapper.formula.FormulaVarMapper ;
2022-05-08 12:34:05 +08:00
import com.engine.salary.service.FormulaRunService ;
2023-04-11 09:56:20 +08:00
import com.engine.salary.service.RemoteExcelService ;
2022-04-14 10:03:49 +08:00
import com.engine.salary.service.SalaryFormulaService ;
2023-08-14 16:38:40 +08:00
import com.engine.salary.util.JsonUtil ;
2022-04-14 10:03:49 +08:00
import com.engine.salary.util.db.MapperProxyFactory ;
2022-04-14 20:46:17 +08:00
import com.engine.salary.util.valid.ValidUtil ;
2022-04-14 10:03:49 +08:00
import com.google.common.collect.Lists ;
2024-01-25 11:38:38 +08:00
import com.engine.salary.util.db.IdGenerator ;
2022-04-14 10:03:49 +08:00
import lombok.extern.slf4j.Slf4j ;
import org.apache.commons.collections4.CollectionUtils ;
2022-05-08 12:34:05 +08:00
import org.apache.commons.lang3.StringUtils ;
2022-04-14 20:46:17 +08:00
import org.apache.commons.lang3.math.NumberUtils ;
2022-04-14 10:03:49 +08:00
import org.springframework.beans.BeanUtils ;
2022-05-08 12:34:05 +08:00
import weaver.hrm.User ;
2022-04-14 10:03:49 +08:00
2022-04-14 20:46:17 +08:00
import java.util.* ;
2023-04-11 09:56:20 +08:00
import java.util.regex.Matcher ;
import java.util.regex.Pattern ;
2022-04-14 10:03:49 +08:00
import java.util.stream.Collectors ;
/ * *
* 薪酬管理公式编辑器
* < p > Copyright : Copyright ( c ) 2022 < / p >
* < p > Company : 泛微软件 < / p >
*
* @author qiantao
* @version 1 . 0
* * /
@Slf4j
public class SalaryFormulaServiceImpl extends Service implements SalaryFormulaService {
private FormulaMapper getFormulaMapper ( ) {
return MapperProxyFactory . getProxy ( FormulaMapper . class ) ;
}
private FormulaVarMapper getFormulaVarMapper ( ) {
return MapperProxyFactory . getProxy ( FormulaVarMapper . class ) ;
}
2022-05-08 12:34:05 +08:00
private FormulaRunService getFormulaRunService ( User user ) {
2023-05-17 17:38:12 +08:00
return ServiceUtil . getService ( FormulaRunServiceImpl . class , user ) ;
2022-05-08 12:34:05 +08:00
}
2022-04-14 10:03:49 +08:00
2023-04-11 09:56:20 +08:00
private RemoteExcelService getRemoteExcelService ( User user ) {
return ServiceUtil . getService ( RemoteExcelServiceImpl . class , user ) ;
}
2022-04-14 10:03:49 +08:00
@Override
public List < ExpressFormula > listExpressFormula ( Collection < Long > formulaIds ) {
formulaIds = formulaIds . stream ( ) . filter ( id - > id ! = null & & id > 0 ) . collect ( Collectors . toList ( ) ) ;
if ( CollectionUtils . isEmpty ( formulaIds ) ) {
return Collections . emptyList ( ) ;
}
try {
// 当前租户自己新建的公式
List < FormulaPO > expressFormulas = getFormulaMapper ( ) . listByIds ( Lists . newArrayList ( formulaIds ) ) ;
2022-05-08 12:34:05 +08:00
return expressFormulas . stream ( ) . filter ( Objects : : nonNull ) . map ( m - > {
ExpressFormula expressFormula = new ExpressFormula ( ) ;
BeanUtils . copyProperties ( m , expressFormula ) ;
List < FormulaVar > formulaVarPOS = getFormulaVarMapper ( ) . listSome ( FormulaVar . builder ( ) . formulaId ( m . getId ( ) ) . build ( ) ) ;
expressFormula . setParameters ( formulaVarPOS ) ;
return expressFormula ;
} ) . collect ( Collectors . toList ( ) ) ;
2022-04-14 10:03:49 +08:00
} catch ( Exception e ) {
log . info ( " 获取公示详情失败 " , e ) ;
throw new SalaryRunTimeException ( " 获取公示详情失败 " ) ;
}
}
@Override
public ExpressFormula getExpressFormula ( Long formulaId ) {
if ( formulaId = = null | | formulaId < = 0 ) {
return null ;
}
try {
// 当前租户自己新建的公式
FormulaPO formulaPO = getFormulaMapper ( ) . getById ( formulaId ) ;
ExpressFormula expressFormula = new ExpressFormula ( ) ;
BeanUtils . copyProperties ( formulaPO , expressFormula ) ;
List < FormulaVar > formulaVarPOS = getFormulaVarMapper ( ) . listSome ( FormulaVar . builder ( ) . formulaId ( formulaId ) . build ( ) ) ;
expressFormula . setParameters ( formulaVarPOS ) ;
return expressFormula ;
} catch ( Exception e ) {
log . info ( " 获取公示详情失败 " , e ) ;
throw new SalaryRunTimeException ( " 获取公示详情失败 " ) ;
}
}
2022-04-14 20:46:17 +08:00
@Override
2022-04-16 16:49:22 +08:00
public FormulaPO save ( SalaryFormulaSaveParam param ) {
2022-04-18 14:45:12 +08:00
ValidUtil . doValidator ( param ) ;
2022-04-27 17:20:33 +08:00
if ( ReferenceTypeEnum . parseByValue ( param . getReferenceType ( ) ) = = null ) {
throw new SalaryRunTimeException ( " 引用类型异常 " ) ;
2022-04-27 13:33:44 +08:00
}
2022-04-27 17:20:33 +08:00
if ( ReturnTypeEnum . parseByValue ( param . getReturnType ( ) ) = = null ) {
throw new SalaryRunTimeException ( " 返回类型异常 " ) ;
}
if ( ValidateTypeEnum . parseByValue ( param . getValidateType ( ) ) = = null ) {
throw new SalaryRunTimeException ( " 校验类型异常 " ) ;
}
2022-12-13 16:13:45 +08:00
2023-05-15 09:28:22 +08:00
//将select因XSS过滤造成的异常字符转换回来
2023-11-07 19:06:43 +08:00
ValidUtil . modify ( param ) ;
2023-05-15 09:28:22 +08:00
2023-04-11 10:48:41 +08:00
// 解析公式中的参数
if ( ReferenceTypeEnum . parseByValue ( param . getReferenceType ( ) ) = = ReferenceTypeEnum . FORMULA ) {
List < FormulaVar > parameterList = parseFormulaParameters ( param . getFormula ( ) , ReferenceTypeEnum . FORMULA ) ;
param . setParameters ( parameterList ) ;
2023-05-15 09:28:22 +08:00
} else if ( ReferenceTypeEnum . parseByValue ( param . getReferenceType ( ) ) = = ReferenceTypeEnum . SQL ) {
2023-04-11 10:48:41 +08:00
List < FormulaVar > parameterList = parseFormulaParameters ( param . getFormula ( ) , ReferenceTypeEnum . SQL ) ;
param . setParameters ( parameterList ) ;
}
int orderIndex = 0 ;
2023-05-15 09:28:22 +08:00
for ( FormulaVar parameter : param . getParameters ( ) ) {
2023-04-11 10:48:41 +08:00
parameter . setOrderIndex ( orderIndex + + ) ;
}
2022-05-07 15:20:39 +08:00
List < FormulaVar > parameters = param . getParameters ( ) ;
2022-06-30 11:10:46 +08:00
//防止参数名和字段名呈现一对多的问题
if ( CollectionUtils . isNotEmpty ( parameters ) ) {
List < String > notRepeatingNameSize = parameters . stream ( ) . map ( FormulaVar : : getFieldName ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
if ( notRepeatingNameSize . size ( ) < parameters . size ( ) ) {
throw new SalaryRunTimeException ( " 公式参数配置异常!参数名称重复,请清空公式内容后,再重新打开编辑 " ) ;
}
}
2022-04-27 17:20:33 +08:00
2022-05-08 12:34:05 +08:00
String extendParam = param . getExtendParam ( ) ;
2022-04-27 17:20:33 +08:00
if ( ReferenceTypeEnum . parseByValue ( param . getReferenceType ( ) ) = = ReferenceTypeEnum . SQL ) {
2022-05-08 12:34:05 +08:00
if ( extendParam = = null ) {
throw new SalaryRunTimeException ( " 未设置SQL返回值 " ) ;
}
String sqlReturnKey = " " ;
try {
2023-08-14 16:38:40 +08:00
Map < String , String > map = JsonUtil . parseMap ( extendParam , String . class ) ;
sqlReturnKey = map . getOrDefault ( " sqlReturnKey " , " " ) ;
} catch ( Exception e ) {
2022-05-08 12:34:05 +08:00
log . error ( " express execute fail, sql extendParam parse fail " , e ) ;
}
if ( StringUtils . isBlank ( sqlReturnKey ) ) {
throw new SalaryRunTimeException ( " 未设置SQL返回值 " ) ;
}
2022-04-27 17:20:33 +08:00
}
2022-05-08 12:34:05 +08:00
//试运行公式
2022-07-25 15:01:10 +08:00
checkRun ( param ) ;
2022-05-08 12:34:05 +08:00
2022-04-14 20:46:17 +08:00
FormulaPO formulaPO = new FormulaPO ( ) ;
2022-04-16 16:49:22 +08:00
String formula = param . getFormula ( ) ;
2022-05-06 13:22:16 +08:00
long formulaId = IdGenerator . generate ( ) ;
formulaPO . setId ( formulaId ) ;
2022-04-14 20:46:17 +08:00
formulaPO . setName ( param . getName ( ) ) ;
formulaPO . setDescription ( param . getDescription ( ) ) ;
formulaPO . setModule ( param . getModule ( ) ) ;
formulaPO . setUseFor ( param . getUseFor ( ) ) ;
formulaPO . setReferenceType ( param . getReferenceType ( ) ) ;
formulaPO . setReturnType ( param . getReturnType ( ) ) ;
formulaPO . setValidateType ( param . getValidateType ( ) ) ;
2022-05-08 12:34:05 +08:00
formulaPO . setExtendParam ( extendParam ) ;
2022-04-16 16:49:22 +08:00
formulaPO . setFormula ( formula ) ;
2022-04-14 20:46:17 +08:00
formulaPO . setDeleteType ( NumberUtils . INTEGER_ZERO ) ;
Date now = new Date ( ) ;
formulaPO . setCreateTime ( now ) ;
formulaPO . setUpdateTime ( now ) ;
formulaPO . setCreator ( ( long ) user . getUID ( ) ) ;
2022-04-18 14:45:12 +08:00
/ *
公式内容以如下显示方式存储
{ 薪资项目 . 输入项1 } + { 薪资项目 . 输入项2 }
转换为实际的运行脚本
* /
String formulaRunScript = formula ;
for ( FormulaVar po : parameters ) {
formulaRunScript = formulaRunScript . replace ( po . getFieldName ( ) , po . getFieldId ( ) ) ;
}
formulaPO . setFormulaRunScript ( formulaRunScript ) ;
2023-04-11 09:56:20 +08:00
2022-04-18 14:45:12 +08:00
getFormulaMapper ( ) . insertIgnoreNull ( formulaPO ) ;
2022-04-16 16:49:22 +08:00
2022-04-18 14:45:12 +08:00
for ( FormulaVar po : parameters ) {
2022-04-24 10:47:38 +08:00
po . setId ( IdGenerator . generate ( ) ) ;
2022-05-06 13:22:16 +08:00
po . setFormulaId ( formulaId ) ;
2022-04-14 20:46:17 +08:00
po . setDeleteType ( NumberUtils . INTEGER_ZERO ) ;
po . setCreator ( ( long ) user . getUID ( ) ) ;
po . setCreateTime ( now ) ;
po . setUpdateTime ( now ) ;
getFormulaVarMapper ( ) . insertIgnoreNull ( po ) ;
2022-04-18 14:45:12 +08:00
}
2022-04-16 16:49:22 +08:00
return formulaPO ;
2022-04-14 20:46:17 +08:00
}
2023-05-15 09:28:22 +08:00
public List < FormulaVar > parseFormulaParameters ( String formula , ReferenceTypeEnum referenceTypeEnum ) {
2023-04-11 09:56:20 +08:00
List < FormulaVar > parameters = new ArrayList < > ( ) ;
// 获取公式中所有可选的变量项目
Map < String , List < FormulaVar > > allParameters = getRemoteExcelService ( user ) . allFieldList ( referenceTypeEnum ) ;
List < String > groups = new ArrayList < > ( allParameters . keySet ( ) ) ;
2023-05-15 09:28:22 +08:00
StringBuilder reg = new StringBuilder ( " ( " ) ;
for ( int i = 0 ; i < groups . size ( ) ; i + + ) {
reg . append ( " \\ { " + groups . get ( i ) + " \\ . " ) ;
if ( i + 1 ! = groups . size ( ) ) {
2023-04-11 09:56:20 +08:00
reg . append ( " | " ) ;
}
}
reg . append ( " ).*?} " ) ;
// 提取公式中所有的变量
Pattern pattern = Pattern . compile ( reg . toString ( ) ) ;
Matcher matcher = pattern . matcher ( formula ) ;
List < String > vars = new ArrayList < > ( ) ;
while ( matcher . find ( ) ) {
String var = matcher . group ( 0 ) . replaceAll ( " \\ { " , " " ) . replaceAll ( " } " , " " ) ;
2023-05-15 09:28:22 +08:00
if ( StringUtils . isNotBlank ( var ) ) {
2023-04-11 09:56:20 +08:00
vars . add ( var ) ;
}
}
2023-04-11 11:43:32 +08:00
// 去重
vars = vars . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ;
2023-05-15 09:28:22 +08:00
for ( String var : vars ) {
2023-04-11 09:56:20 +08:00
String [ ] split = var . split ( " \\ . " ) ;
2023-05-15 09:28:22 +08:00
if ( split . length = = 2 ) {
2023-04-11 09:56:20 +08:00
List < FormulaVar > formulaVars = allParameters . get ( split [ 0 ] ) ;
2023-05-15 09:28:22 +08:00
if ( formulaVars = = null ) {
throw new SalaryRunTimeException ( " 保存失败,公式变量 " + split [ 0 ] + " 输入有误! " ) ;
2023-04-11 09:56:20 +08:00
}
Optional < FormulaVar > field = formulaVars . stream ( ) . filter ( v - > Objects . equals ( v . getName ( ) , split [ 1 ] ) ) . findFirst ( ) ;
2023-05-15 09:28:22 +08:00
if ( field . isPresent ( ) ) {
2023-04-11 09:56:20 +08:00
FormulaVar formulaVar = field . get ( ) ;
2023-05-15 09:28:22 +08:00
String fieldName = " { " + split [ 0 ] + " . " + split [ 1 ] + " } " ;
2023-04-11 09:56:20 +08:00
formulaVar . setFieldName ( fieldName ) ;
parameters . add ( formulaVar ) ;
2023-05-15 09:28:22 +08:00
} else {
throw new SalaryRunTimeException ( " 保存失败,公式变量 " + split [ 0 ] + split [ 1 ] + " 输入有误! " ) ;
2023-04-11 09:56:20 +08:00
}
2023-05-15 09:28:22 +08:00
} else if ( split . length > 2 ) {
2023-04-11 09:56:20 +08:00
// 变量名称中包含.
List < FormulaVar > formulaVars = allParameters . get ( split [ 0 ] ) ;
2023-05-15 09:28:22 +08:00
if ( formulaVars = = null ) {
throw new SalaryRunTimeException ( " 保存失败,公式变量 " + split [ 0 ] + " 输入有误! " ) ;
2023-04-11 09:56:20 +08:00
}
StringBuilder field = new StringBuilder ( " " ) ;
2023-05-15 09:28:22 +08:00
for ( int i = 1 ; i < split . length ; i + + ) {
if ( i ! = 1 ) {
2023-04-11 09:56:20 +08:00
field . append ( " . " ) ;
}
field = field . append ( split [ i ] ) ;
}
String finalField = field . toString ( ) ;
Optional < FormulaVar > optional = formulaVars . stream ( ) . filter ( v - > Objects . equals ( v . getName ( ) , finalField ) ) . findFirst ( ) ;
2023-05-15 09:28:22 +08:00
if ( optional . isPresent ( ) ) {
2023-04-11 09:56:20 +08:00
FormulaVar formulaVar = optional . get ( ) ;
2023-05-15 09:28:22 +08:00
String fieldName = " { " + split [ 0 ] + " . " + field + " } " ;
2023-04-11 09:56:20 +08:00
formulaVar . setFieldName ( fieldName ) ;
parameters . add ( optional . get ( ) ) ;
2023-05-15 09:28:22 +08:00
} else {
throw new SalaryRunTimeException ( " 保存失败,公式变量 " + split [ 0 ] + split [ 1 ] + " 输入有误! " ) ;
2023-04-11 09:56:20 +08:00
}
}
}
return parameters ;
}
2022-05-08 12:34:05 +08:00
/ * *
* 模拟运行公式
*
* @param param
* /
private void checkRun ( SalaryFormulaSaveParam param ) {
//返回类型
String returnType = param . getReturnType ( ) ;
ReturnTypeEnum returnTypeEnum = ReturnTypeEnum . parseByValue ( returnType ) ;
/ *
公式内容以如下显示方式存储
{ 薪资项目 . 输入项1 } + { 薪资项目 . 输入项2 }
转换为实际的运行脚本
* /
String formulaRunScript = param . getFormula ( ) ;
2023-05-15 09:28:22 +08:00
//
// List<FormulaVar> parameters = param.getParameters();
// for (int i = 0; i < parameters.size(); i++) {
// FormulaVar po = parameters.get(i);
// formulaRunScript = formulaRunScript.replace(po.getFieldName(), po.getFieldId());
// po.setContent(String.valueOf(i + 1));
// }
// //验证公式是否可运行
// if (ReferenceTypeEnum.parseByValue(param.getReferenceType()) == ReferenceTypeEnum.FORMULA) {
2023-04-19 19:28:05 +08:00
// ExpressFormula test = ExpressFormula.builder().formulaRunScript(formulaRunScript).extendParam(param.getExtendParam()).referenceType(param.getReferenceType()).build();
2023-05-15 09:28:22 +08:00
// ExcelResult run = getFormulaRunService(user).run(test, parameters, DataCollectionEmployee.builder().employeeId((long) user.getUID()).build());
2023-04-19 19:28:05 +08:00
//
2023-05-15 09:28:22 +08:00
// if (run.isStatus()) {
2023-04-19 19:28:05 +08:00
// //返回结果不是数字
2023-05-15 09:28:22 +08:00
// if (returnTypeEnum == ReturnTypeEnum.NUMBER && !NumberUtils.isCreatable(String.valueOf(run))) {
2023-04-19 19:28:05 +08:00
// throw new SalaryRunTimeException("返回结果不是数值");
// }
2023-05-15 09:28:22 +08:00
// }else {
// throw new SalaryRunTimeException("公式配置异常");
2023-04-19 19:28:05 +08:00
// }
2023-05-15 09:28:22 +08:00
// }
2022-07-25 15:01:10 +08:00
if ( ReferenceTypeEnum . parseByValue ( param . getReferenceType ( ) ) = = ReferenceTypeEnum . SQL ) {
if ( formulaRunScript . contains ( " ; " ) | | formulaRunScript . contains ( " -- " ) ) {
throw new SalaryRunTimeException ( " SQL配置异常,请去除';'或者'--' " ) ;
}
}
2022-05-08 12:34:05 +08:00
}
2022-04-14 20:46:17 +08:00
@Override
2023-03-06 19:45:48 +08:00
public Object mock ( SalaryFormulaMockParam param ) {
2022-04-14 20:46:17 +08:00
2022-12-13 16:13:45 +08:00
ValidUtil . doValidator ( param ) ;
2023-03-06 19:45:48 +08:00
FormulaPO po = getFormulaMapper ( ) . getById ( param . getId ( ) ) ;
2022-12-13 16:13:45 +08:00
//验证公式是否可运行
2023-03-06 19:45:48 +08:00
ExpressFormula test = ExpressFormula . builder ( ) . formulaRunScript ( po . getFormulaRunScript ( ) ) . extendParam ( po . getExtendParam ( ) ) . referenceType ( po . getReferenceType ( ) ) . build ( ) ;
2023-05-15 09:28:22 +08:00
ExcelResult run = getFormulaRunService ( user ) . run ( test , param . getParameters ( ) , DataCollectionEmployee . builder ( ) . employeeId ( ( long ) user . getUID ( ) ) . build ( ) ) ;
if ( run . isStatus ( ) ) {
return run . getData ( ) ;
} else {
return run . getErrorMsg ( ) ;
2022-12-13 16:13:45 +08:00
}
2022-04-14 20:46:17 +08:00
}
2022-11-23 18:30:53 +08:00
@Override
public void initFunction ( ) {
}
2023-02-16 09:16:00 +08:00
@Override
public void deleteNotIn ( List < Long > formulaIds ) {
2023-02-23 14:52:24 +08:00
Date today = new Date ( ) ;
Calendar c = Calendar . getInstance ( ) ;
c . setTime ( today ) ;
c . add ( Calendar . DAY_OF_MONTH , - 1 ) ;
Date yesterday = c . getTime ( ) ;
2023-02-16 09:16:00 +08:00
if ( CollectionUtils . isNotEmpty ( formulaIds ) ) {
2023-02-23 15:48:18 +08:00
List < FormulaPO > allFormula = getFormulaMapper ( ) . listAll ( ) ;
//待删除的公式
List < Long > needDeleteIds = allFormula . stream ( ) . map ( FormulaPO : : getId ) . filter ( id - > ! formulaIds . contains ( id ) ) . collect ( Collectors . toList ( ) ) ;
List < List < Long > > partition = Lists . partition ( needDeleteIds , 1000 ) ;
2023-02-16 09:16:00 +08:00
partition . forEach ( list - > {
2023-02-23 15:48:18 +08:00
getFormulaMapper ( ) . deleteIn ( list , yesterday ) ;
getFormulaVarMapper ( ) . deleteInFormulaIds ( list , yesterday ) ;
2023-02-16 09:16:00 +08:00
} ) ;
}
}
2023-02-16 14:53:03 +08:00
@Override
public List < FormulaVar > listVarByFormulaIds ( List < Long > effectiveFormulaIds ) {
List < FormulaVar > vars = new ArrayList < > ( ) ;
if ( CollectionUtils . isNotEmpty ( effectiveFormulaIds ) ) {
List < List < Long > > partition = Lists . partition ( effectiveFormulaIds , 999 ) ;
partition . forEach ( list - > {
vars . addAll ( getFormulaVarMapper ( ) . listSome ( FormulaVar . builder ( ) . formulaIds ( list ) . build ( ) ) ) ;
} ) ;
}
return vars ;
}
2023-02-17 17:19:17 +08:00
@Override
public List < FormulaVar > listByCode ( String code ) {
return getFormulaVarMapper ( ) . listSome ( FormulaVar . builder ( ) . fieldId ( code ) . build ( ) ) ;
}
@Override
public void updateVar ( FormulaVar formulaVar ) {
getFormulaVarMapper ( ) . updateIgnoreNull ( formulaVar ) ;
}
@Override
public List < FormulaPO > listByIds ( List < Long > formulaIds ) {
2023-02-23 14:52:24 +08:00
if ( CollectionUtils . isEmpty ( formulaIds ) ) {
2023-02-17 17:52:29 +08:00
return new ArrayList < > ( ) ;
}
2023-02-17 17:19:17 +08:00
return getFormulaMapper ( ) . listByIds ( formulaIds ) ;
}
@Override
public void update ( FormulaPO formulaPO ) {
getFormulaMapper ( ) . updateIgnoreNull ( formulaPO ) ;
}
2022-04-14 10:03:49 +08:00
}