Merge remote-tracking branch 'upstream/develop' into crm-msg
commit
231fd68435
@ -1,14 +0,0 @@
|
||||
-- `ruoyi-vue-pro`.crm_contact_business_link definition
|
||||
|
||||
CREATE TABLE `crm_contact_business` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`contact_id` int(11) DEFAULT NULL COMMENT '联系人id',
|
||||
`business_id` int(11) DEFAULT NULL COMMENT '商机id',
|
||||
`creator` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='联系人商机关联表';
|
||||
@ -1,22 +0,0 @@
|
||||
CREATE TABLE product_browse_history
|
||||
(
|
||||
id bigint AUTO_INCREMENT COMMENT '记录编号'
|
||||
PRIMARY KEY,
|
||||
user_id bigint NOT NULL COMMENT '用户编号',
|
||||
spu_id bigint NOT NULL COMMENT '商品 SPU 编号',
|
||||
user_deleted bit DEFAULT b'0' NOT NULL COMMENT '用户是否删除',
|
||||
creator varchar(64) DEFAULT '' NULL COMMENT '创建者',
|
||||
create_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL COMMENT '创建时间',
|
||||
updater varchar(64) DEFAULT '' NULL COMMENT '更新者',
|
||||
update_time datetime DEFAULT CURRENT_TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
deleted bit DEFAULT b'0' NOT NULL COMMENT '是否删除',
|
||||
tenant_id bigint DEFAULT 0 NOT NULL COMMENT '租户编号'
|
||||
)
|
||||
COMMENT '商品浏览记录表';
|
||||
|
||||
CREATE INDEX idx_spuId
|
||||
ON product_browse_history (spu_id);
|
||||
|
||||
CREATE INDEX idx_userId
|
||||
ON product_browse_history (user_id);
|
||||
|
||||
@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class BpmCandidateSourceInfoProcessorChain {
|
||||
|
||||
// 保存处理节点
|
||||
|
||||
private List<BpmCandidateSourceInfoProcessor> processorList;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
/**
|
||||
* 可添加其他处理器
|
||||
*
|
||||
* @param processorOp
|
||||
* @return
|
||||
*/
|
||||
@Resource
|
||||
// 动态扩展处理节点
|
||||
public BpmCandidateSourceInfoProcessorChain addProcessor(ObjectProvider<BpmCandidateSourceInfoProcessor> processorOp) {
|
||||
List<BpmCandidateSourceInfoProcessor> processor = ListUtil.toList(processorOp.iterator());
|
||||
if (null == processorList) {
|
||||
processorList = new ArrayList<>(processor.size());
|
||||
}
|
||||
processorList.addAll(processor);
|
||||
return this;
|
||||
}
|
||||
|
||||
// 获取处理器处理
|
||||
public Set<Long> process(BpmCandidateSourceInfo sourceInfo, DelegateExecution execution) throws Exception {
|
||||
// Verify our parameters
|
||||
if (sourceInfo == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
for (BpmCandidateSourceInfoProcessor processor : processorList) {
|
||||
try {
|
||||
for (BpmTaskCandidateRuleVO vo : sourceInfo.getRules()) {
|
||||
if (CollUtil.contains(processor.getSupportedTypes(), vo.getType())) {
|
||||
processor.validRuleOptions(vo.getType(), vo.getOptions());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
Set<Long> saveResult = Collections.emptySet();
|
||||
Exception saveException = null;
|
||||
for (BpmCandidateSourceInfoProcessor processor : processorList) {
|
||||
try {
|
||||
saveResult = processor.process(sourceInfo, execution);
|
||||
if (CollUtil.isNotEmpty(saveResult)) {
|
||||
removeDisableUsers(saveResult);
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
saveException = e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Return the exception or result state from the last execute()
|
||||
if ((saveException != null)) {
|
||||
throw saveException;
|
||||
} else {
|
||||
return (saveResult);
|
||||
}
|
||||
}
|
||||
|
||||
public Set<Long> calculateTaskCandidateUsers(DelegateExecution execution, BpmCandidateSourceInfo sourceInfo) {
|
||||
Set<Long> results = Collections.emptySet();
|
||||
try {
|
||||
results = process(sourceInfo, execution);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除禁用用户
|
||||
*
|
||||
* @param assigneeUserIds
|
||||
*/
|
||||
public void removeDisableUsers(Set<Long> assigneeUserIds) {
|
||||
if (CollUtil.isEmpty(assigneeUserIds)) {
|
||||
return;
|
||||
}
|
||||
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(assigneeUserIds);
|
||||
assigneeUserIds.removeIf(id -> {
|
||||
AdminUserRespDTO user = userMap.get(id);
|
||||
return user == null || !CommonStatusEnum.ENABLE.getStatus().equals(user.getStatus());
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Set;
|
||||
|
||||
public class BpmCandidateAdminUserApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private AdminUserApi api;
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.USER.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
api.validateUserList(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
return rule.getOptions();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
public class BpmCandidateDeptApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private DeptApi api;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(),
|
||||
BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
api.validateDeptList(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
if (Objects.equals(BpmTaskAssignRuleTypeEnum.DEPT_MEMBER.getType(), rule.getType())) {
|
||||
List<AdminUserRespDTO> users = adminUserApi.getUserListByDeptIds(rule.getOptions());
|
||||
return convertSet(users, AdminUserRespDTO::getId);
|
||||
} else if (Objects.equals(BpmTaskAssignRuleTypeEnum.DEPT_LEADER.getType(), rule.getType())) {
|
||||
List<DeptRespDTO> depts = api.getDeptList(rule.getOptions());
|
||||
return convertSet(depts, DeptRespDTO::getLeaderUserId);
|
||||
}
|
||||
return Collections.emptySet();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
public class BpmCandidatePostApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private PostApi api;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.POST.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
api.validPostList(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
List<AdminUserRespDTO> users = adminUserApi.getUserListByPostIds(rule.getOptions());
|
||||
return convertSet(users, AdminUserRespDTO::getId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.Set;
|
||||
|
||||
public class BpmCandidateRoleApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private RoleApi api;
|
||||
|
||||
@Resource
|
||||
private PermissionApi permissionApi;
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.ROLE.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
api.validRoleList(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
return permissionApi.getUserRoleIdListByRoleIds(rule.getOptions());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.DictTypeConstants;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.behavior.script.BpmTaskAssignScript;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.TASK_ASSIGN_SCRIPT_NOT_EXISTS;
|
||||
|
||||
public class BpmCandidateScriptApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
/**
|
||||
* 任务分配脚本
|
||||
*/
|
||||
private Map<Long, BpmTaskAssignScript> scriptMap = Collections.emptyMap();
|
||||
|
||||
public void setScripts(ObjectProvider<BpmTaskAssignScript> scriptsOp) {
|
||||
List<BpmTaskAssignScript> scripts = scriptsOp.orderedStream().collect(Collectors.toList());
|
||||
setScripts(scripts);
|
||||
}
|
||||
|
||||
public void setScripts(List<BpmTaskAssignScript> scripts) {
|
||||
this.scriptMap = convertMap(scripts, script -> script.getEnum().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.SCRIPT.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
dictDataApi.validateDictDataList(DictTypeConstants.TASK_ASSIGN_SCRIPT,
|
||||
CollectionUtils.convertSet(options, String::valueOf));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
return calculateTaskCandidateUsersByScript(delegateExecution, rule.getOptions());
|
||||
}
|
||||
|
||||
private Set<Long> calculateTaskCandidateUsersByScript(DelegateExecution execution, Set<Long> options) {
|
||||
// 获得对应的脚本
|
||||
List<BpmTaskAssignScript> scripts = new ArrayList<>(options.size());
|
||||
options.forEach(id -> {
|
||||
BpmTaskAssignScript script = scriptMap.get(id);
|
||||
if (script == null) {
|
||||
throw exception(TASK_ASSIGN_SCRIPT_NOT_EXISTS, id);
|
||||
}
|
||||
scripts.add(script);
|
||||
});
|
||||
// 逐个计算任务
|
||||
Set<Long> userIds = new HashSet<>();
|
||||
scripts.forEach(script -> CollUtil.addAll(userIds, script.calculateTaskCandidateUsers(execution)));
|
||||
return userIds;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.candidate.sourceInfoProcessor;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.SetUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.candidate.vo.BpmTaskCandidateRuleVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmTaskAssignRuleTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfo;
|
||||
import cn.iocoder.yudao.module.bpm.service.candidate.BpmCandidateSourceInfoProcessor;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmUserGroupService;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class BpmCandidateUserGroupApiSourceInfoProcessor implements BpmCandidateSourceInfoProcessor {
|
||||
@Resource
|
||||
private BpmUserGroupService api;
|
||||
@Resource
|
||||
private BpmUserGroupService userGroupService;
|
||||
|
||||
@Override
|
||||
public Set<Integer> getSupportedTypes() {
|
||||
return SetUtils.asSet(BpmTaskAssignRuleTypeEnum.USER_GROUP.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validRuleOptions(Integer type, Set<Long> options) {
|
||||
api.validUserGroups(options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> doProcess(BpmCandidateSourceInfo request, BpmTaskCandidateRuleVO rule, DelegateExecution delegateExecution) {
|
||||
List<BpmUserGroupDO> userGroups = userGroupService.getUserGroupList(rule.getOptions());
|
||||
Set<Long> userIds = new HashSet<>();
|
||||
userGroups.forEach(group -> userIds.addAll(group.getMemberUserIds()));
|
||||
return userIds;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,439 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.cc.dto;
|
||||
|
||||
import org.flowable.bpmn.model.FlowElement;
|
||||
import org.flowable.bpmn.model.FlowableListener;
|
||||
import org.flowable.engine.delegate.DelegateExecution;
|
||||
import org.flowable.engine.delegate.ReadOnlyDelegateExecution;
|
||||
import org.flowable.variable.api.persistence.entity.VariableInstance;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 仅为了传输processInstanceId
|
||||
*/
|
||||
public class BpmDelegateExecutionDTO implements DelegateExecution {
|
||||
|
||||
public BpmDelegateExecutionDTO(String getProcessInstanceId) {
|
||||
this.getProcessInstanceId = getProcessInstanceId;
|
||||
}
|
||||
|
||||
private final String getProcessInstanceId;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessInstanceId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRootProcessInstanceId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEventName(String eventName) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessInstanceBusinessKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessInstanceBusinessStatus() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProcessDefinitionId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPropagatedStageInstanceId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParentId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSuperExecutionId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrentActivityId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTenantId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowElement getCurrentFlowElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentFlowElement(FlowElement flowElement) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlowableListener getCurrentFlowableListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCurrentFlowableListener(FlowableListener currentListener) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReadOnlyDelegateExecution snapshotReadOnly() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DelegateExecution getParent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends DelegateExecution> getExecutions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActive(boolean isActive) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnded() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConcurrent(boolean isConcurrent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConcurrent() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProcessInstanceType() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inactivate() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isScope() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScope(boolean isScope) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMultiInstanceRoot() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMultiInstanceRoot(boolean isMultiInstanceRoot) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstances() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariables(Collection<String> collection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstances(Collection<String> collection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariables(Collection<String> collection, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstances(Collection<String> collection, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariablesLocal() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstancesLocal() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariablesLocal(Collection<String> collection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstancesLocal(Collection<String> collection) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getVariablesLocal(Collection<String> collection, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, VariableInstance> getVariableInstancesLocal(Collection<String> collection, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVariable(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VariableInstance getVariableInstance(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVariable(String s, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VariableInstance getVariableInstance(String s, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVariableLocal(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VariableInstance getVariableInstanceLocal(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVariableLocal(String s, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VariableInstance getVariableInstanceLocal(String s, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getVariable(String s, Class<T> aClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getVariableLocal(String s, Class<T> aClass) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getVariableNames() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getVariableNamesLocal() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariable(String s, Object o) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariable(String s, Object o, boolean b) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object setVariableLocal(String s, Object o) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object setVariableLocal(String s, Object o, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariables(Map<String, ?> map) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVariablesLocal(Map<String, ?> map) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasVariables() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasVariablesLocal() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasVariable(String s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasVariableLocal(String s) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariable(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariableLocal(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariables(Collection<String> collection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariablesLocal(Collection<String> collection) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariables() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVariablesLocal() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransientVariable(String s, Object o) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransientVariableLocal(String s, Object o) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransientVariables(Map<String, Object> map) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTransientVariable(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTransientVariables() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransientVariablesLocal(Map<String, Object> map) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getTransientVariableLocal(String s) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getTransientVariablesLocal() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTransientVariableLocal(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTransientVariable(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTransientVariables() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeTransientVariablesLocal() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.cc;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import({BpmProcessInstanceCopyServiceImpl.class})
|
||||
class BpmProcessInstanceCopyServiceTest extends BaseDbUnitTest {
|
||||
@Resource
|
||||
private BpmProcessInstanceCopyServiceImpl service;
|
||||
|
||||
@Test
|
||||
void queryById() {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.crm.controller.admin.business.vo.product;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 商机产品关联 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CrmBusinessProductRespVO {
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.crm.service.followup.bo;
|
||||
|
||||
import com.mzt.logapi.starter.annotation.DiffLogField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 跟进信息 Update Req BO
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Data
|
||||
public class CrmUpdateFollowUpReqBO {
|
||||
|
||||
@Schema(description = "数据编号", example = "3167")
|
||||
@NotNull(message = "数据编号不能为空")
|
||||
private Long bizId;
|
||||
|
||||
@Schema(description = "最后跟进时间")
|
||||
@DiffLogField(name = "最后跟进时间")
|
||||
@NotNull(message = "最后跟进时间不能为空")
|
||||
private LocalDateTime contactLastTime;
|
||||
|
||||
@Schema(description = "下次联系时间")
|
||||
@DiffLogField(name = "下次联系时间")
|
||||
private LocalDateTime contactNextTime;
|
||||
|
||||
@Schema(description = "最后更进内容")
|
||||
@DiffLogField(name = "最后更进内容")
|
||||
@NotNull(message = "最后更进内容不能为空")
|
||||
private String contactLastContent;
|
||||
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
### /promotion/decorate/save 保存页面装修组件
|
||||
POST {{baseUrl}}/promotion/decorate/save
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
{
|
||||
"page": 1,
|
||||
"code": "slide-show",
|
||||
"status": 0,
|
||||
"value": "null"
|
||||
}
|
||||
|
||||
### /promotion/decorate/list 获取指定页面的组件列表
|
||||
GET {{baseUrl}}/promotion/decorate/list?page=1
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{token}}
|
||||
tenant-id: {{adminTenentId}}
|
||||
@ -1,50 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.decorate;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo.DecorateComponentRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo.DecorateComponentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.decorate.DecorateComponentConvert;
|
||||
import cn.iocoder.yudao.module.promotion.enums.decorate.DecoratePageEnum;
|
||||
import cn.iocoder.yudao.module.promotion.service.decorate.DecorateComponentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 店铺页面装修")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/decorate")
|
||||
@Validated
|
||||
public class DecorateComponentController {
|
||||
|
||||
@Resource
|
||||
private DecorateComponentService decorateComponentService;
|
||||
|
||||
@PostMapping("/save")
|
||||
@Operation(summary = "保存页面装修组件")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:decorate:save')")
|
||||
public CommonResult<Boolean> saveDecorateComponent(@Valid @RequestBody DecorateComponentSaveReqVO reqVO) {
|
||||
decorateComponentService.saveDecorateComponent(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取指定页面的组件列表")
|
||||
@Parameter(name = "page", description = "页面 id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:decorate:query')")
|
||||
public CommonResult<List<DecorateComponentRespVO>> getDecorateComponentListByPage(
|
||||
@RequestParam("page") @InEnum(DecoratePageEnum.class) Integer page) {
|
||||
return success(DecorateComponentConvert.INSTANCE.convertList02(
|
||||
decorateComponentService.getDecorateComponentListByPage(page, null)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 页面装修 Resp VO")
|
||||
@Data
|
||||
public class DecorateComponentRespVO {
|
||||
|
||||
@Schema(description = "组件编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "nav-menu")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "组件的内容配置项", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "TODO")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.enums.decorate.DecoratePageEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 页面装修的保存 Request VO ")
|
||||
@Data
|
||||
public class DecorateComponentSaveReqVO {
|
||||
|
||||
@Schema(description = "页面 id ", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "页面 id 不能为空")
|
||||
@InEnum(DecoratePageEnum.class)
|
||||
private Integer page;
|
||||
|
||||
@Schema(description = "组件编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "nav-menu")
|
||||
@NotEmpty(message = "组件编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "组件对应值, json 字符串, 含内容配置,具体数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "组件值为空")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app.decorate;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.decorate.vo.AppDecorateComponentRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.decorate.DecorateComponentConvert;
|
||||
import cn.iocoder.yudao.module.promotion.enums.decorate.DecoratePageEnum;
|
||||
import cn.iocoder.yudao.module.promotion.service.decorate.DecorateComponentService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 APP - 店铺装修")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/decorate")
|
||||
@Validated
|
||||
@Deprecated // 废弃
|
||||
public class AppDecorateController {
|
||||
|
||||
@Resource
|
||||
private DecorateComponentService decorateComponentService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取指定页面的组件列表")
|
||||
@Parameter(name = "page", description = "页面编号", required = true)
|
||||
public CommonResult<List<AppDecorateComponentRespVO>> getDecorateComponentListByPage(
|
||||
@RequestParam("page") @InEnum(DecoratePageEnum.class) Integer page) {
|
||||
return success(DecorateComponentConvert.INSTANCE.convertList(
|
||||
decorateComponentService.getDecorateComponentListByPage(page, CommonStatusEnum.ENABLE.getStatus())));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.app.decorate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "用户 App - 页面组件 Resp VO")
|
||||
@Data
|
||||
public class AppDecorateComponentRespVO {
|
||||
|
||||
@Schema(description = "组件编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "nav-menu")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "组件的内容配置项", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "TODO")
|
||||
private String value;
|
||||
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.convert.decorate;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo.DecorateComponentRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo.DecorateComponentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.controller.app.decorate.vo.AppDecorateComponentRespVO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.decorate.DecorateComponentDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DecorateComponentConvert {
|
||||
|
||||
DecorateComponentConvert INSTANCE = Mappers.getMapper(DecorateComponentConvert.class);
|
||||
|
||||
List<DecorateComponentRespVO> convertList02(List<DecorateComponentDO> list);
|
||||
|
||||
DecorateComponentDO convert(DecorateComponentSaveReqVO bean);
|
||||
|
||||
List<AppDecorateComponentRespVO> convertList(List<DecorateComponentDO> list);
|
||||
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.dal.mysql.decorate;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.decorate.DecorateComponentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DecorateComponentMapper extends BaseMapperX<DecorateComponentDO> {
|
||||
|
||||
default List<DecorateComponentDO> selectListByPageAndStatus(Integer page, Integer status) {
|
||||
return selectList(new LambdaQueryWrapperX<DecorateComponentDO>()
|
||||
.eq(DecorateComponentDO::getPage, page)
|
||||
.eqIfPresent(DecorateComponentDO::getStatus, status));
|
||||
}
|
||||
|
||||
default DecorateComponentDO selectByPageAndCode(Integer page, String code) {
|
||||
return selectOne(DecorateComponentDO::getPage, page,
|
||||
DecorateComponentDO::getCode, code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,40 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.decorate;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.decorate.vo.DecorateComponentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.decorate.DecorateComponentConvert;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.decorate.DecorateComponentDO;
|
||||
import cn.iocoder.yudao.module.promotion.dal.mysql.decorate.DecorateComponentMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 装修组件 Service 实现
|
||||
*
|
||||
* @author jason
|
||||
*/
|
||||
@Service
|
||||
public class DecorateComponentServiceImpl implements DecorateComponentService {
|
||||
|
||||
@Resource
|
||||
private DecorateComponentMapper decorateComponentMapper;
|
||||
|
||||
@Override
|
||||
public void saveDecorateComponent(DecorateComponentSaveReqVO reqVO) {
|
||||
// 1. 如果存在,则进行更新
|
||||
DecorateComponentDO dbComponent = decorateComponentMapper.selectByPageAndCode(reqVO.getPage(), reqVO.getCode());
|
||||
if (dbComponent != null) {
|
||||
decorateComponentMapper.updateById(DecorateComponentConvert.INSTANCE.convert(reqVO).setId(dbComponent.getId()));
|
||||
return;
|
||||
}
|
||||
// 2. 不存在,则进行新增
|
||||
decorateComponentMapper.insert(DecorateComponentConvert.INSTANCE.convert(reqVO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DecorateComponentDO> getDecorateComponentListByPage(Integer page, Integer status) {
|
||||
return decorateComponentMapper.selectListByPageAndStatus(page, status);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.decorate;
|
||||
|
||||
import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
|
||||
import cn.iocoder.yudao.module.promotion.dal.mysql.decorate.DecorateComponentMapper;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
|
||||
// TODO @芋艿:后续 review 下
|
||||
/**
|
||||
* @author jason
|
||||
*/
|
||||
public class DecorateComponentServiceImplTest extends BaseMockitoUnitTest {
|
||||
|
||||
@InjectMocks
|
||||
private DecorateComponentServiceImpl decoratePageService;
|
||||
|
||||
@Mock
|
||||
private DecorateComponentMapper decorateComponentMapper;
|
||||
|
||||
@BeforeEach
|
||||
public void init(){
|
||||
|
||||
}
|
||||
|
||||
// @Test
|
||||
// void testResp(){
|
||||
// List<DecorateComponentDO> list = new ArrayList<>(1);
|
||||
// DecorateComponentDO decorateDO = new DecorateComponentDO()
|
||||
// .setPage(INDEX.getPage()).setValue("")
|
||||
// .setCode(ROLLING_NEWS.getCode()).setId(1L);
|
||||
// list.add(decorateDO);
|
||||
// //mock 方法
|
||||
// Mockito.when(decorateComponentMapper.selectListByPageAndStatus(eq(1))).thenReturn(list);
|
||||
// }
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue