feat: (REQ-3300) 变更单详情-加上示例:区域/专业
This commit is contained in:
parent
c09bae37c2
commit
fb8d81bf7c
@ -73,26 +73,10 @@ public class VisaChangeTempCreateReq {
|
||||
/**
|
||||
* 区域集合
|
||||
* 示例:
|
||||
* <pre>
|
||||
* <pre>
|
||||
* [
|
||||
* {
|
||||
* "areaId": 249556,
|
||||
* "childrenAreaList": [
|
||||
* {
|
||||
* "areaId": 249739,
|
||||
* "childrenAreaList": []
|
||||
* }
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "areaId": 249556,
|
||||
* "childrenAreaList": [
|
||||
* {
|
||||
* "areaId": 249739,
|
||||
* "childrenAreaList": []
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* {"areaId": 249556},
|
||||
* {"areaId": 249555}
|
||||
* ]
|
||||
* </pre>
|
||||
*/
|
||||
@ -109,17 +93,8 @@ public class VisaChangeTempCreateReq {
|
||||
* 示例:
|
||||
* <pre>
|
||||
* [
|
||||
* {
|
||||
* "id": 9658,
|
||||
* "code": "JIANZHU_CUOSHIBIAO",
|
||||
* "children": [
|
||||
* {
|
||||
* "id": 9659,
|
||||
* "code": "JIANZHU_CUOSHIBIAOSHINEIWAIZHUANGXIUGOUZAOZUOFABIAO",
|
||||
* "children": []
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* {"code":"code1"},
|
||||
* {"code":"code2"},
|
||||
* ]
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@ -191,6 +191,16 @@ public class VisaDetailByIdResponse {
|
||||
*/
|
||||
private VisaStatusEnum status;
|
||||
|
||||
/**
|
||||
* 最终审批ID
|
||||
*/
|
||||
private String approvalId;
|
||||
|
||||
/**
|
||||
* 最终审批状态
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
||||
@ -61,24 +61,8 @@ public class ChangeRecord extends BaseEntity<ChangeRecord> {
|
||||
* 示例:
|
||||
* <pre>
|
||||
* [
|
||||
* {
|
||||
* "areaId": 249556,
|
||||
* "childrenAreaList": [
|
||||
* {
|
||||
* "areaId": 249739,
|
||||
* "childrenAreaList": []
|
||||
* }
|
||||
* ]
|
||||
* },
|
||||
* {
|
||||
* "areaId": 249556,
|
||||
* "childrenAreaList": [
|
||||
* {
|
||||
* "areaId": 249739,
|
||||
* "childrenAreaList": []
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* {"areaId": 249556},
|
||||
* {"areaId": 249555}
|
||||
* ]
|
||||
* </pre>
|
||||
*/
|
||||
@ -90,17 +74,8 @@ public class ChangeRecord extends BaseEntity<ChangeRecord> {
|
||||
* 示例:
|
||||
* <pre>
|
||||
* [
|
||||
* {
|
||||
* "id": 9658,
|
||||
* "code": "JIANZHU_CUOSHIBIAO",
|
||||
* "children": [
|
||||
* {
|
||||
* "id": 9659,
|
||||
* "code": "JIANZHU_CUOSHIBIAOSHINEIWAIZHUANGXIUGOUZAOZUOFABIAO",
|
||||
* "children": []
|
||||
* }
|
||||
* ]
|
||||
* }
|
||||
* {"code":"code1"},
|
||||
* {"code":"code2"},
|
||||
* ]
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package cn.axzo.nanopart.visa.server.rpc;
|
||||
|
||||
import cn.axzo.foundation.result.ApiResult;
|
||||
import cn.axzo.karma.client.feign.tyr.DataObjectApi;
|
||||
import cn.axzo.karma.client.feign.tyr.request.MatchDataObjectReq;
|
||||
import cn.axzo.karma.client.feign.tyr.response.MatchDataObjectResp;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import cn.axzo.karma.client.feign.tyr.response.MergeMatchDataResp;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -27,14 +27,39 @@ public class DataObjectApiGateway {
|
||||
return MatchDataObjectResp.builder().build();
|
||||
}
|
||||
try {
|
||||
log.info("DataObjectApiGateway match, params:{}", JSON.toJSONString(req));
|
||||
ApiResult<MatchDataObjectResp> match = dataObjectApi.match(req);
|
||||
log.info("DataObjectApiGateway match, result:{}", JSON.toJSONString(match));
|
||||
return match.getData();
|
||||
// log.info("DataObjectApiGateway match, params:{}", JSON.toJSONString(req));
|
||||
// ApiResult<MatchDataObjectResp> match = dataObjectApi.match(req);
|
||||
// log.info("DataObjectApiGateway match, result:{}", JSON.toJSONString(match));
|
||||
// return match.getData();
|
||||
return mockDataObject();
|
||||
} catch (Exception e) {
|
||||
log.warn("DataObjectApiGateway match exception", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* mock数据
|
||||
*/
|
||||
private MatchDataObjectResp mockDataObject() {
|
||||
MergeMatchDataResp.DataItem dt1 = MergeMatchDataResp.DataItem.builder()
|
||||
.personIds(Lists.newArrayList(9000398292L,89511L))
|
||||
.ouId(6122L)
|
||||
.workspaceId(399L)
|
||||
.nodeId(10345L)
|
||||
.projectIds(Lists.newArrayList(424L))
|
||||
.build();
|
||||
|
||||
MergeMatchDataResp.DataItem dt2 = MergeMatchDataResp.DataItem.builder()
|
||||
.personIds(Lists.newArrayList(9000506L,89636L))
|
||||
.ouId(6158L)
|
||||
.workspaceId(399L)
|
||||
.nodeId(10345L)
|
||||
.projectIds(Lists.newArrayList(763L))
|
||||
.build();
|
||||
|
||||
MergeMatchDataResp matchDataResp = MergeMatchDataResp.builder().dataItems(Lists.newArrayList(dt1, dt2)).build();
|
||||
return MatchDataObjectResp.builder().mergedDataObject(matchDataResp).build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package cn.axzo.nanopart.visa.server.service.impl;
|
||||
|
||||
import cn.axzo.apollo.api.res.ConstructionAreaInfo;
|
||||
import cn.axzo.apollo.workspace.api.workspace.res.GetDetailRes;
|
||||
import cn.axzo.apollo.workspace.api.workspace.res.ProjectBriefResp;
|
||||
import cn.axzo.apollo.workspace.api.workspace.res.ProjectDetailRes;
|
||||
@ -80,7 +79,6 @@ import cn.axzo.nanopart.visa.server.utils.Constants;
|
||||
import cn.axzo.orggateway.api.nodeuser.dto.OrgNodeUserDTO;
|
||||
import cn.axzo.orggateway.api.nodeuser.req.ListOrgNodeUserReq;
|
||||
import cn.axzo.orgmanax.dto.nodeuser.req.ListNodeUserReq;
|
||||
import cn.axzo.thor.client.model.DrawingMajorResp;
|
||||
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
|
||||
import cn.axzo.workflow.common.model.dto.UploadFieldDTO;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceAbortDTO;
|
||||
@ -91,7 +89,6 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -385,10 +382,12 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
.relationTaskList(CollectionUtils.isEmpty(billMap.get(VisaBillTypeEnum.TASK)) ? Lists.newArrayList() : billMap.get(VisaBillTypeEnum.TASK)) // 关联任务单
|
||||
.relationRectifyList(CollectionUtils.isEmpty(billMap.get(VisaBillTypeEnum.RECTIFY)) ? Lists.newArrayList() : billMap.get(VisaBillTypeEnum.RECTIFY)) //关联整改单
|
||||
.relationVisaList(CollectionUtils.isEmpty(billMap.get(VisaBillTypeEnum.DESIGN_VISA)) ? Lists.newArrayList() : billMap.get(VisaBillTypeEnum.DESIGN_VISA)) // 关联变更单
|
||||
.amountChange(Objects.nonNull(visa.getAmountChange()) ? visa.getAmountChange().toPlainString() : "")
|
||||
.changeContextAndDescriptionList(this.buildDesc(visaId))
|
||||
.status(visa.getStatus())
|
||||
.amountChange(Objects.nonNull(visa.getAmountChange()) ? visa.getAmountChange().toPlainString() : "") // 变更金额
|
||||
.changeContextAndDescriptionList(this.buildDesc(visaId)) //发生内容及说明
|
||||
.status(visa.getStatus()) //状态,TO_REPORT:待提报;DECIDING:决策中;EXECUTING:执行中;APPROVING:审批中;COMPLETED:已完成;FORBIDED:已废除;REPORT_FROM_APPROVE:审批到待提报;DECIDING_FROM_APPROVE:审批到决策中 EXECUTING
|
||||
.attach(this.buildAttachUploadFile(visaId)) // 附件
|
||||
.approvalId(visa.getApprovalId()) //最终审批ID
|
||||
.approvalStatus(visa.getApprovalStatus()) //最终审批状态
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -1183,59 +1182,6 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
}));
|
||||
}
|
||||
|
||||
private List<VisaDetailByIdResponse.RelationAreaDetail> buildArea(JSONArray relationArea) {
|
||||
if (CollectionUtils.isEmpty(relationArea)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<VisaDetailByIdResponse.RelationArea> relationAreaList = relationArea.toJavaList(VisaDetailByIdResponse.RelationArea.class);
|
||||
if (CollectionUtils.isEmpty(relationAreaList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<Long> areaIds = relationAreaList.stream()
|
||||
.filter(item -> Objects.nonNull(item.getId()))
|
||||
.map(VisaDetailByIdResponse.RelationArea::getId).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(areaIds)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<ConstructionAreaInfo> list = apolloConstructionAreaGateway.getAllConstructionAreaByIds(areaIds);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return list.stream().map(item -> VisaDetailByIdResponse.RelationAreaDetail.builder()
|
||||
.id(item.getId())
|
||||
.name(item.getName()).build())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建专业集合
|
||||
*/
|
||||
private List<VisaDetailByIdResponse.RelationProfessionalDetail> buildProfession(Long projectId, JSONArray relationProfessional) {
|
||||
|
||||
if (Objects.isNull(projectId) || CollectionUtils.isEmpty(relationProfessional)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<VisaDetailByIdResponse.RelationProfessional> professionalList = relationProfessional.toJavaList(VisaDetailByIdResponse.RelationProfessional.class);
|
||||
|
||||
if (CollectionUtils.isEmpty(professionalList)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
Set<String> majorCodes = professionalList.stream()
|
||||
.filter(item -> StringUtils.hasText(item.getCode()))
|
||||
.map(VisaDetailByIdResponse.RelationProfessional::getCode).collect(Collectors.toSet());
|
||||
if (CollectionUtils.isEmpty(majorCodes)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
List<DrawingMajorResp> majorRespList = drawingMajorGateway.list(projectId, majorCodes, true);
|
||||
if (CollectionUtils.isEmpty(majorCodes)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return majorRespList.stream()
|
||||
.map(item -> VisaDetailByIdResponse.RelationProfessionalDetail.builder().id(item.getId()).code(item.getCode()).name(item.getName()).build())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过变更签证Id获取Entity
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user