From fb76e69b3e2783ffe4a923808058d304f420b7de Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期六, 14 九月 2024 14:37:09 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
index 1e84509..2c9996d 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -104,6 +104,7 @@
}
}
idPath = parent.getCompanyPath();
+ company.setHkParentId(parent.getHkId());
company.setCompanyPath(parent.getCompanyPath()+company.getId()+"/");
company.setCompanyNamePath(parent.getCompanyNamePath()+"/"+company.getName());
}
@@ -156,6 +157,7 @@
}
private boolean delHkOrg(Company company) {
OrgDelRequest request =new OrgDelRequest();
+
request.setIndexCodes(new String[]{company.getHkId()});
BaseResponse<List<OrgUpdateFailureResponse>> result = HKService.delBatchOrg(request);
if(result !=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE)){
@@ -232,6 +234,7 @@
.eq(Member::getIsdeleted,Constants.ZERO)) >0){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "瀵逛笉璧凤紝璇ラ儴闂ㄤ笅瀛樺湪浜哄憳淇℃伅锛屼笉鑳借繘琛屽垹闄ゆ搷浣滐紒");
}
+
Company company = new Company();
company.setId(id);
company.setEditDate(new Date());
@@ -241,7 +244,7 @@
company.setHkDate(company.getHkDate());
companyMapper.updateById(company);
//涓嬪彂娴峰悍瀹夐槻骞冲彴
- if(StringUtils.isBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
+ if(StringUtils.isNotBlank(model.getHkId()) && Constants.equalsInteger(Constants.ONE,model.getHkStatus()) && !delHkOrg(model)){
throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"瀵逛笉璧凤紝缁勭粐鍒犻櫎涓嬪彂澶辫触锛岃纭璇ョ粍缁囨棤涓嬬骇缁勭粐鎴栫粍缁囦汉鍛樹俊鎭瘇");
}
}
@@ -292,7 +295,8 @@
if(companyJoinMapper.selectCount(new QueryWrapper<Company>().lambda()
.eq(Company::getIsdeleted,Constants.ZERO )
.eq(Company::getType,Constants.ONE )
- .likeRight(Company::getCompanyPath,company.getCompanyPath())) >0){
+ .ne(Company::getId,model.getId())
+ .likeRight(Company::getCompanyPath,model.getCompanyPath())) >0){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "瀵逛笉璧凤紝涓嬬骇閮ㄩ棬瀛樺湪鍐呴儴缁勭粐锛岃閮ㄩ棬涓嶆敮鎸佸垏鎹负鐩稿叧鏂圭粍缁囷紒~");
}
}
@@ -482,13 +486,11 @@
companyMapper.updateById(company);
}
-
@Override
public long count(Company company) {
QueryWrapper<Company> wrapper = new QueryWrapper<>(company);
return companyMapper.selectCount(wrapper);
}
-
@Override
public List<CompanyDTO> findCompanyTreePage(Integer type) {
@@ -500,7 +502,6 @@
List<Company> companies = companyMapper.selectList(wrapper);
return getCompanyTree( companies, null);
}
-
private List<CompanyDTO> getCompanyTree(List<Company> companies, String parentId){
if (CollectionUtils.isEmpty(companies)){
@@ -576,7 +577,7 @@
queryWrapper.leftJoin(SystemUser.class,SystemUser::getId,Company::getEditor);
queryWrapper.eq(Company::getIsdeleted,Constants.ZERO);
queryWrapper.eq(type!=null,Company::getType,type);
- queryWrapper.orderByAsc(Company::getSortnum );
+ queryWrapper.orderByAsc(true,"t.sortnum");
List<Company> companyList = companyJoinMapper.selectJoinList(Company.class,queryWrapper);
//閰嶇疆缁勫憳浜哄憳绫诲瀷鏉ユ簮鏂瑰紡 0鑷缓 1ERP
CompanyTree treeBuild = new CompanyTree(companyList, dataSyncConfig.getOrgUserDataOrigin());
@@ -618,7 +619,8 @@
if (currentMenuIndex - 1 < 0) {
return;
}
- Company preMenu = companyPool.remove(currentMenuIndex - 1);
+ Company preMenu = companyPool.get(currentMenuIndex - 1);
+ companyPool.remove(currentMenuIndex - 1);
companyPool.add(currentMenuIndex, preMenu);
}
// 涓嬬Щ
--
Gitblit v1.9.3