Compare commits
2 Commits
master
...
dev_workchange
| Author | SHA1 | Date |
|---|---|---|
|
|
6286e6a124 | |
|
|
2b0b9235fc |
|
|
@ -39,3 +39,4 @@ build/
|
|||
.DS_Store
|
||||
logs/
|
||||
/.mvn/
|
||||
/start/src/main/resources/templates/
|
||||
|
|
|
|||
|
|
@ -2,5 +2,7 @@ spring:
|
|||
config:
|
||||
import:
|
||||
- classpath:nacos.yml
|
||||
- classpath:sdk.yml
|
||||
- classpath:nacos-prod.yml
|
||||
# - classpath:sdk.yml
|
||||
- classpath:sdk-prod.yml
|
||||
- classpath:swagger.yml
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2026/6/3 14:07:11) App/domain"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
|
||||
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2026/6/23 17:36:49) App/domain"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
|
||||
const APP_ENV = {
|
||||
antd: {
|
||||
'ant-prefix': 'micro-temp',
|
||||
|
|
@ -20,4 +20,4 @@
|
|||
redirect: '',
|
||||
FRAMEWORK: APP_ENV.antd
|
||||
};
|
||||
})();</script><script defer="defer" src="/domain/static/js/888.1cfe3f1827874068cf00.js"></script><script defer="defer" src="/domain/static/js/410.8685ba962e58528152e2.js"></script><script defer="defer" src="/domain/static/js/main.ffc48f120fb9dd783069.js"></script><link href="/domain/static/css/main.c74fbb90829596498e3a.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2026/6/3 14:07:11) App/domain Version/main Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
|
||||
})();</script><script defer="defer" src="/domain/static/js/888.f84533eefa5942ed12fc.js"></script><script defer="defer" src="/domain/static/js/410.ac23b512c1374b5b0539.js"></script><script defer="defer" src="/domain/static/js/main.044e66105e54ad25da94.js"></script><link href="/domain/static/css/main.c74fbb90829596498e3a.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2026/6/23 17:36:49) App/domain Version/main Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
|
||||
|
|
@ -1 +1 @@
|
|||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"https://gbs-gateway.qhdsafety.com"},production:{javaGitBranch:"<branch-name>",API_HOST:""}},appIdentifier:"domain",contextInject:{appKey:"",fileUrl:"https://skqhdg.porthebei.com:9004/file/uploadFiles2/"},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:[]},server:{port:"8083",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"https://gbs-gateway.qhdsafety.com"},production:{javaGitBranch:"<branch-name>",API_HOST:""}},appIdentifier:"domain",contextInject:{appKey:"",fileUrl:""},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:[]},server:{port:"8083",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,101 +0,0 @@
|
|||
/*!
|
||||
* isobject <https://github.com/jonschlinkert/isobject>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* screenfull
|
||||
* v5.2.0 - 2021-11-03
|
||||
* (c) Sindre Sorhus; MIT License
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Lodash <https://lodash.com/>
|
||||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||||
* Released under MIT license <https://lodash.com/license>
|
||||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,110 +0,0 @@
|
|||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/** @preserve
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||
"ahooks": "^3.9.5",
|
||||
"antd": "latest",
|
||||
"antd": "^5.27.6",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"qrcode.react": "^4.2.0",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.zcloud.domain.facade;
|
||||
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.domain.command.DomainWorkChangeExe;
|
||||
import com.zcloud.domain.command.query.DomainWorkQueryExe;
|
||||
import com.zcloud.gbscommon.zclouddomain.facade.ZcloudDomainFacade;
|
||||
import com.zcloud.gbscommon.zclouddomain.request.DomainQry;
|
||||
import com.zcloud.gbscommon.zclouddomain.request.DomainWorkChangeCmd;
|
||||
import com.zcloud.gbscommon.zclouddomain.response.DomainListByUserCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@DubboService
|
||||
public class ZcloudDomainFacadeImpl implements ZcloudDomainFacade {
|
||||
@Resource
|
||||
private DomainWorkQueryExe domainWorkQueryExe;
|
||||
@Resource
|
||||
private DomainWorkChangeExe domainWorkChangeExe;
|
||||
|
||||
@Override
|
||||
public MultiResponse<DomainListByUserCO> listManagerByUserId(DomainQry domainQry) {
|
||||
return MultiResponse.of(domainWorkQueryExe.execute(domainQry));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse updateRiskWorkChange(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
domainWorkChangeExe.execute(domainWorkChangeCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,243 @@
|
|||
package com.zcloud.domain.command;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jjb.saas.message.client.message.facede.MessageFacade;
|
||||
import com.jjb.saas.message.client.message.request.MessageSendCmd;
|
||||
import com.jjb.saas.message.client.message.request.MessageTargetCmd;
|
||||
import com.zcloud.domain.domain.config.MessageConfig;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentUserDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupUserDO;
|
||||
import com.zcloud.domain.persistence.repository.DomainDepartmentRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainDepartmentUserRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainGroupRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainGroupUserRepository;
|
||||
import com.zcloud.gbscommon.todolistmq.TodoListEventPusherUtil;
|
||||
import com.zcloud.gbscommon.todolistmq.event.TodoListAddEvent;
|
||||
import com.zcloud.gbscommon.utils.UuidUtil;
|
||||
import com.zcloud.gbscommon.zclouddomain.request.DomainWorkChangeCmd;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 领域工作交接执行器
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class DomainWorkChangeExe {
|
||||
private final DomainDepartmentRepository domainDepartmentRepository;
|
||||
private final DomainDepartmentUserRepository domainDepartmentUserRepository;
|
||||
private final DomainGroupRepository domainGroupRepository;
|
||||
private final DomainGroupUserRepository domainGroupUserRepository;
|
||||
private final TodoListEventPusherUtil todoListEventPusherUtil;
|
||||
private final MessageConfig messageConfig;
|
||||
@DubboReference
|
||||
private MessageFacade messageFacade;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void execute(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
checkParam(domainWorkChangeCmd);
|
||||
if (changeDomainDepartment(domainWorkChangeCmd)) {
|
||||
return;
|
||||
}
|
||||
if (changeDomainDepartmentUser(domainWorkChangeCmd)) {
|
||||
return;
|
||||
}
|
||||
if (changeDomainGroup(domainWorkChangeCmd)) {
|
||||
return;
|
||||
}
|
||||
if (changeDomainGroupUser(domainWorkChangeCmd)) {
|
||||
return;
|
||||
}
|
||||
throw new BizException("未找到对应的领域交接工作");
|
||||
}
|
||||
|
||||
private void checkParam(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
if (domainWorkChangeCmd == null || StringUtils.isBlank(domainWorkChangeCmd.getWorkId())) {
|
||||
throw new BizException("工作标识不能为空");
|
||||
}
|
||||
if (domainWorkChangeCmd.getOldUserId() == null) {
|
||||
throw new BizException("原交接人员不能为空");
|
||||
}
|
||||
if (domainWorkChangeCmd.getUserId() == null) {
|
||||
throw new BizException("新交接人员不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean changeDomainDepartment(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
DomainDepartmentDO domainDepartmentDO = domainDepartmentRepository.getByWorkId(domainWorkChangeCmd.getWorkId());
|
||||
if (domainDepartmentDO == null) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(domainDepartmentDO.getMasterUserId(), domainWorkChangeCmd.getOldUserId())) {
|
||||
log.warn("领域负责人交接跳过,当前负责人已变更,workId:{}, oldUserId:{}, dbUserId:{}",
|
||||
domainWorkChangeCmd.getWorkId(), domainWorkChangeCmd.getOldUserId(), domainDepartmentDO.getMasterUserId());
|
||||
return true;
|
||||
}
|
||||
domainDepartmentDO.setMasterUserId(domainWorkChangeCmd.getUserId());
|
||||
if (domainWorkChangeCmd.getDeptId() != null) {
|
||||
domainDepartmentDO.setMasterDepartmentId(domainWorkChangeCmd.getDeptId());
|
||||
}
|
||||
domainDepartmentRepository.updateById(domainDepartmentDO);
|
||||
sendWorkChangeMessage(domainWorkChangeCmd, domainDepartmentDO.getId(), "领域负责人", buildDomainDepartmentContent(domainDepartmentDO));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean changeDomainDepartmentUser(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
DomainDepartmentUserDO domainDepartmentUserDO = domainDepartmentUserRepository.getByWorkId(domainWorkChangeCmd.getWorkId());
|
||||
if (domainDepartmentUserDO == null) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(domainDepartmentUserDO.getUserId(), domainWorkChangeCmd.getOldUserId())) {
|
||||
log.warn("领域审核人员交接跳过,当前审核人员已变更,workId:{}, oldUserId:{}, dbUserId:{}",
|
||||
domainWorkChangeCmd.getWorkId(), domainWorkChangeCmd.getOldUserId(), domainDepartmentUserDO.getUserId());
|
||||
return true;
|
||||
}
|
||||
Long duplicateCount = domainDepartmentUserRepository.countByDomainDepartmentIdAndUserId(
|
||||
domainDepartmentUserDO.getDomainDepartmentId(), domainWorkChangeCmd.getUserId(), domainDepartmentUserDO.getId());
|
||||
if (duplicateCount != null && duplicateCount > 0) {
|
||||
throw new BizException("新交接人员已存在于该领域审核人员中");
|
||||
}
|
||||
domainDepartmentUserDO.setUserId(domainWorkChangeCmd.getUserId());
|
||||
if (domainWorkChangeCmd.getDeptId() != null) {
|
||||
domainDepartmentUserDO.setDepartmentId(domainWorkChangeCmd.getDeptId());
|
||||
}
|
||||
domainDepartmentUserRepository.updateById(domainDepartmentUserDO);
|
||||
DomainDepartmentDO domainDepartmentDO = domainDepartmentRepository.getInfoByUUID(domainDepartmentUserDO.getDomainDepartmentId());
|
||||
sendWorkChangeMessage(domainWorkChangeCmd, domainDepartmentUserDO.getId(), "领域审核人员", buildDomainDepartmentContent(domainDepartmentDO));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean changeDomainGroup(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
DomainGroupDO domainGroupDO = domainGroupRepository.getByWorkId(domainWorkChangeCmd.getWorkId());
|
||||
if (domainGroupDO == null) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(domainGroupDO.getTeamUserId(), domainWorkChangeCmd.getOldUserId())) {
|
||||
log.warn("领域组组长交接跳过,当前组长已变更,workId:{}, oldUserId:{}, dbUserId:{}",
|
||||
domainWorkChangeCmd.getWorkId(), domainWorkChangeCmd.getOldUserId(), domainGroupDO.getTeamUserId());
|
||||
return true;
|
||||
}
|
||||
domainGroupDO.setTeamUserId(domainWorkChangeCmd.getUserId());
|
||||
if (domainWorkChangeCmd.getDeptId() != null) {
|
||||
domainGroupDO.setTeamDepartmentId(domainWorkChangeCmd.getDeptId());
|
||||
}
|
||||
if (domainWorkChangeCmd.getCorpId() != null) {
|
||||
domainGroupDO.setCorpinfoId(domainWorkChangeCmd.getCorpId());
|
||||
}
|
||||
domainGroupRepository.updateById(domainGroupDO);
|
||||
sendWorkChangeMessage(domainWorkChangeCmd, domainGroupDO.getId(), "领域组组长", buildDomainGroupContent(domainGroupDO));
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean changeDomainGroupUser(DomainWorkChangeCmd domainWorkChangeCmd) {
|
||||
DomainGroupUserDO domainGroupUserDO = domainGroupUserRepository.getByWorkId(domainWorkChangeCmd.getWorkId());
|
||||
if (domainGroupUserDO == null) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(domainGroupUserDO.getUserId(), domainWorkChangeCmd.getOldUserId())) {
|
||||
log.warn("领域组成员交接跳过,当前成员已变更,workId:{}, oldUserId:{}, dbUserId:{}",
|
||||
domainWorkChangeCmd.getWorkId(), domainWorkChangeCmd.getOldUserId(), domainGroupUserDO.getUserId());
|
||||
return true;
|
||||
}
|
||||
Long duplicateCount = domainGroupUserRepository.countByDomainGroupIdAndUserId(
|
||||
domainGroupUserDO.getDomainGroupId(), domainWorkChangeCmd.getUserId(), domainGroupUserDO.getId());
|
||||
if (duplicateCount != null && duplicateCount > 0) {
|
||||
throw new BizException("新交接人员已存在于该领域组成员中");
|
||||
}
|
||||
domainGroupUserDO.setUserId(domainWorkChangeCmd.getUserId());
|
||||
if (domainWorkChangeCmd.getDeptId() != null) {
|
||||
domainGroupUserDO.setDepartmentId(domainWorkChangeCmd.getDeptId());
|
||||
}
|
||||
domainGroupUserRepository.updateById(domainGroupUserDO);
|
||||
DomainGroupDO domainGroupDO = domainGroupRepository.getInfoByGroupId(domainGroupUserDO.getDomainGroupId());
|
||||
sendWorkChangeMessage(domainWorkChangeCmd, domainGroupUserDO.getId(), "领域组成员", buildDomainGroupContent(domainGroupDO));
|
||||
return true;
|
||||
}
|
||||
|
||||
private void sendWorkChangeMessage(DomainWorkChangeCmd domainWorkChangeCmd, Long foreignKey, String workProject, String workContent) {
|
||||
try {
|
||||
MessageSendCmd messageSendCmd = new MessageSendCmd();
|
||||
messageSendCmd.setBusinessId(UuidUtil.get32UUID());
|
||||
MessageTargetCmd messageTargetCmd = new MessageTargetCmd();
|
||||
messageTargetCmd.setUserId(domainWorkChangeCmd.getUserId());
|
||||
messageSendCmd.setTargetCmd(messageTargetCmd);
|
||||
messageSendCmd.setSourceCode(resolveSourceCode(workProject));
|
||||
messageSendCmd.setNeedTokenEnum(false);
|
||||
messageSendCmd.setParams(buildSendParams(domainWorkChangeCmd, workProject, workContent));
|
||||
log.info("领域工作交接发送消息参数:{}", JSONUtil.toJsonStr(messageSendCmd));
|
||||
SingleResponse<Boolean> response = messageFacade.send(messageSendCmd);
|
||||
log.info("领域工作交接发送消息结果:{}", JSONUtil.toJsonStr(response));
|
||||
|
||||
/* TodoListAddEvent event = new TodoListAddEvent();
|
||||
event.setTitle("您有一条【领域工作】待处理");
|
||||
event.setContent(workProject + "交接待处理");
|
||||
event.setForeignKey(foreignKey);
|
||||
event.setForeignSubsidiaryKey(foreignKey);
|
||||
event.setReceiveUser(domainWorkChangeCmd.getUserId());
|
||||
event.setPcFlag(1);
|
||||
event.setAppFlag(0);
|
||||
event.setOtherParams(new JSONObject());
|
||||
todoListEventPusherUtil.sendMessageAddEvent(event);*/
|
||||
} catch (Exception e) {
|
||||
log.error("领域工作交接发送消息失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private String resolveSourceCode(String workProject) {
|
||||
if ("领域负责人".equals(workProject) || "领域审核人员".equals(workProject)) {
|
||||
return StringUtils.defaultIfEmpty(messageConfig.getDomainWorkChange(), messageConfig.getScoreTaskAssign());
|
||||
}
|
||||
return StringUtils.defaultIfEmpty(messageConfig.getDomainWorkChange(), messageConfig.getTaskAssign());
|
||||
}
|
||||
|
||||
private Map<String, Object> buildSendParams(DomainWorkChangeCmd domainWorkChangeCmd, String workProject, String workContent) {
|
||||
Map<String, Object> sendParams = new HashMap<>();
|
||||
sendParams.put("oldUserId", domainWorkChangeCmd.getOldUserId());
|
||||
sendParams.put("newUserId", domainWorkChangeCmd.getUserId());
|
||||
sendParams.put("newUserName", domainWorkChangeCmd.getUserName());
|
||||
sendParams.put("workProject", workProject);
|
||||
sendParams.put("workContent", workContent);
|
||||
sendParams.put("DomainDepartment", workContent);
|
||||
return sendParams;
|
||||
}
|
||||
|
||||
private String buildDomainDepartmentContent(DomainDepartmentDO domainDepartmentDO) {
|
||||
if (domainDepartmentDO == null) {
|
||||
return "领域配置";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainDepartmentDO.getDomainTypeName())) {
|
||||
return domainDepartmentDO.getDomainTypeName();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainDepartmentDO.getMasterDepartmentName())) {
|
||||
return domainDepartmentDO.getMasterDepartmentName();
|
||||
}
|
||||
return StringUtils.defaultIfEmpty(domainDepartmentDO.getDomainType(), "领域配置");
|
||||
}
|
||||
|
||||
private String buildDomainGroupContent(DomainGroupDO domainGroupDO) {
|
||||
if (domainGroupDO == null) {
|
||||
return "领域组配置";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainGroupDO.getDomainGroupName())) {
|
||||
return domainGroupDO.getDomainGroupName();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainGroupDO.getDomainTypeName())) {
|
||||
return domainGroupDO.getDomainTypeName();
|
||||
}
|
||||
return StringUtils.defaultIfEmpty(domainGroupDO.getDomainType(), "领域组配置");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.zcloud.domain.command.query;
|
||||
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentUserDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupDO;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupUserDO;
|
||||
import com.zcloud.domain.persistence.repository.DomainDepartmentRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainDepartmentUserRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainGroupRepository;
|
||||
import com.zcloud.domain.persistence.repository.DomainGroupUserRepository;
|
||||
import com.zcloud.gbscommon.zclouddomain.request.DomainQry;
|
||||
import com.zcloud.gbscommon.zclouddomain.response.DomainListByUserCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领域待交接工作查询执行器
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class DomainWorkQueryExe {
|
||||
private final DomainDepartmentRepository domainDepartmentRepository;
|
||||
private final DomainDepartmentUserRepository domainDepartmentUserRepository;
|
||||
private final DomainGroupRepository domainGroupRepository;
|
||||
private final DomainGroupUserRepository domainGroupUserRepository;
|
||||
|
||||
public List<DomainListByUserCO> execute(DomainQry domainQry) {
|
||||
List<DomainListByUserCO> result = new ArrayList<>();
|
||||
if (domainQry == null || domainQry.getUserId() == null || domainQry.getCorpinfoId() == null) {
|
||||
return result;
|
||||
}
|
||||
result.addAll(listDomainDepartmentWork(domainQry));
|
||||
result.addAll(listDomainDepartmentUserWork(domainQry));
|
||||
result.addAll(listDomainGroupWork(domainQry));
|
||||
result.addAll(listDomainGroupUserWork(domainQry));
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<DomainListByUserCO> listDomainDepartmentWork(DomainQry domainQry) {
|
||||
List<DomainDepartmentDO> domainDepartmentList = domainDepartmentRepository.listWorkByUserId(domainQry.getUserId(), domainQry.getCorpinfoId());
|
||||
List<DomainListByUserCO> result = new ArrayList<>();
|
||||
for (DomainDepartmentDO domainDepartmentDO : domainDepartmentList) {
|
||||
DomainDepartmentDO info = domainDepartmentRepository.getInfoByUUID(domainDepartmentDO.getDomainDepartmentId());
|
||||
DomainListByUserCO data = new DomainListByUserCO();
|
||||
data.setWorkId(domainDepartmentDO.getDomainDepartmentId());
|
||||
data.setWorkProject("领域负责人");
|
||||
data.setWorkContent(buildDomainDepartmentContent(info == null ? domainDepartmentDO : info));
|
||||
result.add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<DomainListByUserCO> listDomainDepartmentUserWork(DomainQry domainQry) {
|
||||
List<DomainDepartmentUserDO> domainDepartmentUserList = domainDepartmentUserRepository.listWorkByUserId(domainQry.getUserId(), domainQry.getCorpinfoId());
|
||||
List<DomainListByUserCO> result = new ArrayList<>();
|
||||
for (DomainDepartmentUserDO domainDepartmentUserDO : domainDepartmentUserList) {
|
||||
DomainDepartmentDO domainDepartmentDO = domainDepartmentRepository.getInfoByUUID(domainDepartmentUserDO.getDomainDepartmentId());
|
||||
DomainListByUserCO data = new DomainListByUserCO();
|
||||
data.setWorkId(domainDepartmentUserDO.getDomainDepartmentUserId());
|
||||
data.setWorkProject("领域审核人员");
|
||||
data.setWorkContent(buildDomainDepartmentContent(domainDepartmentDO));
|
||||
result.add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<DomainListByUserCO> listDomainGroupWork(DomainQry domainQry) {
|
||||
List<DomainGroupDO> domainGroupList = domainGroupRepository.listWorkByUserId(domainQry.getUserId(), domainQry.getCorpinfoId());
|
||||
List<DomainListByUserCO> result = new ArrayList<>();
|
||||
for (DomainGroupDO domainGroupDO : domainGroupList) {
|
||||
DomainGroupDO info = domainGroupRepository.getInfoByGroupId(domainGroupDO.getDomainGroupId());
|
||||
DomainListByUserCO data = new DomainListByUserCO();
|
||||
data.setWorkId(domainGroupDO.getDomainGroupId());
|
||||
data.setWorkProject("领域组组长");
|
||||
data.setWorkContent(buildDomainGroupContent(info == null ? domainGroupDO : info));
|
||||
result.add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<DomainListByUserCO> listDomainGroupUserWork(DomainQry domainQry) {
|
||||
List<DomainGroupUserDO> domainGroupUserList = domainGroupUserRepository.listWorkByUserId(domainQry.getUserId(), domainQry.getCorpinfoId());
|
||||
List<DomainListByUserCO> result = new ArrayList<>();
|
||||
for (DomainGroupUserDO domainGroupUserDO : domainGroupUserList) {
|
||||
DomainGroupDO domainGroupDO = domainGroupRepository.getInfoByGroupId(domainGroupUserDO.getDomainGroupId());
|
||||
DomainListByUserCO data = new DomainListByUserCO();
|
||||
data.setWorkId(domainGroupUserDO.getDomainGroupUserId());
|
||||
data.setWorkProject("领域组成员");
|
||||
data.setWorkContent(buildDomainGroupContent(domainGroupDO));
|
||||
result.add(data);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String buildDomainDepartmentContent(DomainDepartmentDO domainDepartmentDO) {
|
||||
if (domainDepartmentDO == null) {
|
||||
return "领域配置";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainDepartmentDO.getDomainTypeName())) {
|
||||
return domainDepartmentDO.getDomainTypeName();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainDepartmentDO.getMasterDepartmentName())) {
|
||||
return domainDepartmentDO.getMasterDepartmentName();
|
||||
}
|
||||
return StringUtils.defaultIfEmpty(domainDepartmentDO.getDomainType(), "领域配置");
|
||||
}
|
||||
|
||||
private String buildDomainGroupContent(DomainGroupDO domainGroupDO) {
|
||||
if (domainGroupDO == null) {
|
||||
return "领域组配置";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainGroupDO.getDomainGroupName())) {
|
||||
return domainGroupDO.getDomainGroupName();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(domainGroupDO.getDomainTypeName())) {
|
||||
return domainGroupDO.getDomainTypeName();
|
||||
}
|
||||
return StringUtils.defaultIfEmpty(domainGroupDO.getDomainType(), "领域组配置");
|
||||
}
|
||||
}
|
||||
|
|
@ -31,4 +31,9 @@ public class MessageConfig {
|
|||
* 评分任务待分配
|
||||
*/
|
||||
private String scoreTaskAssign;
|
||||
|
||||
/**
|
||||
* 领域工作交接通知
|
||||
*/
|
||||
private String domainWorkChange;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.jjb.saas.framework.datascope.annotation.DataScope;
|
|||
import com.jjb.saas.framework.datascope.annotation.DataScopes;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -29,5 +30,9 @@ public interface DomainDepartmentMapper extends BaseMapper<DomainDepartmentDO> {
|
|||
List<DomainDepartmentDO> listAll(Map<String, Object> params);
|
||||
|
||||
DomainDepartmentDO getInfoByUUID(String domainDepartmentId);
|
||||
|
||||
List<DomainDepartmentDO> listWorkByUserId(@Param("userId") Long userId, @Param("corpinfoId") Long corpinfoId);
|
||||
|
||||
DomainDepartmentDO getByWorkId(@Param("workId") String workId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainDepartmentUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -20,5 +21,13 @@ public interface DomainDepartmentUserMapper extends BaseMapper<DomainDepartmentU
|
|||
List<DomainDepartmentUserDO> getListByDomainDepartmentId(String domainDepartmentId);
|
||||
|
||||
IPage<DomainDepartmentUserDO> listPage(IPage<DomainDepartmentUserDO> iPage, Map<String, Object> params);
|
||||
|
||||
List<DomainDepartmentUserDO> listWorkByUserId(@Param("userId") Long userId, @Param("corpinfoId") Long corpinfoId);
|
||||
|
||||
DomainDepartmentUserDO getByWorkId(@Param("workId") String workId);
|
||||
|
||||
Long countByDomainDepartmentIdAndUserId(@Param("domainDepartmentId") String domainDepartmentId,
|
||||
@Param("userId") Long userId,
|
||||
@Param("excludeId") Long excludeId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.jjb.saas.framework.datascope.annotation.DataScope;
|
|||
import com.jjb.saas.framework.datascope.annotation.DataScopes;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -29,5 +30,9 @@ public interface DomainGroupMapper extends BaseMapper<DomainGroupDO> {
|
|||
List<DomainGroupDO> listAll(Map<String, Object> params);
|
||||
|
||||
DomainGroupDO getInfoByGroupId(String domainGroupId);
|
||||
|
||||
List<DomainGroupDO> listWorkByUserId(@Param("userId") Long userId, @Param("corpinfoId") Long corpinfoId);
|
||||
|
||||
DomainGroupDO getByWorkId(@Param("workId") String workId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zcloud.domain.persistence.dataobject.DomainGroupUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -20,5 +21,13 @@ public interface DomainGroupUserMapper extends BaseMapper<DomainGroupUserDO> {
|
|||
List<DomainGroupUserDO> getListByGroupId(String domainGroupId);
|
||||
|
||||
IPage<DomainGroupUserDO> listPage(IPage<DomainGroupUserDO> iPage, Map<String, Object> params);
|
||||
|
||||
List<DomainGroupUserDO> listWorkByUserId(@Param("userId") Long userId, @Param("corpinfoId") Long corpinfoId);
|
||||
|
||||
DomainGroupUserDO getByWorkId(@Param("workId") String workId);
|
||||
|
||||
Long countByDomainGroupIdAndUserId(@Param("domainGroupId") String domainGroupId,
|
||||
@Param("userId") Long userId,
|
||||
@Param("excludeId") Long excludeId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,9 @@ public interface DomainDepartmentRepository extends BaseRepository<DomainDepartm
|
|||
List<DomainDepartmentDO> listAll(Map<String, Object> params);
|
||||
|
||||
DomainDepartmentDO getInfoByUUID(String domainDepartmentId);
|
||||
|
||||
List<DomainDepartmentDO> listWorkByUserId(Long userId, Long corpinfoId);
|
||||
|
||||
DomainDepartmentDO getByWorkId(String workId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,5 +19,11 @@ public interface DomainDepartmentUserRepository extends BaseRepository<DomainDep
|
|||
void deleteByDomainDepartmentId(String domainDepartmentId);
|
||||
|
||||
List<DomainDepartmentUserDO> getListByDomainDepartmentId(String domainDepartmentId);
|
||||
|
||||
List<DomainDepartmentUserDO> listWorkByUserId(Long userId, Long corpinfoId);
|
||||
|
||||
DomainDepartmentUserDO getByWorkId(String workId);
|
||||
|
||||
Long countByDomainDepartmentIdAndUserId(String domainDepartmentId, Long userId, Long excludeId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,5 +26,9 @@ public interface DomainGroupRepository extends BaseRepository<DomainGroupDO> {
|
|||
|
||||
DomainGroupDO getInfoByGroupId(String domainGroupId);
|
||||
|
||||
List<DomainGroupDO> listWorkByUserId(Long userId, Long corpinfoId);
|
||||
|
||||
DomainGroupDO getByWorkId(String workId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,5 +20,11 @@ public interface DomainGroupUserRepository extends BaseRepository<DomainGroupUse
|
|||
|
||||
List<DomainGroupUserDO> getListByGroupId(String domainGroupId);
|
||||
|
||||
List<DomainGroupUserDO> listWorkByUserId(Long userId, Long corpinfoId);
|
||||
|
||||
DomainGroupUserDO getByWorkId(String workId);
|
||||
|
||||
Long countByDomainGroupIdAndUserId(String domainGroupId, Long userId, Long excludeId);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,5 +68,15 @@ public class DomainDepartmentRepositoryImpl extends BaseRepositoryImpl<DomainDep
|
|||
DomainDepartmentDO domainDepartmentDO = domainDepartmentMapper.getInfoByUUID(domainDepartmentId);
|
||||
return domainDepartmentDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainDepartmentDO> listWorkByUserId(Long userId, Long corpinfoId) {
|
||||
return domainDepartmentMapper.listWorkByUserId(userId, corpinfoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainDepartmentDO getByWorkId(String workId) {
|
||||
return domainDepartmentMapper.getByWorkId(workId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,5 +45,20 @@ public class DomainDepartmentUserRepositoryImpl extends BaseRepositoryImpl<Domai
|
|||
public List<DomainDepartmentUserDO> getListByDomainDepartmentId(String domainDepartmentId) {
|
||||
return domainDepartmentUserMapper.getListByDomainDepartmentId(domainDepartmentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainDepartmentUserDO> listWorkByUserId(Long userId, Long corpinfoId) {
|
||||
return domainDepartmentUserMapper.listWorkByUserId(userId, corpinfoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainDepartmentUserDO getByWorkId(String workId) {
|
||||
return domainDepartmentUserMapper.getByWorkId(workId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByDomainDepartmentIdAndUserId(String domainDepartmentId, Long userId, Long excludeId) {
|
||||
return domainDepartmentUserMapper.countByDomainDepartmentIdAndUserId(domainDepartmentId, userId, excludeId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,5 +66,15 @@ public class DomainGroupRepositoryImpl extends BaseRepositoryImpl<DomainGroupMap
|
|||
public DomainGroupDO getInfoByGroupId(String domainGroupId) {
|
||||
return domainGroupMapper.getInfoByGroupId(domainGroupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainGroupDO> listWorkByUserId(Long userId, Long corpinfoId) {
|
||||
return domainGroupMapper.listWorkByUserId(userId, corpinfoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainGroupDO getByWorkId(String workId) {
|
||||
return domainGroupMapper.getByWorkId(workId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,5 +46,20 @@ public class DomainGroupUserRepositoryImpl extends BaseRepositoryImpl<DomainGrou
|
|||
public List<DomainGroupUserDO> getListByGroupId(String domainGroupId) {
|
||||
return domainGroupUserMapper.getListByGroupId(domainGroupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainGroupUserDO> listWorkByUserId(Long userId, Long corpinfoId) {
|
||||
return domainGroupUserMapper.listWorkByUserId(userId, corpinfoId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainGroupUserDO getByWorkId(String workId) {
|
||||
return domainGroupUserMapper.getByWorkId(workId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long countByDomainGroupIdAndUserId(String domainGroupId, Long userId, Long excludeId) {
|
||||
return domainGroupUserMapper.countByDomainGroupIdAndUserId(domainGroupId, userId, excludeId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,5 +49,24 @@
|
|||
where dd.delete_enum = 'FALSE'
|
||||
and dd.domain_department_id = #{domainDepartmentId}
|
||||
</select>
|
||||
|
||||
<select id="listWorkByUserId" resultType="com.zcloud.domain.persistence.dataobject.DomainDepartmentDO">
|
||||
select dd.*, d.name as masterDepartmentName, u.name as masterUserName
|
||||
from domain_department dd
|
||||
left join department d on dd.master_department_id = d.id and d.delete_enum = 'FALSE'
|
||||
left join user u on dd.master_user_id = u.id and u.delete_enum = 'FALSE'
|
||||
where dd.delete_enum = 'FALSE'
|
||||
and dd.master_user_id = #{userId}
|
||||
and d.corpinfo_id = #{corpinfoId}
|
||||
</select>
|
||||
|
||||
<select id="getByWorkId" resultType="com.zcloud.domain.persistence.dataobject.DomainDepartmentDO">
|
||||
select dd.*, d.name as masterDepartmentName, u.name as masterUserName
|
||||
from domain_department dd
|
||||
left join department d on dd.master_department_id = d.id and d.delete_enum = 'FALSE'
|
||||
left join user u on dd.master_user_id = u.id and u.delete_enum = 'FALSE'
|
||||
where dd.delete_enum = 'FALSE'
|
||||
and dd.domain_department_id = #{workId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,36 @@
|
|||
and ddu.domain_department_id = #{params.domainDepartmentId}
|
||||
order by ddu.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listWorkByUserId" resultType="com.zcloud.domain.persistence.dataobject.DomainDepartmentUserDO">
|
||||
select ddu.*, d.name as departmentname, u.name as username, c.corp_name as corpinfoName, c.id as corpinfoId
|
||||
from domain_department_user ddu
|
||||
left join department d on ddu.department_id = d.id and d.delete_enum = 'FALSE'
|
||||
left join corp_info c on d.corpinfo_id = c.id and c.delete_enum = 'FALSE'
|
||||
left join user u on ddu.user_id = u.id and u.delete_enum = 'FALSE'
|
||||
where ddu.delete_enum = 'FALSE'
|
||||
and ddu.user_id = #{userId}
|
||||
and d.corpinfo_id = #{corpinfoId}
|
||||
order by ddu.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getByWorkId" resultType="com.zcloud.domain.persistence.dataobject.DomainDepartmentUserDO">
|
||||
select ddu.*, d.name as departmentname, u.name as username, c.corp_name as corpinfoName, c.id as corpinfoId
|
||||
from domain_department_user ddu
|
||||
left join department d on ddu.department_id = d.id and d.delete_enum = 'FALSE'
|
||||
left join corp_info c on d.corpinfo_id = c.id and c.delete_enum = 'FALSE'
|
||||
left join user u on ddu.user_id = u.id and u.delete_enum = 'FALSE'
|
||||
where ddu.delete_enum = 'FALSE'
|
||||
and ddu.domain_department_user_id = #{workId}
|
||||
</select>
|
||||
|
||||
<select id="countByDomainDepartmentIdAndUserId" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from domain_department_user ddu
|
||||
where ddu.delete_enum = 'FALSE'
|
||||
and ddu.domain_department_id = #{domainDepartmentId}
|
||||
and ddu.user_id = #{userId}
|
||||
and ddu.id <![CDATA[<>]]> #{excludeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,5 +70,32 @@
|
|||
left join user u on dg.team_user_id = u.id and u.delete_enum = 'false'
|
||||
where dg.delete_enum = 'false' and dg.domain_group_id=#{domainGroupId}
|
||||
</select>
|
||||
|
||||
<select id="listWorkByUserId" resultType="com.zcloud.domain.persistence.dataobject.DomainGroupDO">
|
||||
select dg.*,
|
||||
c.corp_name as corpinfoname,
|
||||
d.name as teamdepartmentname,
|
||||
u.name as teamusername
|
||||
from domain_group dg
|
||||
left join corp_info c on dg.corpinfo_id = c.id and c.delete_enum = 'false'
|
||||
left join department d on dg.team_department_id = d.id and d.delete_enum = 'false'
|
||||
left join user u on dg.team_user_id = u.id and u.delete_enum = 'false'
|
||||
where dg.delete_enum = 'false'
|
||||
and dg.team_user_id = #{userId}
|
||||
and dg.corpinfo_id = #{corpinfoId}
|
||||
</select>
|
||||
|
||||
<select id="getByWorkId" resultType="com.zcloud.domain.persistence.dataobject.DomainGroupDO">
|
||||
select dg.*,
|
||||
c.corp_name as corpinfoname,
|
||||
d.name as teamdepartmentname,
|
||||
u.name as teamusername
|
||||
from domain_group dg
|
||||
left join corp_info c on dg.corpinfo_id = c.id and c.delete_enum = 'false'
|
||||
left join department d on dg.team_department_id = d.id and d.delete_enum = 'false'
|
||||
left join user u on dg.team_user_id = u.id and u.delete_enum = 'false'
|
||||
where dg.delete_enum = 'false'
|
||||
and dg.domain_group_id = #{workId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,36 @@
|
|||
group by dgu.id
|
||||
order by dgu.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listWorkByUserId" resultType="com.zcloud.domain.persistence.dataobject.DomainGroupUserDO">
|
||||
select dgu.*, d.name as departmentname, u.name as username
|
||||
from domain_group_user dgu
|
||||
left join department d on dgu.department_id = d.id and d.delete_enum = 'false'
|
||||
left join user u on dgu.user_id = u.id and u.delete_enum = 'false'
|
||||
left join domain_group dg on dgu.domain_group_id = dg.domain_group_id and dg.delete_enum = 'false'
|
||||
where dgu.delete_enum = 'false'
|
||||
and dgu.user_id = #{userId}
|
||||
and dg.corpinfo_id = #{corpinfoId}
|
||||
group by dgu.id
|
||||
order by dgu.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getByWorkId" resultType="com.zcloud.domain.persistence.dataobject.DomainGroupUserDO">
|
||||
select dgu.*, d.name as departmentname, u.name as username
|
||||
from domain_group_user dgu
|
||||
left join department d on dgu.department_id = d.id and d.delete_enum = 'false'
|
||||
left join user u on dgu.user_id = u.id and u.delete_enum = 'false'
|
||||
where dgu.delete_enum = 'false'
|
||||
and dgu.domain_group_user_id = #{workId}
|
||||
</select>
|
||||
|
||||
<select id="countByDomainGroupIdAndUserId" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from domain_group_user dgu
|
||||
where dgu.delete_enum = 'FALSE'
|
||||
and dgu.domain_group_id = #{domainGroupId}
|
||||
and dgu.user_id = #{userId}
|
||||
and dgu.id <![CDATA[<>]]> #{excludeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue