|
@@ -10,7 +10,6 @@ import com.rongwei.bsentity.dto.ApiReturnDto;
|
|
|
import com.rongwei.commonservice.service.ApiLogService;
|
|
|
import com.rongwei.commonservice.service.RedisService;
|
|
|
import com.rongwei.commonservice.service.SysConfigService;
|
|
|
-import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommon.utils.Constants;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
@@ -31,6 +30,10 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.BusinessReturnCode.CODE_101;
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.BusinessReturnCode.CODE_103;
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.StandardReturn.*;
|
|
|
+
|
|
|
/**
|
|
|
* 考勤考核系统对接SDK
|
|
|
*/
|
|
@@ -88,11 +91,8 @@ public class AttendanceAssessmentSdk {
|
|
|
// 请求地址
|
|
|
String url = this.clientIp + this.apiVirtualDirectoryMap.get(paramVo.getApiCode());
|
|
|
logger.info("api地址:{}", url);
|
|
|
-
|
|
|
-
|
|
|
ApiReturnDto apiReturnDto = null;
|
|
|
String apiResult = null;
|
|
|
-
|
|
|
/**********************组装请求参数**************************************/
|
|
|
Map<String, Map<String, Object>> postData = new HashMap<>(2);
|
|
|
Map<String, Object> requestData = getRequestData();
|
|
@@ -109,6 +109,28 @@ public class AttendanceAssessmentSdk {
|
|
|
apiResult = HttpRequest.post(url).body(jsonStr).execute().body();
|
|
|
logger.info("接口返回报文:{}", apiResult);
|
|
|
apiReturnDto = JSONUtil.toBean(apiResult, ApiReturnDto.class);
|
|
|
+ switch (apiReturnDto.getApsStat()) {
|
|
|
+ case CODE_001:
|
|
|
+ throw new CustomException("token校验失败");
|
|
|
+ case CODE_002:
|
|
|
+ throw new CustomException("单位编码为空");
|
|
|
+ case CODE_003:
|
|
|
+ throw new CustomException("接口无权限");
|
|
|
+ case CODE_004:
|
|
|
+ throw new CustomException("token过期");
|
|
|
+ case CODE_006:
|
|
|
+ throw new CustomException("数据超过最大处理数量");
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ switch (apiReturnDto.getSuccessCode()) {
|
|
|
+ case CODE_101:
|
|
|
+ throw new CustomException("必填项为空");
|
|
|
+ case CODE_103:
|
|
|
+ throw new CustomException("数据主键或数据编码有误,数据操作失败");
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
logger.error("接口调用异常", e.getMessage());
|