|
@@ -1,11 +1,15 @@
|
|
package com.rongwei.bscommon.sys.strategy;
|
|
package com.rongwei.bscommon.sys.strategy;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.rongwei.bscommon.sys.service.impl.JtJsglcgqdServiceImpl;
|
|
import com.rongwei.bscommon.sys.utils.AttendanceAssessmentSdk;
|
|
import com.rongwei.bscommon.sys.utils.AttendanceAssessmentSdk;
|
|
-import com.rongwei.bsentity.domain.JtGsjtbsj;
|
|
|
|
|
|
+import com.rongwei.bsentity.domain.JtJsglcgqd;
|
|
import com.rongwei.bsentity.dto.ApiCallDto;
|
|
import com.rongwei.bsentity.dto.ApiCallDto;
|
|
import com.rongwei.bsentity.dto.ApiReturnDto;
|
|
import com.rongwei.bsentity.dto.ApiReturnDto;
|
|
import com.rongwei.bsentity.dto.OrgApiDataConfigDTO;
|
|
import com.rongwei.bsentity.dto.OrgApiDataConfigDTO;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
|
+import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
|
+import com.rongwei.rwcommon.utils.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -13,8 +17,8 @@ import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
-import static com.rongwei.bscommon.sys.utils.ApiDataOrgUtil.assembleApiData;
|
|
|
|
-import static com.rongwei.bscommon.sys.utils.ApiDataOrgUtil.setOrdinaryDate;
|
|
|
|
|
|
+import static com.rongwei.bscommon.sys.utils.ApiDataOrgUtil.*;
|
|
|
|
+import static com.rongwei.bscommon.sys.utils.JXKHConstant.DatePattern.DATE_PATTERN_YMD;
|
|
|
|
|
|
/**
|
|
/**
|
|
* AssembleK34ApiData class
|
|
* AssembleK34ApiData class
|
|
@@ -24,16 +28,35 @@ import static com.rongwei.bscommon.sys.utils.ApiDataOrgUtil.setOrdinaryDate;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class KC141ApiRequestAndProcessing implements ApiRequestAndProcessingStrategy {
|
|
public class KC141ApiRequestAndProcessing implements ApiRequestAndProcessingStrategy {
|
|
|
|
+ private static AttendanceAssessmentSdk attendanceAssessmentSdk;
|
|
|
|
+ private static JtJsglcgqdServiceImpl jtJsglcgqdService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ public void setAttendanceAssessmentSdk(AttendanceAssessmentSdk attendanceAssessmentSdk) {
|
|
|
|
+ KC141ApiRequestAndProcessing.attendanceAssessmentSdk = attendanceAssessmentSdk;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
- private AttendanceAssessmentSdk attendanceAssessmentSdk;
|
|
|
|
|
|
+ public void setJtXcjhqdServiceImpl(JtJsglcgqdServiceImpl jtJsglcgqdService) {
|
|
|
|
+ KC141ApiRequestAndProcessing.jtJsglcgqdService = jtJsglcgqdService;
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Map<String, Object> assembleData(String id,String dataId,String code) {
|
|
|
|
|
|
+ public Map<String, Object> assembleData(String id, String dataId, String code) {
|
|
List<OrgApiDataConfigDTO> assembleData = new ArrayList<>();
|
|
List<OrgApiDataConfigDTO> assembleData = new ArrayList<>();
|
|
-
|
|
|
|
- assembleData.add(setOrdinaryDate("DATAID", JtGsjtbsj::getDataid));
|
|
|
|
-
|
|
|
|
- JtGsjtbsj jtGsjtbsj = new JtGsjtbsj();
|
|
|
|
|
|
+ assembleData.add(setOrdinaryDate("INDEXID", JtJsglcgqd::getIndexid));
|
|
|
|
+ assembleData.add(setOrdinaryDate("DATAID", JtJsglcgqd::getDataid));
|
|
|
|
+ assembleData.add(setOrdinaryDate("xmmc", JtJsglcgqd::getXmmc));
|
|
|
|
+ assembleData.add(setOrdinaryDate("jxmc", JtJsglcgqd::getJxmc));
|
|
|
|
+ assembleData.add(setOrdinaryDate("jxlb", JtJsglcgqd::getJxlb));
|
|
|
|
+ assembleData.add(setOrdinaryDate("jxjb", JtJsglcgqd::getJxjb));
|
|
|
|
+ assembleData.add(setOrdinaryDate("jxdj", JtJsglcgqd::getJxdj));
|
|
|
|
+ assembleData.add(setDatePattern("hjsj", JtJsglcgqd::getHjsj, DATE_PATTERN_YMD));
|
|
|
|
+ assembleData.add(setOrdinaryDate("cyqk", JtJsglcgqd::getCyqk));
|
|
|
|
+ assembleData.add(setFileInfo("mgjxdhjcl", JtJsglcgqd::getMgjxdhjcl, true));
|
|
|
|
+ assembleData.add(setOrdinaryDate("sfzddw", JtJsglcgqd::getSfzddw));
|
|
|
|
+ assembleData.add(setOrdinaryDate("hjpm", JtJsglcgqd::getHjpm));
|
|
|
|
+ JtJsglcgqd jtGsjtbsj = jtJsglcgqdService.getById(id);
|
|
Map<String, Object> stringObjectMap = assembleApiData(jtGsjtbsj, assembleData);
|
|
Map<String, Object> stringObjectMap = assembleApiData(jtGsjtbsj, assembleData);
|
|
return stringObjectMap;
|
|
return stringObjectMap;
|
|
}
|
|
}
|
|
@@ -45,6 +68,13 @@ public class KC141ApiRequestAndProcessing implements ApiRequestAndProcessingStra
|
|
paramVo.setApiCode(code);
|
|
paramVo.setApiCode(code);
|
|
ApiReturnDto apiReturnDto = attendanceAssessmentSdk.apiCall(paramVo);
|
|
ApiReturnDto apiReturnDto = attendanceAssessmentSdk.apiCall(paramVo);
|
|
// 后续逻辑处理
|
|
// 后续逻辑处理
|
|
|
|
+ Map<String, String> apiReturnData = apiReturnDto.getApiReturnData();
|
|
|
|
+ String realDataId = apiReturnData.getOrDefault("DATAID", "").toString();
|
|
|
|
+ if (StringUtils.isBlank(realDataId)) {
|
|
|
|
+ throw new CustomException("接口请求成功,但无法获取dataId");
|
|
|
|
+ }
|
|
|
|
+ jtJsglcgqdService.update(new LambdaUpdateWrapper<JtJsglcgqd>().eq(JtJsglcgqd::getId, id).set(JtJsglcgqd::getDataid, realDataId));
|
|
|
|
+ // 后续逻辑处理
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
}
|
|
}
|