feat:[REQ-3282] 暂时提交,编写单位相关代码
This commit is contained in:
parent
5737b3cd47
commit
5cd51dc30a
@ -1,6 +1,7 @@
|
|||||||
package cn.axzo.orgmanax.api.unit.feign;
|
package cn.axzo.orgmanax.api.unit.feign;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageResp;
|
||||||
import cn.axzo.foundation.result.ApiResult;
|
import cn.axzo.foundation.result.ApiResult;
|
||||||
import cn.axzo.orgmanax.api.unit.req.CreateUnitReq;
|
import cn.axzo.orgmanax.api.unit.req.CreateUnitReq;
|
||||||
import cn.axzo.orgmanax.api.unit.req.ListUnitReq;
|
import cn.axzo.orgmanax.api.unit.req.ListUnitReq;
|
||||||
@ -48,6 +49,6 @@ public interface OrgUnitApi {
|
|||||||
* @see ListUnitReq#getPageSize()
|
* @see ListUnitReq#getPageSize()
|
||||||
*/
|
*/
|
||||||
@PostMapping("/api/org/unit/list")
|
@PostMapping("/api/org/unit/list")
|
||||||
ApiResult<OrgUnitDTO> list(@RequestBody @Validated ListUnitReq req);
|
ApiResult<PageResp<OrgUnitDTO>> list(@RequestBody @Validated ListUnitReq req);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,17 @@
|
|||||||
package cn.axzo.orgmanax.api.unit.req;
|
package cn.axzo.orgmanax.api.unit.req;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
public class CreateUnitReq implements Serializable {
|
public class CreateUnitReq implements Serializable {
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,196 @@
|
|||||||
package cn.axzo.orgmanax.api.unit.req;
|
package cn.axzo.orgmanax.api.unit.req;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class UpdateUnitReq implements Serializable {
|
public class UpdateUnitReq implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,196 @@
|
|||||||
package cn.axzo.orgmanax.api.unit.resp;
|
package cn.axzo.orgmanax.api.unit.resp;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@Data
|
@Data
|
||||||
public class UpdateUnitResp implements Serializable {
|
public class UpdateUnitResp implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
public interface UnitQueryRepository {
|
public interface UnitQueryRepository {
|
||||||
|
|
||||||
PageResp<UnitResp> page(PageReq req);
|
PageResp<UnitResp> page(ListReq paramReq);
|
||||||
|
|
||||||
default List<UnitResp> list(ListReq req) {
|
default List<UnitResp> list(ListReq req) {
|
||||||
PageReq pageReq = BeanUtil.toBean(req, PageReq.class);
|
PageReq pageReq = BeanUtil.toBean(req, PageReq.class);
|
||||||
@ -78,7 +78,7 @@ public interface UnitQueryRepository {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
class ListReq {
|
class ListReq implements IPageReq{
|
||||||
@CriteriaField
|
@CriteriaField
|
||||||
private Long id;
|
private Long id;
|
||||||
@CriteriaField(field = "id", operator = Operator.IN)
|
@CriteriaField(field = "id", operator = Operator.IN)
|
||||||
|
|||||||
@ -9,4 +9,10 @@ public interface UnitUpsertRepository {
|
|||||||
* @param organizationalUnit 组织单位
|
* @param organizationalUnit 组织单位
|
||||||
*/
|
*/
|
||||||
void save(OrganizationalUnit organizationalUnit);
|
void save(OrganizationalUnit organizationalUnit);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单位
|
||||||
|
* @param organizationalUnit
|
||||||
|
*/
|
||||||
|
void update(OrganizationalUnit organizationalUnit);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ public class UnitQueryRepositoryImpl implements UnitQueryRepository {
|
|||||||
private final UnitDao unitDao;
|
private final UnitDao unitDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResp<UnitResp> page(PageReq req) {
|
public PageResp<UnitResp> page(ListReq req) {
|
||||||
IPage<OrganizationalUnit> page = PageConverter.toMybatis(req, OrganizationalUnit.class);
|
IPage<OrganizationalUnit> page = PageConverter.toMybatis(req, OrganizationalUnit.class);
|
||||||
QueryWrapper<OrganizationalUnit> wrapper = QueryWrapperHelper.fromBean(req, OrganizationalUnit.class);
|
QueryWrapper<OrganizationalUnit> wrapper = QueryWrapperHelper.fromBean(req, OrganizationalUnit.class);
|
||||||
IPage<UnitResp> results = unitDao.page(page, wrapper)
|
IPage<UnitResp> results = unitDao.page(page, wrapper)
|
||||||
@ -37,4 +37,5 @@ public class UnitQueryRepositoryImpl implements UnitQueryRepository {
|
|||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,9 @@ public class UnitUpsertRepositoryImpl implements UnitUpsertRepository {
|
|||||||
public void save(OrganizationalUnit entity) {
|
public void save(OrganizationalUnit entity) {
|
||||||
unitDao.save(entity);
|
unitDao.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(OrganizationalUnit organizationalUnit) {
|
||||||
|
unitDao.updateById(organizationalUnit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cn.axzo.orgmanax.server.unit.controller;
|
package cn.axzo.orgmanax.server.unit.controller;
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageResp;
|
||||||
import cn.axzo.foundation.result.ApiResult;
|
import cn.axzo.foundation.result.ApiResult;
|
||||||
import cn.axzo.orgmanax.api.unit.feign.OrgUnitApi;
|
import cn.axzo.orgmanax.api.unit.feign.OrgUnitApi;
|
||||||
import cn.axzo.orgmanax.api.unit.req.CreateUnitReq;
|
import cn.axzo.orgmanax.api.unit.req.CreateUnitReq;
|
||||||
@ -38,8 +39,8 @@ public class UnitController implements OrgUnitApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResult<OrgUnitDTO> list(ListUnitReq req) {
|
public ApiResult<PageResp<OrgUnitDTO>> list(ListUnitReq req) {
|
||||||
//
|
|
||||||
return null;
|
return ApiResult.success(unitService.list(req));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,4 +13,9 @@ public interface UnitFoundationService {
|
|||||||
OrganizationalUnit create(UnitCreator creator);
|
OrganizationalUnit create(UnitCreator creator);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新单位
|
||||||
|
* @param unitCreator
|
||||||
|
*/
|
||||||
|
OrganizationalUnit update(UnitCreator unitCreator);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,11 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class UnitCreator {
|
public class UnitCreator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父单位id
|
* 父单位id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package cn.axzo.orgmanax.server.unit.foundation.impl;
|
|||||||
|
|
||||||
import cn.axzo.foundation.event.support.Event;
|
import cn.axzo.foundation.event.support.Event;
|
||||||
import cn.axzo.foundation.event.support.producer.EventProducer;
|
import cn.axzo.foundation.event.support.producer.EventProducer;
|
||||||
|
import cn.axzo.foundation.exception.Axssert;
|
||||||
|
import cn.axzo.orgmanax.common.config.BizResultCode;
|
||||||
|
import cn.axzo.orgmanax.common.entity.BizErrorInfo;
|
||||||
import cn.axzo.orgmanax.infra.dao.unit.entity.OrganizationalUnit;
|
import cn.axzo.orgmanax.infra.dao.unit.entity.OrganizationalUnit;
|
||||||
import cn.axzo.orgmanax.infra.dao.unit.repository.UnitQueryRepository;
|
import cn.axzo.orgmanax.infra.dao.unit.repository.UnitQueryRepository;
|
||||||
import cn.axzo.orgmanax.infra.dao.unit.repository.UnitUpsertRepository;
|
import cn.axzo.orgmanax.infra.dao.unit.repository.UnitUpsertRepository;
|
||||||
@ -31,12 +34,10 @@ public class UnitFoundationServiceImpl implements UnitFoundationService {
|
|||||||
|
|
||||||
// 1. 重复校验
|
// 1. 重复校验
|
||||||
// 根据单位名称或信用代码查询
|
// 根据单位名称或信用代码查询
|
||||||
UnitQueryRepository.UnitResp unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().name(creator.getName()).build());
|
UnitQueryRepository.UnitResp unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().name(creator.getCertificationLetterUrl()).build());
|
||||||
Assert.isFalse(unit != null && CharSequenceUtil.equals(creator.getName(), unit.getName()), "创建失败, 单位名称重复");
|
Axssert.check(unit == null, BizResultCode.INVALID_PARAM,"创建失败, 单位重复");
|
||||||
unit = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().name(creator.getCertificationLetterUrl()).build());
|
|
||||||
Assert.isFalse(CharSequenceUtil.equals(creator.getCertificationLetterUrl(), unit.getCertificationLetterUrl()), "创建失败, 单位名称重复");
|
|
||||||
// todo 1. parentId 是否使用
|
// todo 1. parentId 是否使用
|
||||||
|
// todo 2. 信用代码是否调用三方进行验证
|
||||||
|
|
||||||
// 2. 创建单位实体
|
// 2. 创建单位实体
|
||||||
OrganizationalUnit organizationalUnit = BeanUtil.copyProperties(creator, OrganizationalUnit.class);
|
OrganizationalUnit organizationalUnit = BeanUtil.copyProperties(creator, OrganizationalUnit.class);
|
||||||
@ -59,4 +60,16 @@ public class UnitFoundationServiceImpl implements UnitFoundationService {
|
|||||||
|
|
||||||
return organizationalUnit;
|
return organizationalUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrganizationalUnit update(UnitCreator creator) {
|
||||||
|
|
||||||
|
UnitQueryRepository.UnitResp unitResp = unitQueryRepository.one(UnitQueryRepository.OneReq.builder().id(creator.getId()).build());
|
||||||
|
Axssert.check(unitResp != null, BizResultCode.INVALID_PARAM, "更新失败, 单位不存在");
|
||||||
|
|
||||||
|
OrganizationalUnit organizationalUnit = BeanUtil.copyProperties(creator, OrganizationalUnit.class);
|
||||||
|
unitUpsertRepository.update(organizationalUnit);
|
||||||
|
|
||||||
|
return organizationalUnit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
package cn.axzo.orgmanax.server.unit.service;
|
package cn.axzo.orgmanax.server.unit.service;
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageResp;
|
||||||
|
import cn.axzo.orgmanax.api.unit.req.ListUnitReq;
|
||||||
|
import cn.axzo.orgmanax.api.unit.resp.OrgUnitDTO;
|
||||||
import cn.axzo.orgmanax.server.unit.service.dto.CreateUnitReq;
|
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.CreateUnitResp;
|
||||||
import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitReq;
|
import cn.axzo.orgmanax.server.unit.service.dto.UpdateUnitReq;
|
||||||
@ -20,4 +23,11 @@ public interface UnitService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
UpdateUnitResp update(UpdateUnitReq updateUnitReq);
|
UpdateUnitResp update(UpdateUnitReq updateUnitReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单位信息
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageResp<OrgUnitDTO> list(ListUnitReq req);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,194 @@
|
|||||||
package cn.axzo.orgmanax.server.unit.service.dto;
|
package cn.axzo.orgmanax.server.unit.service.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class UpdateUnitReq {
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,194 @@
|
|||||||
package cn.axzo.orgmanax.server.unit.service.dto;
|
package cn.axzo.orgmanax.server.unit.service.dto;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class UpdateUnitResp {
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
package cn.axzo.orgmanax.server.unit.service.impl;
|
package cn.axzo.orgmanax.server.unit.service.impl;
|
||||||
|
|
||||||
|
import cn.axzo.foundation.page.PageResp;
|
||||||
|
import cn.axzo.orgmanax.api.unit.req.ListUnitReq;
|
||||||
|
import cn.axzo.orgmanax.api.unit.resp.OrgUnitDTO;
|
||||||
import cn.axzo.orgmanax.infra.dao.unit.entity.OrganizationalUnit;
|
import cn.axzo.orgmanax.infra.dao.unit.entity.OrganizationalUnit;
|
||||||
|
import cn.axzo.orgmanax.infra.dao.unit.repository.UnitQueryRepository;
|
||||||
import cn.axzo.orgmanax.server.unit.foundation.UnitFoundationService;
|
import cn.axzo.orgmanax.server.unit.foundation.UnitFoundationService;
|
||||||
import cn.axzo.orgmanax.server.unit.foundation.dto.UnitCreator;
|
import cn.axzo.orgmanax.server.unit.foundation.dto.UnitCreator;
|
||||||
import cn.axzo.orgmanax.server.unit.service.UnitService;
|
import cn.axzo.orgmanax.server.unit.service.UnitService;
|
||||||
@ -13,12 +17,15 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import static org.springframework.messaging.rsocket.RSocketStrategies.builder;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class UnitServiceImpl implements UnitService {
|
public class UnitServiceImpl implements UnitService {
|
||||||
|
|
||||||
private final UnitFoundationService unitFoundationService;
|
private final UnitFoundationService unitFoundationService;
|
||||||
|
private final UnitQueryRepository unitQueryRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CreateUnitResp create(CreateUnitReq req) {
|
public CreateUnitResp create(CreateUnitReq req) {
|
||||||
@ -35,6 +42,23 @@ public class UnitServiceImpl implements UnitService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UpdateUnitResp update(UpdateUnitReq updateUnitReq) {
|
public UpdateUnitResp update(UpdateUnitReq updateUnitReq) {
|
||||||
return null;
|
|
||||||
|
UnitCreator unitCreator = BeanUtil.copyProperties(updateUnitReq, UnitCreator.class);
|
||||||
|
// 更新单位
|
||||||
|
OrganizationalUnit unit = unitFoundationService.update(unitCreator);
|
||||||
|
|
||||||
|
return BeanUtil.copyProperties(unit, UpdateUnitResp.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResp<OrgUnitDTO> list(ListUnitReq req) {
|
||||||
|
UnitQueryRepository.ListReq listReq = BeanUtil.copyProperties(req, UnitQueryRepository.ListReq.class);
|
||||||
|
PageResp<UnitQueryRepository.UnitResp> page = unitQueryRepository.page(listReq);
|
||||||
|
return PageResp.<OrgUnitDTO>builder()
|
||||||
|
.current(page.getCurrent())
|
||||||
|
.total(page.getTotal())
|
||||||
|
.size(page.getSize())
|
||||||
|
.data(BeanUtil.copyToList(page.getData(), OrgUnitDTO.class))
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user