package com.zhgd.xmgl.call; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.http.HttpUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.gexin.fastjson.JSON; import com.gexin.fastjson.TypeReference; import com.google.common.base.Objects; import com.zhgd.xmgl.modules.basicdata.entity.SystemUser; import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper; import com.zhgd.xmgl.modules.dangerous.entity.*; import com.zhgd.xmgl.modules.project.entity.ProgressTask; import com.zhgd.xmgl.modules.project.entity.Project; import com.zhgd.xmgl.modules.project.entity.SjSendProgressTask; import com.zhgd.xmgl.modules.project.mapper.ProjectMapper; import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord; import com.zhgd.xmgl.modules.quality.entity.QualityRectifyRecord; import com.zhgd.xmgl.modules.quality.entity.SjSendQualityInspectionRecord; import com.zhgd.xmgl.modules.quality.entity.SjSendQualityRectifyRecord; import com.zhgd.xmgl.modules.sanjiang.entity.SjImageProgress; import com.zhgd.xmgl.modules.sanjiang.entity.SjSendSjImageProgress; import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper; import com.zhgd.xmgl.util.EnvironmentUtil; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; /** * sj业务中台远程调用 */ @Component @Slf4j public class SanjiangDataCall { @Autowired ProjectMapper projectMapper; @Value("${sj.business.gateway.url:}") String gateWayUrl; @Value("${sj.business.gateway.api.key:}") String apiKey; @Autowired EnvironmentUtil environmentUtil; @Value("${sj.upload.image.url.prefix:}") private String sjUploadUrlPrefix; @Autowired SystemUserMapper systemUserMapper; @Autowired EnterpriseInfoMapper enterpriseInfoMapper; private String apiKeyHeadName = "X-API-KEY"; /** * 判断是sj环境 */ private boolean judgeSjEnvironment() { boolean sjjt = environmentUtil.isSjjt(); return sjjt && StringUtils.isNotBlank(gateWayUrl) && StringUtils.isNotBlank(apiKey); } /** * 添加安全记录 * * @param hiddenDangerInspectRecord */ @Async public void sendAddHiddenDangerInspectionRecord(HiddenDangerInspectRecord hiddenDangerInspectRecord) { if (judgeSjEnvironment()) { log.info("hiddenDangerInspectRecord:{}", hiddenDangerInspectRecord); String uri = "seeyon/safe/add.sj"; String url = gateWayUrl + uri; String body = buildBodyInspectionRecord(hiddenDangerInspectRecord); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } private String buildBodyInspectionRecord(HiddenDangerInspectRecord hi) { SjSendHiddenDangerInspectionRecord inspectionRecord = new SjSendHiddenDangerInspectionRecord(); inspectionRecord.setId(hi.getId()); inspectionRecord.setDutyRegion(hi.getDutyRegion()); inspectionRecord.setHiddenDangerLevel(hi.getHiddenDangerLevel()); inspectionRecord.setRectifyRequire(hi.getRectifyRequire()); inspectionRecord.setDangerDesc(hi.getDangerDesc()); inspectionRecord.setFaultLevelName(getFaultLevelName(hi.getFaultLevel())); inspectionRecord.setInspectTime(hi.getInspectTime()); inspectionRecord.setChangeLimitTime(hi.getChangeLimitTime()); inspectionRecord.setImageUrl(getImageUrl(hi.getImageUrl())); inspectionRecord.setChangeUserName(getUserName(hi.getChangeUser())); inspectionRecord.setRecordTypeName(getRecordTypeName(hi.getRecordType())); inspectionRecord.setReviewUserName(getUserName(hi.getReviewId())); inspectionRecord.setStatusName(getStatusName(hi.getStatus())); inspectionRecord.setEnterpriseName(getEnterpriseName(hi.getEnterpriseSn())); inspectionRecord.setCreateUserName(getUserName(hi.getCreateUser())); inspectionRecord.setDangerTypeName(getDangerTypeName(hi.getCheckItem(), hi.getCheckSubitem())); Project p = getProjectNumber(hi.getProjectSn()); if (p != null) { inspectionRecord.setProjectNumber(p.getProjectNumber()); inspectionRecord.setProjectName(p.getProjectName()); } inspectionRecord.setCheckContent(hi.getCheckContent()); return JSON.toJSONString(inspectionRecord); } private Project getProjectNumber(String projectSn) { if (StringUtils.isBlank(projectSn)) { return null; } Project project = projectMapper.selectOne(new LambdaQueryWrapper().eq(Project::getProjectSn, projectSn)); if (project == null) { throw new RuntimeException("安全记录的项目为空"); } return project; } /** * 获取隐患类型名称 * * @param checkItem * @param checkSubitem * @return */ private String getDangerTypeName(String checkItem, String checkSubitem) { String s = checkItem; String separator = "/"; if (StringUtils.isNotBlank(checkSubitem)) { s += separator; s += checkSubitem; } return s; } private String getEnterpriseName(String enterpriseSn) { if (StringUtils.isBlank(enterpriseSn)) { return null; } EnterpriseInfo ei = enterpriseInfoMapper.selectOne(Wrappers.lambdaQuery().eq(EnterpriseInfo::getEnterpriseSn, enterpriseSn)); return ei.getEnterpriseName(); } /** * 状态,1无需整改,2待整改,3待复查,4合格,5不合格 * * @param status * @return */ private String getStatusName(Integer status) { if (status == null) { return null; } switch (status) { case 1: return "无需整改"; case 2: return "待整改"; case 3: return "待复查"; case 4: return "合格"; case 5: return "不合格"; } return null; } /** * 类型,1隐患问题,2排查记录 * * @param recordType * @return */ private String getRecordTypeName(Integer recordType) { if (recordType == null) { return null; } switch (recordType) { case 1: return "隐患问题"; case 2: return "排查记录"; } return null; } /** * 获取整改人名称 * * @param changeUser * @return */ private String getUserName(Long changeUser) { if (changeUser == null) { return null; } SystemUser systemUser = systemUserMapper.selectById(changeUser); if (systemUser == null) { return null; } return systemUser.getRealName(); } /** * uri添加变成url * * @param imageUrl * @return */ private String getImageUrl(String imageUrl) { String[] split = StringUtils.split(imageUrl, ","); if (split == null) { return null; } ArrayList urlList = new ArrayList<>(); for (int i = 0; i < split.length; i++) { String fileUri = split[i]; if (!StringUtils.startsWith(fileUri, "http")) { fileUri = sjUploadUrlPrefix + fileUri; } urlList.add(fileUri); } return StringUtils.join(urlList, ","); } private String getFaultLevelName(Integer faultLevel) { if (faultLevel == null) { return null; } switch (faultLevel) { case 1: return "一般"; case 2: return "重大"; } return null; } /** * 删除安全记录 * * @param id */ @Async public void sendDeleteHiddenDangerInspectRecord(Long id) { if (judgeSjEnvironment()) { log.info("sendDeleteHiddenDangerInspectRecord的id:{}", id); if (id == null) { return; } String uri = "seeyon/safe/delete.sj"; String url = gateWayUrl + uri; SjSendHiddenDangerInspectionRecord inspectionRecord = new SjSendHiddenDangerInspectionRecord(); inspectionRecord.setId(id); String body = JSON.toJSONString(inspectionRecord); log.info("sendDeleteHiddenDangerInspectRecord,url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("sendDeleteHiddenDangerInspectRecord,httpRs:{}", result); } } /** * 更新安全记录(只更改状态) */ @Async public void sendUpdateHiddenDangerInspectionRecord(HiddenDangerInspectRecord hi) { if (judgeSjEnvironment()) { log.info("sendUpdateHiddenDangerInspectionRecord:{}", hi); String uri = "seeyon/safe/update.sj"; String url = gateWayUrl + uri; SjSendHiddenDangerInspectionRecord inspectionRecord = new SjSendHiddenDangerInspectionRecord(); inspectionRecord.setId(hi.getId()); inspectionRecord.setStatusName(getStatusName(hi.getStatus())); String inspectionRecordBody = JSON.toJSONString(inspectionRecord); log.info("url:{},body:{}", url, inspectionRecordBody); String result = HttpUtil.createPost(url).contentType("application/json").body(inspectionRecordBody).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } /** * 新增安全整改/复查记录 * * @param hdrr * @param hdir */ @Async public void sendAddHiddenDangerRectifyRecord(HiddenDangerRectifyRecord hdrr, HiddenDangerInspectRecord hdir) { if (judgeSjEnvironment()) { log.info("sendAddHiddenDangerRectifyRecord:{}", JSON.toJSONString(hdrr)); /* `type` tinyint(3) DEFAULT NULL COMMENT '类型,1整改记录,2复查记录', `status` tinyint(3) DEFAULT NULL COMMENT '结果,整改时候1未整改,2已整改。复查时候1复查不合格,2复查合格。', */ log.info("getType:{}", hdrr.getType()); if (Objects.equal(hdrr.getType(), 1)) { String uri = "seeyon/safe/addRectification.sj"; String url = gateWayUrl + uri; String body = buildBodySjSendHiddenDangerRectifyRecord(hdrr, hdir); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } else if (Objects.equal(hdrr.getType(), 2)) { String uri = "seeyon/safe/addReview.sj"; String url = gateWayUrl + uri; String body = buildBodySjSendHiddenDangerReviewRecord(hdrr, hdir); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } } /** * 安全的整改记录 * * @param hd * @param hdir * @return */ private String buildBodySjSendHiddenDangerRectifyRecord(HiddenDangerRectifyRecord hd, HiddenDangerInspectRecord hdir) { SjSendHiddenDangerRectifyRecord r = new SjSendHiddenDangerRectifyRecord(); r.setId(hd.getId()); r.setUserName(getUserName(hdir.getChangeUser())); r.setStatusName(getRectifyRecordStatusName(hd.getStatus())); r.setAdditionalRemarks(hd.getAdditionalRemarks()); r.setFileUrl(getImageUrl(hd.getFileUrl())); r.setInspectId(hdir.getId()); r.setCreateTime(hd.getCreateTime()); return JSON.toJSONString(r); } /** * 安全的复查记录 * * @param hd * @param hdir * @return */ private String buildBodySjSendHiddenDangerReviewRecord(HiddenDangerRectifyRecord hd, HiddenDangerInspectRecord hdir) { SjSendHiddenDangerReviewRecord r = new SjSendHiddenDangerReviewRecord(); r.setId(hd.getId()); r.setUserName(getUserName(hdir.getReviewId())); r.setStatusName(getReviewRecordStatusName(hd.getStatus())); r.setAdditionalRemarks(hd.getAdditionalRemarks()); r.setInspectId(hdir.getId()); r.setCreateTime(hd.getCreateTime()); return JSON.toJSONString(r); } /** * 获取安全的整改记录的状态 * * @param status * @return */ private String getRectifyRecordStatusName(Integer status) { if (status == null) { return null; } switch (status) { //1未整改,2已整改 case 1: return "未整改"; case 2: return "已整改"; } return null; } /** * 获取安全的复查记录的状态 * * @param status * @return */ private String getReviewRecordStatusName(Integer status) { if (status == null) { return null; } switch (status) { //1复查不合格,2复查合格。 case 1: return "复查不合格"; case 2: return "复查合格"; } return null; } @Async public void sendAddQualityInspectionRecord(QualityInspectionRecord qir) { if (judgeSjEnvironment()) { log.info("sendAddQualityInspectionRecord:{}", qir); String uri = "seeyon/quality/add.sj"; String url = gateWayUrl + uri; String body = buildBodyQualityInspectionRecord(qir); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } private String buildBodyQualityInspectionRecord(QualityInspectionRecord q) { SjSendQualityInspectionRecord r = new SjSendQualityInspectionRecord(); r.setId(q.getId()); r.setRegionName(q.getRegionName()); r.setDangerItemContent(q.getDangerItemContent()); r.setProblemClassification(q.getDangerItemContent()); r.setDangerDesc(q.getDangerDesc()); r.setRemark(q.getRemark()); r.setAddedDescription(q.getAddedDescription()); r.setLevelName(getQualityLevelName(q.getLevel())); r.setUrgentLevelName(getUrgentLevelName(q.getUrgentLevel())); r.setInspectTime(q.getInspectTime()); r.setEnterpriseName(getEnterpriseName(q.getEnterpriseSn())); r.setChangeLimitTime(q.getChangeLimitTime()); r.setInspectManName(getUserName(q.getInspectManId())); r.setChangeName(getUserName(q.getChangeId())); r.setReviewName(getUserName(q.getReviewId())); r.setVerifyManName(getUserName(q.getVerifyManId())); r.setNotifyPersonName(getUserName(Long.valueOf(q.getNotifyPerson()))); r.setStatusName(getQualityStatusName(q.getStatus())); r.setImageUrl(getQualityImageUrl(q.getImageUrl())); Project p = getProjectNumber(q.getProjectSn()); if (p != null) { r.setProjectNumber(p.getProjectNumber()); r.setProjectName(p.getProjectName()); } return JSON.toJSONString(r); } private String getUrgentLevelName(String urgentLevel) { //紧急程度,1一般,2严重,3紧要 if (StringUtils.isBlank(urgentLevel)) { return null; } switch (urgentLevel) { case "1": return "一般"; case "2": return "严重"; case "3": return "紧要"; } return null; } private String getQualityImageUrl(String imageUrl) { if (StringUtils.isBlank(imageUrl)) { return null; } String[] split = StringUtils.split(imageUrl, ","); //64368d099dd43180920f45a6.png*http://116.169.63.183:7070/image/64368d099dd43180920f45a6.png,64368d119dd43180920f45a7.png*http://116.169.63.183:7070/image/64368d119dd43180920f45a7.png List urlList = Stream.of(split).map(s -> { return StringUtils.substringBefore(s, "*"); }).collect(Collectors.toList()); return getImageUrl(StringUtils.join(urlList, ",")); } private String getQualityStatusName(Integer status) { if (status == null) { return null; } switch (status) { //状态,1无需整改,2待整改,3待复查,4待核验,5合格,6不合格 case 1: return "无需整改"; case 2: return "待整改"; case 3: return "待复查"; case 4: return "待核验"; case 5: return "合格"; case 6: return "不合格"; } return null; } private String getQualityLevelName(Integer level) { if (level == null) { return null; } switch (level) { //1一级,2二级,3三级,4四级 case 1: return "一级"; case 2: return "二级"; case 3: return "三级"; case 4: return "四级"; } return null; } /** * 更新质量记录(只更改状态) * * @param qir */ @Async public void sendUpdateQualityInspectionRecord(QualityInspectionRecord qir) { if (judgeSjEnvironment()) { log.info("sendUpdateQualityInspectionRecord:{}", qir); String uri = "seeyon/quality/update.sj"; String url = gateWayUrl + uri; SjSendQualityInspectionRecord r = new SjSendQualityInspectionRecord(); r.setStatusName(getQualityStatusName(qir.getStatus())); r.setId(qir.getId()); String body = JSON.toJSONString(r); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } /** * sj发送业务中台的质量的整改/复查/核验记录 * * @param qrr */ @Async public void sendAddQualityRectifyRecord(QualityRectifyRecord qrr, QualityInspectionRecord qi) { if (judgeSjEnvironment()) { log.info("sendAddQualityRectifyRecord:{}", qrr); Integer type = qrr.getType(); log.info("getType:{}", type); //类型,1整改记录,2复查记录,3核验记录 String uri = null; if (Objects.equal(type, 1)) { uri = "seeyon/quality/addRectification.sj"; } if (Objects.equal(type, 2)) { uri = "seeyon/quality/addReview.sj"; } if (Objects.equal(type, 3)) { uri = "seeyon/quality/addVerify.sj"; } String url = gateWayUrl + uri; String body = buildBodyQualityThreeRecord(qrr, qi); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } private String buildBodyQualityThreeRecord(QualityRectifyRecord q, QualityInspectionRecord qi) { SjSendQualityRectifyRecord s = new SjSendQualityRectifyRecord(); s.setId(q.getId()); s.setCreateTime(DateUtil.formatDate(DateUtil.parse(q.getCreateTime()))); s.setCreateUserName(getUserName(q.getCreateUser())); s.setStatusName(getQualityThreeRecordStatusName(q.getType(), q.getStatus())); s.setAdditionalRemarks(q.getAdditionalRemarks()); s.setFileUrl(getQualityThreeRecordFileUrl(q.getFileUrl())); s.setQualityId(qi.getId()); return JSON.toJSONString(s); } private String getQualityThreeRecordFileUrl(String fileUrl) { if (StringUtils.isBlank(fileUrl)) { return null; } ArrayList fileUrls = JSON.parseObject(fileUrl, new TypeReference>() { }); List names = fileUrls.stream().map(q -> sjUploadUrlPrefix + q.name).collect(Collectors.toList()); return StringUtils.join(names, ","); } private String getQualityThreeRecordStatusName(Integer type, Integer status) { if (type == null || status == null) { return null; } //1整改记录,2复查记录,3核验记录(整改时候1未整改,2已整改。复查时候1复查不合格,2复查合格。核验时候,1核验不合格,2核验合格) if (type == 1) { switch (status) { case 1: return "未整改"; case 2: return "已整改"; } } else if (type == 2) { switch (status) { case 1: return "复查不合格"; case 2: return "复查合格"; } } else if (type == 3) { switch (status) { case 1: return "核验不合格"; case 2: return "核验合格"; } } return null; } @Async public void sendUpdateProgressTask(ProgressTask pt) { if (judgeSjEnvironment()) { log.info("sendUpdateProgressTask:{}", pt); String uri = "seeyon/progress/update.sj"; String url = gateWayUrl + uri; String body = buildBodyProgressTask(pt); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } private String buildBodyProgressTask(ProgressTask pt) { SjSendProgressTask s = new SjSendProgressTask(); s.setId(pt.getId()); s.setParentId(pt.getParentId()); Project p = getProjectNumber(pt.getProjectSn()); if (p != null) { s.setProjectNumber(p.getProjectNumber()); s.setProjectName(p.getProjectName()); } s.setTaskName(pt.getTaskName()); s.setStartDate(DateUtil.formatDate(pt.getStartDate())); s.setFinishDate(DateUtil.formatDate(pt.getFinishDate())); s.setActualStartDate(DateUtil.formatDate(pt.getActualStartDate())); s.setActualFinishDate(DateUtil.formatDate(pt.getActualFinishDate())); s.setDuration((int) DateUtil.between(pt.getStartDate(), pt.getFinishDate(), DateUnit.DAY)); s.setProgressRatio(pt.getProgressRatio()); s.setDutyUserName(pt.getDutyUserName()); s.setStatusName(getProgressTaskStatusName(pt.getStatus())); s.setRemark(pt.getRemark()); return JSON.toJSONString(s); } private String getProgressTaskStatusName(Integer status) { if (status == null) { return null; } //未开始、进行中、已完成 switch (status) { case 0: return "未开始"; case 1: return "进行中"; case 2: return "已完成"; } return null; } @Async public void sendAddProgressTask(ProgressTask pt) { if (judgeSjEnvironment()) { log.info("sendAddProgressTask:{}", pt); String uri = "seeyon/progress/add.sj"; String url = gateWayUrl + uri; String body = buildBodyProgressTask(pt); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } @Async public void sendAddSjImageProgress(SjImageProgress ip) { if (judgeSjEnvironment()) { log.info("sendAddSjImageProgress:{}", ip); String uri = "seeyon/imageProgress/add.sj"; String url = gateWayUrl + uri; String body = buildBodySjImageProgress(ip); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } private String buildBodySjImageProgress(SjImageProgress ip) { SjSendSjImageProgress sjSendSjImageProgress = new SjSendSjImageProgress(); sjSendSjImageProgress.setId(String.valueOf(ip.getId())); sjSendSjImageProgress.setOperator(ip.getOperator()); sjSendSjImageProgress.setProcessingTime(DateUtil.formatDate(ip.getProcessingTime())); sjSendSjImageProgress.setReportingUnit(ip.getReportingUnit()); sjSendSjImageProgress.setProjectNumber(ip.getProjectNumber()); sjSendSjImageProgress.setProjectProgress(String.valueOf(ip.getProjectProgress())); sjSendSjImageProgress.setProjectName(ip.getProjectName()); sjSendSjImageProgress.setCurrentImageProgress(ip.getCurrentImageProgress()); sjSendSjImageProgress.setMajorDifficultyAndProblem(ip.getMajorDifficultyAndProblem()); sjSendSjImageProgress.setMajorMatter(ip.getMajorMatter()); sjSendSjImageProgress.setImgUrl(getSjImageProgressImgUrl(ip.getImgUrl())); sjSendSjImageProgress.setAttachmentUrl(getSjImageProgressImgUrl(ip.getAttachmentUrl())); return JSON.toJSONString(sjSendSjImageProgress); } private String getSjImageProgressImgUrl(String imgUrl) { if (StringUtils.isBlank(imgUrl)) { return null; } ArrayList fileUrls = JSON.parseObject(imgUrl, new TypeReference>() { }); List names = fileUrls.stream().map(q -> q.url).collect(Collectors.toList()); return StringUtils.join(names, ","); } @Async public void sendUpdateSjImageProgress(SjImageProgress ip) { if (judgeSjEnvironment()) { log.info("sendUpdateSjImageProgress:{}", ip); String uri = "seeyon/imageProgress/update.sj"; String url = gateWayUrl + uri; String body = buildBodySjImageProgress(ip); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } @Async public void sendDeleteSjImageProgress(SjImageProgress ip) { if (judgeSjEnvironment()) { log.info("sendDeleteSjImageProgress:{}", ip); if (ip == null) { return; } String uri = "seeyon/imageProgress/delete.sj"; String url = gateWayUrl + uri; SjSendSjImageProgress inspectionRecord = new SjSendSjImageProgress(); inspectionRecord.setId(String.valueOf(ip.getId())); String body = JSON.toJSONString(inspectionRecord); log.info("url:{},body:{}", url, body); String result = HttpUtil.createPost(url).contentType("application/json").body(body).header(apiKeyHeadName, apiKey).execute().body(); log.info("httpRs:{}", result); } } @Data public static class QualityRectifyRecordFileUrl { private String name; private String url; } }