apa等级带出
parent
d59ed4f677
commit
1f59f96dac
|
@ -219,7 +219,10 @@ window.workflowCus = Object.assign(window.workflowCus ? window.workflowCus : {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
/* ******************* apa流程通过apa分数字段带出level字段eng ******************* */
|
||||||
|
|
||||||
|
|
||||||
|
/* ******************* apa流程通过apa分数字段带出level字段 ******************* */
|
||||||
$(() => {
|
$(() => {
|
||||||
let config = {
|
let config = {
|
||||||
scoreFiled: "",
|
scoreFiled: "",
|
||||||
|
@ -228,5 +231,4 @@ $(() => {
|
||||||
window.workflowCus.getLevelByScore(config)
|
window.workflowCus.getLevelByScore(config)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
/* ******************* apa流程通过apa分数字段带出level字段eng ******************* */
|
/* ******************* apa流程通过apa分数字段带出level字段eng ******************* */
|
||||||
|
|
|
@ -3466,7 +3466,7 @@ public class Util extends weaver.general.Util {
|
||||||
// "((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
// "((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
||||||
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
|
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
|
||||||
"(?<value>(`([^`]*)`|" +
|
"(?<value>(`([^`]*)`|" +
|
||||||
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
"((#(\\{|sql\\{))?([():/\\-$_*#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
||||||
Pattern compile = Pattern.compile(pattern);
|
Pattern compile = Pattern.compile(pattern);
|
||||||
Matcher matcher = compile.matcher(paramStr);
|
Matcher matcher = compile.matcher(paramStr);
|
||||||
Map<String, String> pathParamMap = new HashMap<>(8);
|
Map<String, String> pathParamMap = new HashMap<>(8);
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.api.youhong.ai.pcn.workflow.doworkflowtomodel.controller;
|
||||||
|
|
||||||
|
import aiyh.utils.ApiResult;
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import com.api.youhong.ai.pcn.workflow.doworkflowtomodel.service.ApaLevelByScoreService;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1>通过apa分数获取apalevel</h1>
|
||||||
|
*
|
||||||
|
* <p>create: 2022-12-13 10:37</p>
|
||||||
|
*
|
||||||
|
* @author youHong.ai
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Path("ayh/workflow/apa")
|
||||||
|
public class ApaLevelByScoreController {
|
||||||
|
|
||||||
|
private final Logger log = Util.getLogger();
|
||||||
|
private final ApaLevelByScoreService service = new ApaLevelByScoreService();
|
||||||
|
|
||||||
|
@Path("/level")
|
||||||
|
@GET
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
public String getLevelByScore(@QueryParam("score") Double score) {
|
||||||
|
try {
|
||||||
|
Integer level = service.getLevelByScore(score);
|
||||||
|
return ApiResult.success(level);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("get level error \n" + Util.getErrString(e));
|
||||||
|
return ApiResult.error("get level error " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.api.youhong.ai.pcn.workflow.doworkflowtomodel.mapper;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.recordset.Select;
|
||||||
|
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1></h1>
|
||||||
|
*
|
||||||
|
* <p>create: 2022-12-13 10:42</p>
|
||||||
|
*
|
||||||
|
* @author youHong.ai
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SqlMapper
|
||||||
|
public interface ApaLevelByScoreMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>通过apa分数查询对应的分数等级</h2>
|
||||||
|
* <i>2022/12/13 10:47</i>
|
||||||
|
* ************************************************************
|
||||||
|
*
|
||||||
|
* @param score 分数
|
||||||
|
* @return Integer 当前分数对应的等级
|
||||||
|
* @author youHong.ai ******************************************
|
||||||
|
*/
|
||||||
|
@Select("select level1 from uf_APAlevel where #{score} between zdf and zgf")
|
||||||
|
Integer selectLevelByScore(Double score);
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.api.youhong.ai.pcn.workflow.doworkflowtomodel.service;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import com.api.youhong.ai.pcn.workflow.doworkflowtomodel.mapper.ApaLevelByScoreMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h1></h1>
|
||||||
|
*
|
||||||
|
* <p>create: 2022-12-13 10:40</p>
|
||||||
|
*
|
||||||
|
* @author youHong.ai
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ApaLevelByScoreService {
|
||||||
|
private final ApaLevelByScoreMapper mapper = Util.getMapper(ApaLevelByScoreMapper.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <h2>根据分数查询等级</h2>
|
||||||
|
* <i>2022/12/13 10:55</i>
|
||||||
|
* ************************************************************
|
||||||
|
*
|
||||||
|
* @param score 分数
|
||||||
|
* @return Integer 等级
|
||||||
|
* @author youHong.ai ******************************************
|
||||||
|
*/
|
||||||
|
public Integer getLevelByScore(Double score) {
|
||||||
|
Integer level = mapper.selectLevelByScore(score);
|
||||||
|
if (level < -1) {
|
||||||
|
throw new CustomerException("query level error, score is [" + score + "");
|
||||||
|
}
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1378,7 +1378,7 @@ public class DealWithMapping extends ToolUtil {
|
||||||
// 最终通过反射调用weaver.aiyh_jitu.pushdata.service.GetAssignProcessorProcessorImpl类,将参数传递给这个类, 使用``包裹的字符串会被解析为一个字符串
|
// 最终通过反射调用weaver.aiyh_jitu.pushdata.service.GetAssignProcessorProcessorImpl类,将参数传递给这个类, 使用``包裹的字符串会被解析为一个字符串
|
||||||
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
|
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
|
||||||
"(?<value>((`([^`]*)`)|" +
|
"(?<value>((`([^`]*)`)|" +
|
||||||
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
"((#(\\{|sql\\{))?([():/\\-$_#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
||||||
Pattern compile = Pattern.compile(pattern);
|
Pattern compile = Pattern.compile(pattern);
|
||||||
Matcher matcher = compile.matcher(paramStr);
|
Matcher matcher = compile.matcher(paramStr);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
|
|
@ -124,6 +124,19 @@ public class TestOrganization extends BaseTest {
|
||||||
//String paramValue = matcher.group("value");
|
//String paramValue = matcher.group("value");
|
||||||
//System.out.println(paramValue);
|
//System.out.println(paramValue);
|
||||||
//}
|
//}
|
||||||
|
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
|
||||||
|
"(?<value>((`([^`]*)`)|" +
|
||||||
|
"((#(\\{|sql\\{))?([():/\\-$_#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
|
||||||
|
Pattern compile = Pattern.compile(pattern);
|
||||||
|
Matcher matcher = compile.matcher(testStr);
|
||||||
|
while (matcher.find()) {
|
||||||
|
String key = matcher.group("key");
|
||||||
|
String paramValue = matcher.group("value");
|
||||||
|
System.out.println(key);
|
||||||
|
System.out.println(paramValue);
|
||||||
|
if (paramValue != null && paramValue.startsWith("`") && paramValue.endsWith("`")) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue