From d85e460fa9a4eccb3e4339d7de9893a0d438611a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 03 一月 2024 09:01:56 +0800
Subject: [PATCH] 海康接口对接开发
---
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java | 42 +++++++++++++++++++++++++++++-------------
1 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
index 8d5026f..5a7f8e4 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
@@ -122,6 +122,9 @@
@Override
@Transactional
public String syncCompany(OrgListRequest param){
+ if(!StringUtils.equals(Constants.ONE+"", systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ORG_USER_ORIGIN).getCode())){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "瀵逛笉璧凤紝褰撳墠涓嶆敮鎸佺粍缁囧悓姝ユ搷浣渵");
+ }
//鑾峰彇ERP缁勭粐淇℃伅锛堝叏閲忓悓姝ワ級
List<ErpOrgListResponse> list = ErpTool.getErpOrgList(ErpConstants.orgListUrl,param);
if(list !=null && list.size()>0){
@@ -262,6 +265,9 @@
@Override
@Transactional
public String syncUsers(UserListRequest param){
+ if(!StringUtils.equals(Constants.ONE+"", systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.ORG_USER_ORIGIN).getCode())){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "瀵逛笉璧凤紝褰撳墠涓嶆敮鎸佷汉鍛樺悓姝ユ搷浣渵");
+ }
List<ErpUserListResponse> list = ErpTool.getErpUserList(ErpConstants.userListUrl,param);
if(list !=null && list.size()>0) {
List<Member> addList = new ArrayList<>();
@@ -715,9 +721,9 @@
if(Objects.isNull(param)
||Objects.isNull(param.getId())
||StringUtils.isBlank(param.getName())
- ||StringUtils.isBlank(param.getLinkName())
- ||StringUtils.isBlank(param.getLinkPhone())
- ||Objects.isNull(param.getEditDate())
+// ||StringUtils.isBlank(param.getLinkName())
+// ||StringUtils.isBlank(param.getLinkPhone())
+// ||Objects.isNull(param.getEditDate())
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
@@ -729,6 +735,7 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌涓婄骇缁勭粐鏁版嵁");
}
}
+ String rootOrgId = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_ROOTORG_CODE).getCode();
if(Objects.isNull(company)){
company = new Company();
company.setId(null);
@@ -736,9 +743,14 @@
company.setHkStatus(Constants.ZERO);
company.setErpStatus(Constants.ONE);
company.setErpDate(new Date());
+ company.setName(param.getName());
+ /* if(StringUtils.isNotBlank(param.getParentId())){
+ company.setHkId(rootOrgId);
+ }*/
company.setErpId(param.getId());
company.setErpParentId(param.getParentId());
company.setParentId(Objects.isNull(parentCompany)?null:parentCompany.getId());
+ company.setErpParentId(param.getParentId());
company.setFsStatus(Constants.ZERO);
company.setType(Constants.ONE);
company.setLinkName(param.getLinkName());
@@ -749,8 +761,12 @@
// BeanUtils.copyProperties(param,company);
company.setEditDate(new Date());
company.setErpId(param.getId());
+ /* if(StringUtils.isNotBlank(param.getParentId())){
+ company.setHkId(rootOrgId);
+ }*/
company.setHkStatus(Constants.ZERO);
company.setErpDate(new Date());
+ company.setName(param.getName());
company.setErpParentId(param.getParentId());
company.setParentId(Objects.isNull(parentCompany)?null:parentCompany.getId());
company.setLinkName(param.getLinkName());
@@ -771,16 +787,16 @@
public void userUpdate(UserUpdateRequest param){
try{
if(Objects.isNull(param)
- ||Objects.isNull(param.getId())
- ||StringUtils.isBlank(param.getName())
- ||StringUtils.isBlank(param.getIdNo())
- ||Objects.isNull(param.getIdType())
- ||Objects.isNull(param.getSex())
- ||Objects.isNull(param.getOrgId())
- ||StringUtils.isNotBlank(param.getFaceImg())
- ||StringUtils.isNotBlank(param.getCode())
- ||StringUtils.isNotBlank(param.getPhone())
- ||Objects.isNull(param.getEditDate())){
+ ||Objects.isNull(param.getId())//缂栫爜
+ ||StringUtils.isBlank(param.getName())//鍚嶇О
+ ||StringUtils.isBlank(param.getIdNo())//璇佷欢鍙�
+ ||Objects.isNull(param.getIdType())//璇佷欢绫诲瀷
+ ||Objects.isNull(param.getSex())//鎬у埆
+ ||Objects.isNull(param.getOrgId())//鎵�灞炵粍缁囩紪鐮�
+ ||StringUtils.isBlank(param.getFaceImg())//浜鸿劯鐓х墖
+ ||StringUtils.isBlank(param.getCode())//宸ュ彿
+ ||StringUtils.isBlank(param.getPhone())//鎵嬫満鍙�
+ ){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
Member member = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getErpId,param.getId()).last("limit 1"));
--
Gitblit v1.9.3