From eae694a6133501047fbd5d4a2e8df3b567fa65ba Mon Sep 17 00:00:00 2001 From: zhanghonghao Date: Thu, 26 Dec 2024 11:36:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(REQ-3282):=20=E8=B0=83=E6=95=B4=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E7=9A=84req/resp=E7=9A=84=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orgmanax/dto/unit/req/CreateUnitReq.java | 3 +- .../dto/unit/resp/CreateUnitResp.java | 6 + .../unit/controller/UnitController.java | 4 +- .../server/unit/service/UnitService.java | 10 +- .../unit/service/dto/CreateUnitReq.java | 196 ----------------- .../unit/service/dto/CreateUnitResp.java | 21 -- .../unit/service/dto/UpdateUnitReq.java | 197 ------------------ .../unit/service/dto/UpdateUnitResp.java | 194 ----------------- .../unit/service/impl/UnitServiceImpl.java | 17 +- 9 files changed, 23 insertions(+), 625 deletions(-) delete mode 100644 orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitReq.java delete mode 100644 orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitResp.java delete mode 100644 orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitReq.java delete mode 100644 orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitResp.java diff --git a/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/req/CreateUnitReq.java b/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/req/CreateUnitReq.java index bfabab6..3bb26b0 100644 --- a/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/req/CreateUnitReq.java +++ b/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/req/CreateUnitReq.java @@ -2,13 +2,11 @@ package cn.axzo.orgmanax.dto.unit.req; import com.alibaba.fastjson.JSONObject; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; import java.io.Serializable; -import java.util.Date; @SuperBuilder @AllArgsConstructor @@ -201,4 +199,5 @@ public class CreateUnitReq implements Serializable { */ private Long operatorId; + private Boolean createWorkspace; } diff --git a/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/resp/CreateUnitResp.java b/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/resp/CreateUnitResp.java index dc020b1..4078c6b 100644 --- a/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/resp/CreateUnitResp.java +++ b/orgmanax-dto/src/main/java/cn/axzo/orgmanax/dto/unit/resp/CreateUnitResp.java @@ -1,9 +1,15 @@ package cn.axzo.orgmanax.dto.unit.resp; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; +@NoArgsConstructor +@AllArgsConstructor +@Builder @Data public class CreateUnitResp implements Serializable { diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/controller/UnitController.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/controller/UnitController.java index aa87f10..7d2790b 100644 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/controller/UnitController.java +++ b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/controller/UnitController.java @@ -28,13 +28,13 @@ public class UnitController implements OrgUnitApi { @Override public ApiResult create(CreateUnitReq req) { - cn.axzo.orgmanax.server.unit.service.dto.CreateUnitResp resp = unitService.create(BeanUtil.copyProperties(req, cn.axzo.orgmanax.server.unit.service.dto.CreateUnitReq.class)); + CreateUnitResp resp = unitService.create(req); return ApiResult.success(BeanUtil.copyProperties(resp, CreateUnitResp.class)); } @Override public ApiResult update(UpdateUnitReq req) { - cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitResp resp = unitService.update(BeanUtil.copyProperties(req, cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitReq.class)); + UpdateUnitResp resp = unitService.update(req); return ApiResult.success(BeanUtil.copyProperties(resp, UpdateUnitResp.class)); } diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/UnitService.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/UnitService.java index 552dd1d..e753c45 100644 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/UnitService.java +++ b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/UnitService.java @@ -1,12 +1,12 @@ package cn.axzo.orgmanax.server.unit.service; import cn.axzo.foundation.page.PageResp; -import cn.axzo.orgmanax.dto.unit.req.ListUnitReq; import cn.axzo.orgmanax.dto.unit.dto.OrgUnitDTO; -import cn.axzo.orgmanax.server.unit.service.dto.CreateUnitReq; -import cn.axzo.orgmanax.server.unit.service.dto.CreateUnitResp; -import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitReq; -import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitResp; +import cn.axzo.orgmanax.dto.unit.req.CreateUnitReq; +import cn.axzo.orgmanax.dto.unit.req.ListUnitReq; +import cn.axzo.orgmanax.dto.unit.req.UpdateUnitReq; +import cn.axzo.orgmanax.dto.unit.resp.CreateUnitResp; +import cn.axzo.orgmanax.dto.unit.resp.UpdateUnitResp; public interface UnitService { diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitReq.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitReq.java deleted file mode 100644 index a70557b..0000000 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitReq.java +++ /dev/null @@ -1,196 +0,0 @@ -package cn.axzo.orgmanax.server.unit.service.dto; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; - -@Data -public class CreateUnitReq { - - /** - * 父单位id - */ - private Long parentId; - - /** - * 单位名称 - */ - private String name; - - /** - * 单位logo url地址 - */ - private String logoUrl; - - /** - * 单位介绍 - */ - private String introduction; - - /** - * 单位类型 1:总包单位 2:建设单位 3:监理单位 4:劳务分包 5:专业分包 6.项目外班组 7.安心筑平台 - */ - private Integer type; - - /** - * 单位性质:0:其他 1:团队 2:企业 3:班组 - */ - private Integer nature; - - /** - * 营业执照号图片url地址 - */ - private String usccPicUrl; - - /** - * 认证公函 - */ - private String certificationLetterUrl; - - /** - * 统一社会信用码 - */ - private String uniformSocialCreditCode; - - /** - * 法人代表姓名 - */ - private String legalName; - - /** - * 法人手机号 - */ - private String legalPhone; - - /** - * 法人代表身份证 - */ - private String legalIdCard; - - /** - * 班组长身份id - */ - private Long identityId; - - /** - * 身份类型 1.无身份 2.班组长 - */ - private Integer identityType; - - /** - * 单位注册地址 - */ - private String registeredAddress; - - /** - * 存续状态 - */ - private String survivalStatus; - - /** - * 省市区区编码,以“/”隔开 - */ - private String areaCode; - - /** - * 省市区名字,以“/”隔开(四川省/成都市/武侯区) - */ - private String areaName; - - /** - * 企业详细地址 - */ - private String address; - - /** - * 企业POI地址 - */ - private String addressPoi; - - /** - * 经纬度,以“/”隔开经度,纬度(124.32421/142.424432) - */ - private String longLat; - - /** - * 官网 - */ - private String website; - - /** - * 状态:0:初始化,10:审核中,20:审核拒绝,30:审核通过,40:未认证,50:已认证 - */ - private Integer status; - - /** - * 是否启用:0禁用,1启用 - */ - private Integer enable; - - /** - * 来源场景:0:其他,1:客户注册,2:平台录入,3:总包创建,4:网络抓取,5:班组创建 - */ - private Integer sceneType; - - /** - * 备注 - */ - private String memo; - - /** - * 扩展字段 - */ - private JSONObject extra; - - /** - * 企业标签1正式企业 2测试企业 - */ - private Integer entTag; - - /** - * 营业期限(纯字符串不做解析) - */ - private String operatingPeriod; - - /** - * 经营范围(纯字符串不做解析) - */ - private String businessScope; - - /** - * 企业邮箱 - */ - private String email; - - /** - * 企业电话 - */ - private String telephone; - - /** - * 省编码 - */ - private String provinceCode; - - /** - * 省份名称 - */ - private String provinceName; - - /** - * 市编码 - */ - private String cityCode; - - /** - * 市名称 - */ - private String cityName; - - /** - * 操作人 - */ - private Long operatorId; - - private Boolean createWorkspace; - -} diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitResp.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitResp.java deleted file mode 100644 index 5d86bad..0000000 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/CreateUnitResp.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.axzo.orgmanax.server.unit.service.dto; - -import com.alibaba.fastjson.JSONObject; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -@NoArgsConstructor -@AllArgsConstructor -@Builder -@Data -public class CreateUnitResp { - - /** - * 单位ID - */ - private Long id; - - -} diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitReq.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitReq.java deleted file mode 100644 index d825920..0000000 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitReq.java +++ /dev/null @@ -1,197 +0,0 @@ -package cn.axzo.orgmanax.server.unit.service.dto; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; - -@Data -public class UpdateUnitReq { - - /** - * id - */ - private Long id; - - /** - * 父单位id - */ - private Long parentId; - - /** - * 单位名称 - */ - private String name; - - /** - * 单位logo url地址 - */ - private String logoUrl; - - /** - * 单位介绍 - */ - private String introduction; - - /** - * 单位类型 1:总包单位 2:建设单位 3:监理单位 4:劳务分包 5:专业分包 6.项目外班组 7.安心筑平台 - */ - private Integer type; - - /** - * 单位性质:0:其他 1:团队 2:企业 3:班组 - */ - private Integer nature; - - /** - * 营业执照号图片url地址 - */ - private String usccPicUrl; - - /** - * 认证公函 - */ - private String certificationLetterUrl; - - /** - * 统一社会信用码 - */ - private String uniformSocialCreditCode; - - /** - * 法人代表姓名 - */ - private String legalName; - - /** - * 法人手机号 - */ - private String legalPhone; - - /** - * 法人代表身份证 - */ - private String legalIdCard; - - /** - * 班组长身份id - */ - private Long identityId; - - /** - * 身份类型 1.无身份 2.班组长 - */ - private Integer identityType; - - /** - * 单位注册地址 - */ - private String registeredAddress; - - /** - * 存续状态 - */ - private String survivalStatus; - - /** - * 省市区区编码,以“/”隔开 - */ - private String areaCode; - - /** - * 省市区名字,以“/”隔开(四川省/成都市/武侯区) - */ - private String areaName; - - /** - * 企业详细地址 - */ - private String address; - - /** - * 企业POI地址 - */ - private String addressPoi; - - /** - * 经纬度,以“/”隔开经度,纬度(124.32421/142.424432) - */ - private String longLat; - - /** - * 官网 - */ - private String website; - - /** - * 状态:0:初始化,10:审核中,20:审核拒绝,30:审核通过,40:未认证,50:已认证 - */ - private Integer status; - - /** - * 是否启用:0禁用,1启用 - */ - private Integer enable; - - /** - * 来源场景:0:其他,1:客户注册,2:平台录入,3:总包创建,4:网络抓取,5:班组创建 - */ - private Integer sceneType; - - /** - * 备注 - */ - private String memo; - - /** - * 扩展字段 - */ - private JSONObject extra; - - /** - * 企业标签1正式企业 2测试企业 - */ - private Integer entTag; - - /** - * 营业期限(纯字符串不做解析) - */ - private String operatingPeriod; - - /** - * 经营范围(纯字符串不做解析) - */ - private String businessScope; - - /** - * 企业邮箱 - */ - private String email; - - /** - * 企业电话 - */ - private String telephone; - - /** - * 省编码 - */ - private String provinceCode; - - /** - * 省份名称 - */ - private String provinceName; - - /** - * 市编码 - */ - private String cityCode; - - /** - * 市名称 - */ - private String cityName; - /** - * 历史平台班组的同步数据,0:还未同步,1:同步完成 - */ - private Integer syncState; -} diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitResp.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitResp.java deleted file mode 100644 index 0d17df6..0000000 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/dto/UpdateUnitResp.java +++ /dev/null @@ -1,194 +0,0 @@ -package cn.axzo.orgmanax.server.unit.service.dto; - -import com.alibaba.fastjson.JSONObject; -import lombok.Data; - -@Data -public class UpdateUnitResp { - - /** - * id - */ - private Long id; - - /** - * 父单位id - */ - private Long parentId; - - /** - * 单位名称 - */ - private String name; - - /** - * 单位logo url地址 - */ - private String logoUrl; - - /** - * 单位介绍 - */ - private String introduction; - - /** - * 单位类型 1:总包单位 2:建设单位 3:监理单位 4:劳务分包 5:专业分包 6.项目外班组 7.安心筑平台 - */ - private Integer type; - - /** - * 单位性质:0:其他 1:团队 2:企业 3:班组 - */ - private Integer nature; - - /** - * 营业执照号图片url地址 - */ - private String usccPicUrl; - - /** - * 认证公函 - */ - private String certificationLetterUrl; - - /** - * 统一社会信用码 - */ - private String uniformSocialCreditCode; - - /** - * 法人代表姓名 - */ - private String legalName; - - /** - * 法人手机号 - */ - private String legalPhone; - - /** - * 法人代表身份证 - */ - private String legalIdCard; - - /** - * 班组长身份id - */ - private Long identityId; - - /** - * 身份类型 1.无身份 2.班组长 - */ - private Integer identityType; - - /** - * 单位注册地址 - */ - private String registeredAddress; - - /** - * 存续状态 - */ - private String survivalStatus; - - /** - * 省市区区编码,以“/”隔开 - */ - private String areaCode; - - /** - * 省市区名字,以“/”隔开(四川省/成都市/武侯区) - */ - private String areaName; - - /** - * 企业详细地址 - */ - private String address; - - /** - * 企业POI地址 - */ - private String addressPoi; - - /** - * 经纬度,以“/”隔开经度,纬度(124.32421/142.424432) - */ - private String longLat; - - /** - * 官网 - */ - private String website; - - /** - * 状态:0:初始化,10:审核中,20:审核拒绝,30:审核通过,40:未认证,50:已认证 - */ - private Integer status; - - /** - * 是否启用:0禁用,1启用 - */ - private Integer enable; - - /** - * 来源场景:0:其他,1:客户注册,2:平台录入,3:总包创建,4:网络抓取,5:班组创建 - */ - private Integer sceneType; - - /** - * 备注 - */ - private String memo; - - /** - * 扩展字段 - */ - private JSONObject extra; - - /** - * 企业标签1正式企业 2测试企业 - */ - private Integer entTag; - - /** - * 营业期限(纯字符串不做解析) - */ - private String operatingPeriod; - - /** - * 经营范围(纯字符串不做解析) - */ - private String businessScope; - - /** - * 企业邮箱 - */ - private String email; - - /** - * 企业电话 - */ - private String telephone; - - /** - * 省编码 - */ - private String provinceCode; - - /** - * 省份名称 - */ - private String provinceName; - - /** - * 市编码 - */ - private String cityCode; - - /** - * 市名称 - */ - private String cityName; - -} diff --git a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/impl/UnitServiceImpl.java b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/impl/UnitServiceImpl.java index c19e398..beaf773 100644 --- a/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/impl/UnitServiceImpl.java +++ b/orgmanax-server/src/main/java/cn/axzo/orgmanax/server/unit/service/impl/UnitServiceImpl.java @@ -1,13 +1,15 @@ package cn.axzo.orgmanax.server.unit.service.impl; -import java.math.BigDecimal; -import java.util.Date; import cn.axzo.apollo.workspace.api.v2.workspace.req.WorkspaceUpsertReq; import cn.axzo.foundation.page.PageResp; import cn.axzo.orgmanax.dto.node.req.ProcessNodeReq; -import cn.axzo.orgmanax.dto.unit.req.ListUnitReq; -import cn.axzo.orgmanax.dto.unit.dto.OrgUnitDTO; import cn.axzo.orgmanax.dto.nodeuser.enums.NodeUserTypeEnum; +import cn.axzo.orgmanax.dto.unit.dto.OrgUnitDTO; +import cn.axzo.orgmanax.dto.unit.req.CreateUnitReq; +import cn.axzo.orgmanax.dto.unit.req.ListUnitReq; +import cn.axzo.orgmanax.dto.unit.req.UpdateUnitReq; +import cn.axzo.orgmanax.dto.unit.resp.CreateUnitResp; +import cn.axzo.orgmanax.dto.unit.resp.UpdateUnitResp; import cn.axzo.orgmanax.infra.client.workspace.WorkspaceGateway; import cn.axzo.orgmanax.infra.dao.unit.entity.OrganizationalUnit; import cn.axzo.orgmanax.infra.dao.unit.repository.UnitQueryRepository; @@ -16,10 +18,6 @@ import cn.axzo.orgmanax.server.node.service.NodeService; import cn.axzo.orgmanax.server.unit.foundation.UnitFoundationService; import cn.axzo.orgmanax.server.unit.foundation.dto.UnitCreator; import cn.axzo.orgmanax.server.unit.service.UnitService; -import cn.axzo.orgmanax.server.unit.service.dto.CreateUnitReq; -import cn.axzo.orgmanax.server.unit.service.dto.CreateUnitResp; -import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitReq; -import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitResp; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.BooleanUtil; import com.alibaba.fastjson.JSONObject; @@ -29,6 +27,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.support.TransactionTemplate; +import java.math.BigDecimal; +import java.util.Date; + @Slf4j @RequiredArgsConstructor @Service