From 507a2aef41e4116a247cc87c4a6b42fb44be05d9 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Fri, 4 Sep 2020 11:34:55 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=AE=80=E5=8D=95=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ccsens/mt/bean/vo/CompeteVo.java | 15 +++++++++++++++ .../resources/mapper_dao/CompetePlayerDao.xml | 12 ++++++------ .../main/resources/mapper_dao/CompeteTeamDao.xml | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java index b21d9494..8f46dbc0 100644 --- a/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java +++ b/mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java @@ -142,6 +142,21 @@ public class CompeteVo { private String qrCode; @ApiModelProperty("团队内的成员") private List members; +// +// public CompeteTeamProject(Long teamId, byte type, String parentProjectName, String secondProjectName, byte certificate, byte creator, int memberMin, int memberMax, String qrCode) { +// this.teamId = teamId; +// this.type = type; +// this.parentProjectName = parentProjectName; +// this.secondProjectName = secondProjectName; +// this.certificate = certificate; +// this.creator = creator; +// this.memberMin = memberMin; +// this.memberMax = memberMax; +// this.qrCode = qrCode; +// } + + public CompeteTeamProject() { + } public CompeteTeamProject(CompeteTeam team, byte isCreator, com.ccsens.mt.bean.po.CompeteProject project, String parentProjectName, List members) { this.teamId = team.getId(); diff --git a/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml b/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml index 1ba0c914..a943bcff 100644 --- a/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml +++ b/mt/src/main/resources/mapper_dao/CompetePlayerDao.xml @@ -4,7 +4,7 @@ + SELECT id FROM `t_level_up` WHERE level_user_id = #{levelUserId} and compete_code = #{competeCode} + + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml b/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml new file mode 100644 index 00000000..9bdb92cd --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelRuleMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, compete_time_id, compete_code_now, compete_code_level_up, rule, level_condition, + auto_level, compete_order, created_at, updated_at, rec_status + + + + + delete from t_level_rule + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_rule + + + + + + insert into t_level_rule (id, compete_time_id, compete_code_now, + compete_code_level_up, rule, level_condition, + auto_level, compete_order, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{competeCodeNow,jdbcType=VARCHAR}, + #{competeCodeLevelUp,jdbcType=VARCHAR}, #{rule,jdbcType=TINYINT}, #{levelCondition,jdbcType=INTEGER}, + #{autoLevel,jdbcType=TINYINT}, #{competeOrder,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_rule + + + id, + + + compete_time_id, + + + compete_code_now, + + + compete_code_level_up, + + + rule, + + + level_condition, + + + auto_level, + + + compete_order, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{competeTimeId,jdbcType=BIGINT}, + + + #{competeCodeNow,jdbcType=VARCHAR}, + + + #{competeCodeLevelUp,jdbcType=VARCHAR}, + + + #{rule,jdbcType=TINYINT}, + + + #{levelCondition,jdbcType=INTEGER}, + + + #{autoLevel,jdbcType=TINYINT}, + + + #{competeOrder,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_rule + + + id = #{record.id,jdbcType=BIGINT}, + + + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + + + compete_code_now = #{record.competeCodeNow,jdbcType=VARCHAR}, + + + compete_code_level_up = #{record.competeCodeLevelUp,jdbcType=VARCHAR}, + + + rule = #{record.rule,jdbcType=TINYINT}, + + + level_condition = #{record.levelCondition,jdbcType=INTEGER}, + + + auto_level = #{record.autoLevel,jdbcType=TINYINT}, + + + compete_order = #{record.competeOrder,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_rule + set id = #{record.id,jdbcType=BIGINT}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + compete_code_now = #{record.competeCodeNow,jdbcType=VARCHAR}, + compete_code_level_up = #{record.competeCodeLevelUp,jdbcType=VARCHAR}, + rule = #{record.rule,jdbcType=TINYINT}, + level_condition = #{record.levelCondition,jdbcType=INTEGER}, + auto_level = #{record.autoLevel,jdbcType=TINYINT}, + compete_order = #{record.competeOrder,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_rule + + + compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + + + compete_code_now = #{competeCodeNow,jdbcType=VARCHAR}, + + + compete_code_level_up = #{competeCodeLevelUp,jdbcType=VARCHAR}, + + + rule = #{rule,jdbcType=TINYINT}, + + + level_condition = #{levelCondition,jdbcType=INTEGER}, + + + auto_level = #{autoLevel,jdbcType=TINYINT}, + + + compete_order = #{competeOrder,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_rule + set compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + compete_code_now = #{competeCodeNow,jdbcType=VARCHAR}, + compete_code_level_up = #{competeCodeLevelUp,jdbcType=VARCHAR}, + rule = #{rule,jdbcType=TINYINT}, + level_condition = #{levelCondition,jdbcType=INTEGER}, + auto_level = #{autoLevel,jdbcType=TINYINT}, + compete_order = #{competeOrder,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/LevelUpMapper.xml b/mt/src/main/resources/mapper_raw/LevelUpMapper.xml new file mode 100644 index 00000000..86c97dd8 --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelUpMapper.xml @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, compete_time_id, compete_code, level_user_id, score, addition_score, ranking, + level_up_type, created_at, updated_at, rec_status + + + + + delete from t_level_up + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_up + + + + + + insert into t_level_up (id, compete_time_id, compete_code, + level_user_id, score, addition_score, + ranking, level_up_type, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{competeCode,jdbcType=VARCHAR}, + #{levelUserId,jdbcType=BIGINT}, #{score,jdbcType=INTEGER}, #{additionScore,jdbcType=INTEGER}, + #{ranking,jdbcType=INTEGER}, #{levelUpType,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_up + + + id, + + + compete_time_id, + + + compete_code, + + + level_user_id, + + + score, + + + addition_score, + + + ranking, + + + level_up_type, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{competeTimeId,jdbcType=BIGINT}, + + + #{competeCode,jdbcType=VARCHAR}, + + + #{levelUserId,jdbcType=BIGINT}, + + + #{score,jdbcType=INTEGER}, + + + #{additionScore,jdbcType=INTEGER}, + + + #{ranking,jdbcType=INTEGER}, + + + #{levelUpType,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_up + + + id = #{record.id,jdbcType=BIGINT}, + + + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + + + level_user_id = #{record.levelUserId,jdbcType=BIGINT}, + + + score = #{record.score,jdbcType=INTEGER}, + + + addition_score = #{record.additionScore,jdbcType=INTEGER}, + + + ranking = #{record.ranking,jdbcType=INTEGER}, + + + level_up_type = #{record.levelUpType,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_up + set id = #{record.id,jdbcType=BIGINT}, + compete_time_id = #{record.competeTimeId,jdbcType=BIGINT}, + compete_code = #{record.competeCode,jdbcType=VARCHAR}, + level_user_id = #{record.levelUserId,jdbcType=BIGINT}, + score = #{record.score,jdbcType=INTEGER}, + addition_score = #{record.additionScore,jdbcType=INTEGER}, + ranking = #{record.ranking,jdbcType=INTEGER}, + level_up_type = #{record.levelUpType,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_up + + + compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + + + compete_code = #{competeCode,jdbcType=VARCHAR}, + + + level_user_id = #{levelUserId,jdbcType=BIGINT}, + + + score = #{score,jdbcType=INTEGER}, + + + addition_score = #{additionScore,jdbcType=INTEGER}, + + + ranking = #{ranking,jdbcType=INTEGER}, + + + level_up_type = #{levelUpType,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_up + set compete_time_id = #{competeTimeId,jdbcType=BIGINT}, + compete_code = #{competeCode,jdbcType=VARCHAR}, + level_user_id = #{levelUserId,jdbcType=BIGINT}, + score = #{score,jdbcType=INTEGER}, + addition_score = #{additionScore,jdbcType=INTEGER}, + ranking = #{ranking,jdbcType=INTEGER}, + level_up_type = #{levelUpType,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/mt/src/main/resources/mapper_raw/LevelUserMapper.xml b/mt/src/main/resources/mapper_raw/LevelUserMapper.xml new file mode 100644 index 00000000..ffb091a8 --- /dev/null +++ b/mt/src/main/resources/mapper_raw/LevelUserMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, player_id, avatar_url, name, team_id, created_at, updated_at, rec_status + + + + + delete from t_level_user + where id = #{id,jdbcType=BIGINT} + + + delete from t_level_user + + + + + + insert into t_level_user (id, player_id, avatar_url, + name, team_id, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{playerId,jdbcType=BIGINT}, #{avatarUrl,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{teamId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_level_user + + + id, + + + player_id, + + + avatar_url, + + + name, + + + team_id, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{playerId,jdbcType=BIGINT}, + + + #{avatarUrl,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{teamId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_level_user + + + id = #{record.id,jdbcType=BIGINT}, + + + player_id = #{record.playerId,jdbcType=BIGINT}, + + + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + + + name = #{record.name,jdbcType=VARCHAR}, + + + team_id = #{record.teamId,jdbcType=BIGINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_level_user + set id = #{record.id,jdbcType=BIGINT}, + player_id = #{record.playerId,jdbcType=BIGINT}, + avatar_url = #{record.avatarUrl,jdbcType=VARCHAR}, + name = #{record.name,jdbcType=VARCHAR}, + team_id = #{record.teamId,jdbcType=BIGINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_level_user + + + player_id = #{playerId,jdbcType=BIGINT}, + + + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + team_id = #{teamId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_level_user + set player_id = #{playerId,jdbcType=BIGINT}, + avatar_url = #{avatarUrl,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + team_id = #{teamId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java index 52bc2604..2b6f88ff 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java @@ -10,6 +10,8 @@ public class SysDomain implements Serializable { private String logo; + private String logoPath; + private String companyName; private String systemName; @@ -60,6 +62,14 @@ public class SysDomain implements Serializable { this.logo = logo == null ? null : logo.trim(); } + public String getLogoPath() { + return logoPath; + } + + public void setLogoPath(String logoPath) { + this.logoPath = logoPath == null ? null : logoPath.trim(); + } + public String getCompanyName() { return companyName; } @@ -165,6 +175,7 @@ public class SysDomain implements Serializable { sb.append(", id=").append(id); sb.append(", domainName=").append(domainName); sb.append(", logo=").append(logo); + sb.append(", logoPath=").append(logoPath); sb.append(", companyName=").append(companyName); sb.append(", systemName=").append(systemName); sb.append(", backdropUrl=").append(backdropUrl); diff --git a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java index 1b0fda64..e100bac0 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java +++ b/tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java @@ -305,6 +305,76 @@ public class SysDomainExample { return (Criteria) this; } + public Criteria andLogoPathIsNull() { + addCriterion("logo_path is null"); + return (Criteria) this; + } + + public Criteria andLogoPathIsNotNull() { + addCriterion("logo_path is not null"); + return (Criteria) this; + } + + public Criteria andLogoPathEqualTo(String value) { + addCriterion("logo_path =", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotEqualTo(String value) { + addCriterion("logo_path <>", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathGreaterThan(String value) { + addCriterion("logo_path >", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathGreaterThanOrEqualTo(String value) { + addCriterion("logo_path >=", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLessThan(String value) { + addCriterion("logo_path <", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLessThanOrEqualTo(String value) { + addCriterion("logo_path <=", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathLike(String value) { + addCriterion("logo_path like", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotLike(String value) { + addCriterion("logo_path not like", value, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathIn(List values) { + addCriterion("logo_path in", values, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotIn(List values) { + addCriterion("logo_path not in", values, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathBetween(String value1, String value2) { + addCriterion("logo_path between", value1, value2, "logoPath"); + return (Criteria) this; + } + + public Criteria andLogoPathNotBetween(String value1, String value2) { + addCriterion("logo_path not between", value1, value2, "logoPath"); + return (Criteria) this; + } + public Criteria andCompanyNameIsNull() { addCriterion("company_name is null"); return (Criteria) this; diff --git a/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java b/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java index e35e1230..25367769 100644 --- a/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java +++ b/tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java @@ -3,7 +3,10 @@ package com.ccsens.tall.intercept; import cn.hutool.core.collection.CollectionUtil; import com.ccsens.util.WebConstant; import org.apache.ibatis.executor.Executor; -import org.apache.ibatis.mapping.*; +import org.apache.ibatis.mapping.BoundSql; +import org.apache.ibatis.mapping.MappedStatement; +import org.apache.ibatis.mapping.ResultMap; +import org.apache.ibatis.mapping.SqlSource; import org.apache.ibatis.plugin.*; import org.apache.ibatis.reflection.DefaultReflectorFactory; import org.apache.ibatis.reflection.MetaObject; @@ -12,8 +15,10 @@ import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.RowBounds; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.List; +import java.util.Map; import java.util.Properties; /** @@ -34,43 +39,21 @@ public class MybatisInterceptor implements Interceptor { String selectByExample = "selectByExample"; + String countByExample = "countByExample"; + String countByExample2 = "selectByExample_COUNT"; String selectByPrimaryKey = "selectByPrimaryKey"; Object[] args = invocation.getArgs(); MappedStatement statement = (MappedStatement) args[0]; - if (statement.getId().endsWith(selectByExample)) { + if (statement.getId().endsWith(selectByExample) + || statement.getId().endsWith(countByExample) + || statement.getId().endsWith(countByExample2)) { //XXXExample Object example = args[1]; - Method method = example.getClass().getMethod("getOredCriteria", null); - //获取到条件数组,第一个是Criteria - List list = (List)method.invoke(example); - if (CollectionUtil.isEmpty(list)) { - Class clazz = ((ResultMap)statement.getResultMaps().get(0)).getType(); - String exampleName = clazz.getName() + "Example"; - Object paramExample = Class.forName(exampleName).newInstance(); - Method createCriteria = paramExample.getClass().getMethod("createCriteria"); - Object criteria = createCriteria.invoke(paramExample); - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - list.add(criteria); - } else { - Object criteria = list.get(0); - Method getCriteria = criteria.getClass().getMethod("getCriteria"); - List params = (List)getCriteria.invoke(criteria); - boolean hasDel = false; - for(Object param: params) { - Method getCondition = param.getClass().getMethod("getCondition"); - Object condition = getCondition.invoke(param); - if ("iis_del =".equals(condition)) { - hasDel = true; - } - } - if (!hasDel) { - Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); - andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); - } - } + addCondition(statement, example); + + } else if (statement.getId().endsWith(selectByPrimaryKey)) { @@ -85,6 +68,45 @@ public class MybatisInterceptor implements Interceptor { return invocation.proceed(); } + private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { + if (example instanceof Map) { + example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); + } + + + Method method = example.getClass().getMethod("getOredCriteria", null); + //获取到条件数组,第一个是Criteria + List list = (List) method.invoke(example); + if (CollectionUtil.isEmpty(list)) { + Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); + String exampleName = clazz.getName() + "Example"; + Object paramExample = Class.forName(exampleName).newInstance(); + Method createCriteria = paramExample.getClass().getMethod("createCriteria"); + Object criteria = createCriteria.invoke(paramExample); + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + list.add(criteria); + } else { + Object criteria = list.get(0); + Method getCriteria = criteria.getClass().getMethod("getCriteria"); + List params = (List) getCriteria.invoke(criteria); + boolean hasDel = false; + for (Object param : params) { + Method getCondition = param.getClass().getMethod("getCondition"); + Object condition = getCondition.invoke(param); + if ("rec_status =".equals(condition)) { + hasDel = true; + } + } + if (!hasDel) { + Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); + andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); + } + + } + + } + @Override public Object plugin(Object target) { return Plugin.wrap(target, this); @@ -121,24 +143,7 @@ public class MybatisInterceptor implements Interceptor { return builder.build(); } - private String getOperateType(Invocation invocation) { - final Object[] args = invocation.getArgs(); - MappedStatement ms = (MappedStatement) args[0]; - SqlCommandType commondType = ms.getSqlCommandType(); - if (commondType.compareTo(SqlCommandType.SELECT) == 0) { - return "select"; - } - if (commondType.compareTo(SqlCommandType.INSERT) == 0) { - return "insert"; - } - if (commondType.compareTo(SqlCommandType.UPDATE) == 0) { - return "update"; - } - if (commondType.compareTo(SqlCommandType.DELETE) == 0) { - return "delete"; - } - return null; - } + // 定义一个内部辅助类,作用是包装sq class BoundSqlSqlSource implements SqlSource { private BoundSql boundSql; diff --git a/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java b/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java index bc497031..79e8967f 100644 --- a/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java +++ b/tall/src/main/java/com/ccsens/tall/scheduled/ScheduledService.java @@ -2,16 +2,12 @@ package com.ccsens.tall.scheduled; import cn.hutool.core.collection.CollectionUtil; import com.ccsens.tall.bean.po.ProRemind; -import com.ccsens.tall.bean.po.SysProjectRobot; -import com.ccsens.tall.bean.po.SysProjectRobotExample; import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.persist.dao.ProRemindDao; import com.ccsens.tall.service.IProjectMessageService; import com.ccsens.tall.service.IRobotService; -import com.ccsens.tall.util.TallConstant; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -42,7 +38,7 @@ public class ScheduledService { public static final String AFTER_END = "您在项目's'中的任务's'已经在's'结束了"; public static final String USER_DEFINED = "来自项目's'中的任务's'的提醒"; - @Scheduled(cron = "*/60 * * * * ?") +// @Scheduled(cron = "*/60 * * * * ?") public void runfirst(){ long now = System.currentTimeMillis(); // long now = 1594611047000L; diff --git a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java index 9773413f..2628c5d5 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java @@ -765,11 +765,15 @@ public class ProTaskDetailService implements IProTaskDetailService { List normalTaskList = new ArrayList<>(); //获取用户的角色 if(CollectionUtil.isEmpty(roleList)){ + roleList = new HashSet<>(); //查询此用户在项目中的的所有角色的任务 List roles = proMemberService.selectRolesByUserIdAndProjectId(userId, project.getId()); - roles.forEach(role->{ + for (ProRole role : roles){ roleList.add(role.getId()); - }); + } +// roles.forEach(role->{ +// roleList.add(role.getId()); +// }); } //获取“全体成员”角色 diff --git a/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java b/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java index 3c48980e..3c0a3d8f 100644 --- a/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java +++ b/tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java @@ -287,7 +287,7 @@ public class TaskPluginService implements ITaskPluginService{ domainExample.createCriteria().andDomainNameEqualTo(getMinutes.getDomainName()); List sysDomainList = sysDomainDao.selectByExample(domainExample); if (CollectionUtil.isNotEmpty(sysDomainList)) { - logo = sysDomainList.get(0).getLogo(); + logo = sysDomainList.get(0).getLogoPath(); } } //查找该任务的会议记录文件,有则直接返回 @@ -423,7 +423,7 @@ public class TaskPluginService implements ITaskPluginService{ domainExample.createCriteria().andDomainNameEqualTo(updateMinutes.getDomainName()); List sysDomainList = sysDomainDao.selectByExample(domainExample); if (CollectionUtil.isNotEmpty(sysDomainList)) { - logo = sysDomainList.get(0).getLogo(); + logo = sysDomainList.get(0).getLogoPath(); } } //查找到文件信息 @@ -487,9 +487,55 @@ public class TaskPluginService implements ITaskPluginService{ }); } } - OutputStream stream = new FileOutputStream(wpsFile.getSaveUrl()); +// OutputStream stream = new FileOutputStream(wpsFile.getSaveUrl()); +// wb.write(stream); +// stream.close(); + + String name = "会议记录"+DateUtil.today() + ".xlsx"; + String fileName = "minutes/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; + String path = WebConstant.UPLOAD_PATH_BASE + File.separator + fileName; + File tmpFile = new File(path); + if (!tmpFile.getParentFile().exists()) { + tmpFile.getParentFile().mkdirs(); + } + OutputStream stream = new FileOutputStream(tmpFile); wb.write(stream); stream.close(); + //删除projectFile + ProProjectFileExample projectFileExample = new ProProjectFileExample(); + projectFileExample.createCriteria().andWpsFileIdEqualTo(wpsFile.getId()); + List projectFileList = proProjectFileDao.selectByExample(projectFileExample); + if(CollectionUtil.isNotEmpty(projectFileList)) { + projectFileList.forEach(proProjectFile -> { + proProjectFile.setRecStatus((byte) 2); + proProjectFileDao.updateByPrimaryKeySelective(proProjectFile); + }); + } + //重新保存wps + WpsDto.Business business = new WpsDto.Business(); + business.setBusinessId(updateMinutes.getTaskId()); + business.setBusinessType((byte) 2); + business.setUserId(currentUserId); + business.setFileName(name); + business.setFilePath(fileName); + business.setFileSize(tmpFile.length()); + business.setOperation(WebConstant.Wps.USER_OPERATION_NEW); + business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_QUERY); + business.setPrivilegeQueryUrl(PropUtil.domain + "v1/3rd/wpsPower"); + wpsService.saveFile(business); + + List minutesInfoList1 = new ArrayList<>(); + List wpsPath1 = wpsService.queryVisitUrls(updateMinutes.getTaskId(),(byte) 2,token,null); + if(CollectionUtil.isNotEmpty(wpsPath1)){ + wpsPath1.forEach(wps->{ + PluginVo.MinutesInfo minutesInfo = new PluginVo.MinutesInfo(); + minutesInfo.setWpsPath(wps); + minutesInfo.setDownloadPath(wpsFile.getDownloadUrl()); + minutesInfo.setWpsFileId(wpsFile.getId()); + minutesInfoList1.add(minutesInfo); + }); + } + return minutesInfoList1; } return minutesInfoList; diff --git a/tall/src/main/java/com/ccsens/tall/service/WpsService.java b/tall/src/main/java/com/ccsens/tall/service/WpsService.java index 433c7d32..56ee8acc 100644 --- a/tall/src/main/java/com/ccsens/tall/service/WpsService.java +++ b/tall/src/main/java/com/ccsens/tall/service/WpsService.java @@ -227,18 +227,16 @@ public class WpsService implements IWpsService { } String fileType = WebConstant.Wps.getFileType(ext); Map paramMap= new HashMap<>(); - paramMap.put("_w_appid", WebConstant.Wps.APPID); + paramMap.put("_w_appid", (String) redisUtil.get(WebConstant.Wps.APPID)); paramMap.put("_w_token", token); if (CollectionUtil.isNotEmpty(params)) { paramMap.putAll(params); } - String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY); - StringBuilder fileUrl = new StringBuilder("https://wwo.wps.cn/office/{}/{}?_w_appid=" + WebConstant.Wps.APPID + "&_w_signature={}&_w_token={}"); + String newSignature = WpsSignature.getSignature(paramMap, (String) redisUtil.get(WebConstant.Wps.APPKEY)); + StringBuilder fileUrl = new StringBuilder("https://wwo.wps.cn/office/{}/{}?_w_appid=" + redisUtil.get(WebConstant.Wps.APPID) + "&_w_signature={}&_w_token={}"); if (CollectionUtil.isNotEmpty(params)) { params.forEach((k,v) -> fileUrl.append("&").append(k).append("=").append(v)); - - } return StrUtil.format(fileUrl, fileType, fileId, newSignature, token); } diff --git a/tall/src/main/java/com/ccsens/tall/web/DebugController.java b/tall/src/main/java/com/ccsens/tall/web/DebugController.java index 808631e0..8ce4801f 100644 --- a/tall/src/main/java/com/ccsens/tall/web/DebugController.java +++ b/tall/src/main/java/com/ccsens/tall/web/DebugController.java @@ -3,6 +3,7 @@ package com.ccsens.tall.web; import com.ccsens.tall.bean.dto.message.SyncMessageWithStartDto; import com.ccsens.util.JacksonUtil; import com.ccsens.util.JsonResponse; +import com.ccsens.util.RedisUtil; import com.ccsens.util.bean.message.common.InMessage; import com.ccsens.util.bean.message.common.MessageConstant; import com.ccsens.util.bean.message.common.MessageRule; @@ -30,6 +31,8 @@ import java.util.Set; public class DebugController { @Autowired private AmqpTemplate rabbitTemplate; + @Resource + private RedisUtil redisUtil; @Resource private PlatformTransactionManager transactionManager; @@ -40,7 +43,10 @@ public class DebugController { }) @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) public JsonResponse getSmsCode(HttpServletRequest request) throws Exception { - return JsonResponse.newInstance().ok("测试"); + redisUtil.set("wps_tall_appId","d12722a7d28e430c889309fa4754aaba"); + redisUtil.set("wps_tall_appKey","f273e717247947ba8942a2373b6896c7"); + + return JsonResponse.newInstance().ok(redisUtil.get("wps_tall_appId")); } diff --git a/tall/src/main/java/com/ccsens/tall/web/WpsController.java b/tall/src/main/java/com/ccsens/tall/web/WpsController.java index 475efe07..7eef3bb2 100644 --- a/tall/src/main/java/com/ccsens/tall/web/WpsController.java +++ b/tall/src/main/java/com/ccsens/tall/web/WpsController.java @@ -8,10 +8,7 @@ import com.ccsens.tall.bean.vo.UserVo; import com.ccsens.tall.bean.vo.WpsVo; import com.ccsens.tall.service.IUserService; import com.ccsens.tall.service.IWpsService; -import com.ccsens.util.CodeEnum; -import com.ccsens.util.JsonResponse; -import com.ccsens.util.WebConstant; -import com.ccsens.util.WpsSignature; +import com.ccsens.util.*; import com.ccsens.util.exception.BaseException; import io.swagger.annotations.*; import lombok.Data; @@ -44,6 +41,8 @@ public class WpsController { private IWpsService wpsService; @Resource private IUserService userService; + @Resource + private RedisUtil redisUtil; @InitBinder public void initBinder(WebDataBinder binder) { @@ -223,7 +222,7 @@ public class WpsController { */ private Map initMap(){ Map paramMap= new HashMap<>(); - paramMap.put("_w_appid", WebConstant.Wps.APPID); + paramMap.put("_w_appid", (String) redisUtil.get(WebConstant.Wps.APPID)); return paramMap; } @@ -253,7 +252,7 @@ public class WpsController { } } - String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY); + String newSignature = WpsSignature.getSignature(paramMap,(String) redisUtil.get(WebConstant.Wps.APPKEY)); log.info("newSignature:{}", newSignature); log.info("参数签名:{}---{}", signature, URLEncoder.encode(signature, CharsetUtil.UTF_8)); if (!newSignature.equals(URLEncoder.encode(signature, CharsetUtil.UTF_8))) { diff --git a/tall/src/main/resources/mapper_raw/SysDomainMapper.xml b/tall/src/main/resources/mapper_raw/SysDomainMapper.xml index ffc262a9..7324a050 100644 --- a/tall/src/main/resources/mapper_raw/SysDomainMapper.xml +++ b/tall/src/main/resources/mapper_raw/SysDomainMapper.xml @@ -5,6 +5,7 @@ + @@ -77,8 +78,9 @@ - id, domain_name, logo, company_name, system_name, backdrop_url, show_calendar, show_project_id, - caption, headline, created_at, updated_at, rec_status, forever_project_id, navigation_bar + id, domain_name, logo, logo_path, company_name, system_name, backdrop_url, show_calendar, + show_project_id, caption, headline, created_at, updated_at, rec_status, forever_project_id, + navigation_bar