apa等级带出

main
youHong.ai 2022-12-13 15:30:18 +08:00
parent d59ed4f677
commit 1f59f96dac
7 changed files with 118 additions and 3 deletions

View File

@ -219,7 +219,10 @@ window.workflowCus = Object.assign(window.workflowCus ? window.workflowCus : {},
}
}
})
/* ******************* apa流程通过apa分数字段带出level字段eng ******************* */
/* ******************* apa流程通过apa分数字段带出level字段 ******************* */
$(() => {
let config = {
scoreFiled: "",
@ -228,5 +231,4 @@ $(() => {
window.workflowCus.getLevelByScore(config)
})
/* ******************* apa流程通过apa分数字段带出level字段eng ******************* */

View File

@ -3466,7 +3466,7 @@ public class Util extends weaver.general.Util {
// "((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
"(?<value>(`([^`]*)`|" +
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
"((#(\\{|sql\\{))?([():/\\-$_*#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(paramStr);
Map<String, String> pathParamMap = new HashMap<>(8);

View File

@ -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>apaapalevel</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());
}
}
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -1378,7 +1378,7 @@ public class DealWithMapping extends ToolUtil {
// 最终通过反射调用weaver.aiyh_jitu.pushdata.service.GetAssignProcessorProcessorImpl类将参数传递给这个类 使用``包裹的字符串会被解析为一个字符串
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
"(?<value>((`([^`]*)`)|" +
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
"((#(\\{|sql\\{))?([():/\\-$_#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(paramStr);
while (matcher.find()) {

View File

@ -124,6 +124,19 @@ public class TestOrganization extends BaseTest {
//String paramValue = matcher.group("value");
//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("`")) {
}
}
}