登录科技考勤action修改
parent
6bbb49f0a1
commit
341fa9e043
|
@ -14,7 +14,7 @@ import java.util.function.Consumer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>自定义请求条件</h1>
|
* <h1>自定义请求</h1>
|
||||||
*
|
*
|
||||||
* @author xuanran.wang
|
* @author xuanran.wang
|
||||||
* @date 2023/4/6 19:34
|
* @date 2023/4/6 19:34
|
||||||
|
@ -24,25 +24,79 @@ import java.util.function.Consumer;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class CusRestTemplateResponse {
|
public class CusRestTemplateResponse {
|
||||||
|
/**
|
||||||
|
* <h2>响应对象</h2>
|
||||||
|
**/
|
||||||
private ResponeVo vo;
|
private ResponeVo vo;
|
||||||
|
/**
|
||||||
|
* <h2>请求参数</h2>
|
||||||
|
**/
|
||||||
private Object requestParam;
|
private Object requestParam;
|
||||||
|
/**
|
||||||
|
* <h2>接口成功字段标识</h2>
|
||||||
|
**/
|
||||||
private String successField;
|
private String successField;
|
||||||
|
/**
|
||||||
|
* <h2>接口请求成功时响应值</h2>
|
||||||
|
**/
|
||||||
private Object successValue;
|
private Object successValue;
|
||||||
|
/**
|
||||||
|
* <h2>接口响应错误字段名</h2>
|
||||||
|
**/
|
||||||
private String errorMsg;
|
private String errorMsg;
|
||||||
|
/**
|
||||||
|
* <h2>data字段路径</h2>
|
||||||
|
**/
|
||||||
private String dataKey;
|
private String dataKey;
|
||||||
|
/**
|
||||||
|
* <h2>接口响应信息</h2>
|
||||||
|
**/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
/**
|
||||||
|
* <h2>接口响应map</h2>
|
||||||
|
**/
|
||||||
private Map<String, Object> response;
|
private Map<String, Object> response;
|
||||||
|
/**
|
||||||
|
* <h2>解密接口 如果接口有加密可自行实现解密接口</h2>
|
||||||
|
**/
|
||||||
private CusDataDecipher cusDataDecipher;
|
private CusDataDecipher cusDataDecipher;
|
||||||
|
/**
|
||||||
|
* <h2>请求url</h2>
|
||||||
|
**/
|
||||||
private String url;
|
private String url;
|
||||||
|
/**
|
||||||
|
* <h2>运行异常</h2>
|
||||||
|
**/
|
||||||
private Exception exception;
|
private Exception exception;
|
||||||
|
/**
|
||||||
|
* <h2>请求完是否执行响应验证 默认做校验</h2>
|
||||||
|
**/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private boolean checkResponse = true;
|
private boolean checkResponse = true;
|
||||||
|
/**
|
||||||
|
* <h2>错误回调</h2>
|
||||||
|
**/
|
||||||
private BiConsumer<Exception, CusApiLogBaseDto> errorCallBack;
|
private BiConsumer<Exception, CusApiLogBaseDto> errorCallBack;
|
||||||
|
/**
|
||||||
|
* <h2>是否将日志写入建模 默认不写入</h2>
|
||||||
|
**/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private boolean writeLog = false;
|
private boolean writeLog = false;
|
||||||
|
/**
|
||||||
|
* <h2>日志实体类</h2>
|
||||||
|
**/
|
||||||
private CusApiLogBaseDto logDto;
|
private CusApiLogBaseDto logDto;
|
||||||
|
/**
|
||||||
|
* <h2>日志模块id</h2>
|
||||||
|
**/
|
||||||
private String logModelId;
|
private String logModelId;
|
||||||
|
/**
|
||||||
|
* <h2>成功回调</h2>
|
||||||
|
**/
|
||||||
private Consumer<CusApiLogBaseDto> successCallBack;
|
private Consumer<CusApiLogBaseDto> successCallBack;
|
||||||
|
/**
|
||||||
|
* <h2>是否异步写日志 默认异步</h2>
|
||||||
|
**/
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private boolean asyncWriteLog = true;
|
private boolean asyncWriteLog = true;
|
||||||
|
|
||||||
|
|
|
@ -163,9 +163,9 @@ public class KqFreezeVacationAction extends BaseBean implements Action {
|
||||||
RecordSet tempRs = new RecordSet();
|
RecordSet tempRs = new RecordSet();
|
||||||
String sql = "select duration from " + billTable + " where requestid = ?";
|
String sql = "select duration from " + billTable + " where requestid = ?";
|
||||||
if(CollectionUtils.isNotEmpty(splitBeans)){
|
if(CollectionUtils.isNotEmpty(splitBeans)){
|
||||||
if (tempRs.execute(sql, requestId) && tempRs.next()) {
|
if (tempRs.executeQuery(sql, requestId) && tempRs.next()) {
|
||||||
for (SplitBean splitBean : splitBeans) {
|
for (SplitBean splitBean : splitBeans) {
|
||||||
String workflowDuration = Util.null2String(tempRs.getString(1));
|
String workflowDuration = Util.null2String(tempRs.getString("duration"));
|
||||||
if(StringUtils.isBlank(workflowDuration)){
|
if(StringUtils.isBlank(workflowDuration)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ public class CusApiLogUtilTest extends BaseTest {
|
||||||
.successField("code")
|
.successField("code")
|
||||||
.successValue(0)
|
.successValue(0)
|
||||||
.errorMsg("msg")
|
.errorMsg("msg")
|
||||||
|
.writeLog(true)
|
||||||
|
.asyncWriteLog(false)
|
||||||
.logDto(demoDto)
|
.logDto(demoDto)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue