Browse Source

修改ht删除isdel

master
zhangye 6 years ago
parent
commit
af935dd638
  1. 68
      ht/src/main/java/com/ccsens/ht/intercept/MybatisInterceptor.java
  2. 2
      ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml
  3. 22
      tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java
  4. 140
      tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java
  5. 5
      tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java
  6. 10
      tall/src/main/java/com/ccsens/tall/config/BeanConfig.java
  7. 154
      tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java
  8. 4
      tall/src/main/java/com/ccsens/tall/service/IProRoleService.java
  9. 4
      tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java
  10. 4
      tall/src/main/java/com/ccsens/tall/service/ITaskDeliverService.java
  11. 26
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  12. 160
      tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java
  13. 13
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  14. 29
      tall/src/main/java/com/ccsens/tall/service/SysDomainService.java
  15. 5
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  16. 2
      tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java
  17. 2
      tall/src/main/java/com/ccsens/tall/web/DomainController.java
  18. 2
      tall/src/main/java/com/ccsens/tall/web/TaskController.java
  19. 19
      tall/src/main/resources/mapper_dao/ProRoleDao.xml
  20. 2
      tall/src/main/resources/mapper_dao/SysProjectDao.xml
  21. 16
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  22. 42
      tall/src/main/resources/mapper_raw/SysDomainMapper.xml
  23. 4
      util/src/main/java/com/ccsens/util/CodeEnum.java
  24. 116
      util/src/main/java/com/ccsens/util/WebConstant.java

68
ht/src/main/java/com/ccsens/ht/intercept/MybatisInterceptor.java

@ -1,35 +1,19 @@
package com.ccsens.ht.intercept;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.ht.bean.po.HtDoctorExample;
import com.ccsens.ht.uitl.Constant;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.executor.CachingExecutor;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.executor.parameter.ParameterHandler;
import org.apache.ibatis.executor.statement.PreparedStatementHandler;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.*;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.BeanUtils;
import org.springframework.util.ClassUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.PreparedStatement;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
/**
@ -42,62 +26,12 @@ import java.util.Properties;
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)/*,
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}
)*/
/*@Signature(
type = ParameterHandler.class,
method = "setParameters",
args = {PreparedStatement.class}
)*/
)
})
public class MybatisInterceptor implements Interceptor {
private static final String PARAM_KEY = "is_del";
@Override
public Object intercept(Invocation invocation) throws Throwable {
// Object[] args = invocation.getArgs();
// MappedStatement statement = (MappedStatement) args[0];
// BoundSql boundSql = statement.getBoundSql(args.length > 1 ? args[1] : null);
// String sql = boundSql.getSql();
// String whereDel = "is_del";
// int whereIndex = sql.indexOf("where") > 0 ? sql.indexOf("where") : sql.indexOf("WHERE");
// boolean hasParam = true;
// if (whereIndex < 0) {
// hasParam = false;
// sql += " where ";
// whereIndex = sql.indexOf("where");
// }
// //sql中不包含is_del,则添加
// if (!sql.substring(whereIndex).contains(whereDel)) {
// StringBuilder sqlBuilder = new StringBuilder();
// sqlBuilder.append(sql.substring(0, whereIndex + "where".length()))
// .append(hasParam ? " is_del = 0 and " : " is_del = 0 ")
// .append(sql.substring(whereIndex + "where".length()));
// //通过反射修改sql语句
//// Field field = boundSql.getClass().getDeclaredField("sql");
//// field.setAccessible(true);
//// field.set(boundSql, builder.toString());
//
// System.out.println("------------------");
// List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
// Configuration configuration = statement.getConfiguration();
// BoundSql newBoundSql = new BoundSql(configuration, sqlBuilder.toString(), parameterMappings, boundSql.getParameterObject());
// for (ParameterMapping parameterMapping : parameterMappings) {
// String prop = parameterMapping.getProperty();
// if (boundSql.hasAdditionalParameter(prop)) {
// Object param = boundSql.getAdditionalParameter(prop);
// newBoundSql.setAdditionalParameter(prop, param);
// }
// }
// BoundSqlSource newSqlSource = new BoundSqlSource(newBoundSql);
// MappedStatement newMappedStatement = copyFromMappedStatement(
// statement, newSqlSource);
// args[MAPPED_STATEMENT_INDEX] = newMappedStatement;
// }
String selectByExample = "selectByExample";
String selectByPrimaryKey = "selectByPrimaryKey";

2
ht/src/main/resources/mapper_dao/HtQuestionOptionDao.xml

@ -44,7 +44,7 @@
select t1.id, t1.type, t1.question_id, t1.name, t1.score, t1.display, if (t2.id is null, 0, 1) as choose , if(t2.type = 3, null, t2.answer) as answer
from t_ht_question_option t1 left join t_ht_patient_score t2 on t1.id = t2.option_id
where t1.question_id = #{questionId,jdbcType=BIGINT} and (t2.id is null or t2.patient_report_id = #{patientReportId,jdbcType=BIGINT})
and t1.is_del = 0 and t2.is_del = 0
and t1.is_del = 0
group by t1.id
order by t1.sort
</select>

22
tall/src/main/java/com/ccsens/tall/bean/po/SysDomain.java

@ -18,6 +18,10 @@ public class SysDomain implements Serializable {
private Long showProjectId;
private String caption;
private String headline;
private Date createdAt;
private Date updatedAt;
@ -82,6 +86,22 @@ public class SysDomain implements Serializable {
this.showProjectId = showProjectId;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption == null ? null : caption.trim();
}
public String getHeadline() {
return headline;
}
public void setHeadline(String headline) {
this.headline = headline == null ? null : headline.trim();
}
public Date getCreatedAt() {
return createdAt;
}
@ -119,6 +139,8 @@ public class SysDomain implements Serializable {
sb.append(", systemName=").append(systemName);
sb.append(", showCalendar=").append(showCalendar);
sb.append(", showProjectId=").append(showProjectId);
sb.append(", caption=").append(caption);
sb.append(", headline=").append(headline);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);

140
tall/src/main/java/com/ccsens/tall/bean/po/SysDomainExample.java

@ -565,6 +565,146 @@ public class SysDomainExample {
return (Criteria) this;
}
public Criteria andCaptionIsNull() {
addCriterion("caption is null");
return (Criteria) this;
}
public Criteria andCaptionIsNotNull() {
addCriterion("caption is not null");
return (Criteria) this;
}
public Criteria andCaptionEqualTo(String value) {
addCriterion("caption =", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionNotEqualTo(String value) {
addCriterion("caption <>", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionGreaterThan(String value) {
addCriterion("caption >", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionGreaterThanOrEqualTo(String value) {
addCriterion("caption >=", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionLessThan(String value) {
addCriterion("caption <", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionLessThanOrEqualTo(String value) {
addCriterion("caption <=", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionLike(String value) {
addCriterion("caption like", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionNotLike(String value) {
addCriterion("caption not like", value, "caption");
return (Criteria) this;
}
public Criteria andCaptionIn(List<String> values) {
addCriterion("caption in", values, "caption");
return (Criteria) this;
}
public Criteria andCaptionNotIn(List<String> values) {
addCriterion("caption not in", values, "caption");
return (Criteria) this;
}
public Criteria andCaptionBetween(String value1, String value2) {
addCriterion("caption between", value1, value2, "caption");
return (Criteria) this;
}
public Criteria andCaptionNotBetween(String value1, String value2) {
addCriterion("caption not between", value1, value2, "caption");
return (Criteria) this;
}
public Criteria andHeadlineIsNull() {
addCriterion("headline is null");
return (Criteria) this;
}
public Criteria andHeadlineIsNotNull() {
addCriterion("headline is not null");
return (Criteria) this;
}
public Criteria andHeadlineEqualTo(String value) {
addCriterion("headline =", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineNotEqualTo(String value) {
addCriterion("headline <>", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineGreaterThan(String value) {
addCriterion("headline >", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineGreaterThanOrEqualTo(String value) {
addCriterion("headline >=", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineLessThan(String value) {
addCriterion("headline <", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineLessThanOrEqualTo(String value) {
addCriterion("headline <=", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineLike(String value) {
addCriterion("headline like", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineNotLike(String value) {
addCriterion("headline not like", value, "headline");
return (Criteria) this;
}
public Criteria andHeadlineIn(List<String> values) {
addCriterion("headline in", values, "headline");
return (Criteria) this;
}
public Criteria andHeadlineNotIn(List<String> values) {
addCriterion("headline not in", values, "headline");
return (Criteria) this;
}
public Criteria andHeadlineBetween(String value1, String value2) {
addCriterion("headline between", value1, value2, "headline");
return (Criteria) this;
}
public Criteria andHeadlineNotBetween(String value1, String value2) {
addCriterion("headline not between", value1, value2, "headline");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;

5
tall/src/main/java/com/ccsens/tall/bean/vo/DomainVo.java

@ -22,6 +22,11 @@ public class DomainVo {
private String companyName;
@ApiModelProperty("系统名")
private String systemName;
@ApiModelProperty("标题")
private String caption;
@ApiModelProperty("栏外标题")
private String headline;
@ApiModelProperty("是否显示日历 0不显示 1显示")
private int showCalender;
@ApiModelProperty("不展示日历时。显示的项目的id")

10
tall/src/main/java/com/ccsens/tall/config/BeanConfig.java

@ -1,5 +1,6 @@
package com.ccsens.tall.config;
import com.ccsens.tall.intercept.MybatisInterceptor;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -21,4 +22,13 @@ public class BeanConfig {
conf.setProperties(yml.getObject());
return conf;
}
/**
* 注册拦截器
*/
@Bean
public MybatisInterceptor mybatisInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
}

154
tall/src/main/java/com/ccsens/tall/intercept/MybatisInterceptor.java

@ -0,0 +1,154 @@
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.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Properties;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/11 10:58
*/
@Intercepts({
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)
})
public class MybatisInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
String selectByExample = "selectByExample";
String selectByPrimaryKey = "selectByPrimaryKey";
Object[] args = invocation.getArgs();
MappedStatement statement = (MappedStatement) args[0];
if (statement.getId().endsWith(selectByExample)) {
//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);
}
}
} else if (statement.getId().endsWith(selectByPrimaryKey)) {
BoundSql boundSql = statement.getBoundSql(args[1]);
String sql = boundSql.getSql() + " and rec_status = 0";
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql));
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
msObject.setValue("sqlSource.boundSql.sql", sql);
args[0] = newStatement;
}
return invocation.proceed();
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder =
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource());
builder.fetchSize(ms.getFetchSize());
builder.statementType(ms.getStatementType());
builder.keyGenerator(ms.getKeyGenerator());
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) {
StringBuilder keyProperties = new StringBuilder();
for (String keyProperty : ms.getKeyProperties()) {
keyProperties.append(keyProperty).append(",");
}
keyProperties.delete(keyProperties.length() - 1, keyProperties.length());
builder.keyProperty(keyProperties.toString());
}
builder.timeout(ms.getTimeout());
builder.parameterMap(ms.getParameterMap());
builder.resultMaps(ms.getResultMaps());
builder.resultSetType(ms.getResultSetType());
builder.cache(ms.getCache());
builder.flushCacheRequired(ms.isFlushCacheRequired());
builder.useCache(ms.isUseCache());
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;
public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
return boundSql;
}
}
}

4
tall/src/main/java/com/ccsens/tall/service/IProRoleService.java

@ -22,7 +22,7 @@ public interface IProRoleService {
ProRole getAllMember(Long projectId);
void deleteRole(Long userId,Long roleId);
void deleteRole(Long userId,Long roleId) throws Exception;
void deleteRoleByProjectId(Long projectId);
void deleteRoleByProjectId(Long projectId) throws Exception;
}

4
tall/src/main/java/com/ccsens/tall/service/IProTaskDetailService.java

@ -21,9 +21,9 @@ public interface IProTaskDetailService {
TaskVo.NormalTask selectTaskByParentId(Long parentId, Long startTime, Long endTime);
void deleteTask(Long currentUserId,Long taskId);
void deleteTask(Long currentUserId,Long taskId) throws Exception;
void deleteTaskByRoleId(Long taskId);
void deleteTaskByRoleId(Long taskId) throws Exception;
TaskVo.NormalTask updateTaskInfo(Long currentUserId, TaskDto.UpdateTaskInfo updateTaskInfo) throws Exception;
}

4
tall/src/main/java/com/ccsens/tall/service/ITaskDeliverService.java

@ -26,7 +26,9 @@ public interface ITaskDeliverService {
DeliverVo.DeliverInfo checkDeliver(Long currentUserId, DeliverDto.CheckDeliver checker) throws Exception;
void deleteDeliverByTaskId(Long taskId);
void deleteDeliverByTaskId(Long taskId)throws Exception;
void deleteDeliver(Long userId, Long deliverId, Long taskId) throws Exception;
Long isTaskOrSubTime(Long id)throws Exception;
}

26
tall/src/main/java/com/ccsens/tall/service/ProRoleService.java

@ -231,16 +231,22 @@ public class ProRoleService implements IProRoleService {
* 删除角色
*/
@Override
public void deleteRole(Long userId, Long roleId) {
public void deleteRole(Long userId, Long roleId) throws Exception {
ProRole role = proRoleDao.selectByPrimaryKey(roleId);
//本用户在项目中的角色
List<ProRole> proRoles = getProRoleByProjectIdAndUserId(role.getProjectId(), userId);
// //本用户在项目中的角色
// List<ProRole> proRoles = getProRoleByProjectIdAndUserId(role.getProjectId(), userId);
//用户在项目中的最高权限
int power = selectPowerByRoleName(userId, role.getProjectId());
if (power > 1) {
deleteRoleByRoleId(roleId);
} else {
throw new BaseException(CodeEnum.NOT_POWER);
if(ObjectUtil.isNotNull(role)) {
int power = selectPowerByRoleName(userId, role.getProjectId());
if (power > 1) {
//修改删除状态
role.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
proRoleDao.updateByPrimaryKeySelective(role);
// //彻底删除角色
// deleteRoleByRoleId(roleId);
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
}
}
@ -248,7 +254,7 @@ public class ProRoleService implements IProRoleService {
* 删除项目下的所有角色
*/
@Override
public void deleteRoleByProjectId(Long projectId) {
public void deleteRoleByProjectId(Long projectId) throws Exception {
ProRoleExample roleExample = new ProRoleExample();
roleExample.createCriteria().andProjectIdEqualTo(projectId);
List<ProRole> roleList = proRoleDao.selectByExample(roleExample);
@ -259,7 +265,7 @@ public class ProRoleService implements IProRoleService {
}
}
private void deleteRoleByRoleId(Long roleId) {
private void deleteRoleByRoleId(Long roleId) throws Exception {
//删除角色下的任务
taskDetailService.deleteTaskByRoleId(roleId);
//删除成员和成员角色关联表

160
tall/src/main/java/com/ccsens/tall/service/ProTaskDetailService.java

@ -363,14 +363,16 @@ public class ProTaskDetailService implements IProTaskDetailService {
TaskVo.FirstTask firstProTask = null;
//查找项目下的一级任务
ProTaskDetailExample firstTaskExample = new ProTaskDetailExample();
firstTaskExample.createCriteria().andProjectIdEqualTo(projectId).andVirtualEqualTo((byte) WebConstant.TASK_VIRTUAL.Normal.value).andParentIdEqualTo(0L);
firstTaskExample.createCriteria().andProjectIdEqualTo(projectId)
.andVirtualEqualTo((byte) WebConstant.TASK_VIRTUAL.Normal.value).andParentIdEqualTo(0L);
List<ProTaskDetail> firstTaskList = taskDetailDao.selectByExample(firstTaskExample);
if (CollectionUtil.isNotEmpty(firstTaskList)) {
for (ProTaskDetail firstTask : firstTaskList) {
taskDeliverByMVPList = new ArrayList<>();
//查找项目下所有的二级任务
ProTaskDetailExample taskExample = new ProTaskDetailExample();
taskExample.createCriteria().andProjectIdEqualTo(projectId).andVirtualEqualTo((byte) WebConstant.TASK_VIRTUAL.Normal.value).andParentIdEqualTo(firstTask.getId());
taskExample.createCriteria().andProjectIdEqualTo(projectId)
.andVirtualEqualTo((byte) WebConstant.TASK_VIRTUAL.Normal.value).andParentIdEqualTo(firstTask.getId());
List<ProTaskDetail> taskList = taskDetailDao.selectByExample(taskExample);
if (CollectionUtil.isNotEmpty(taskList)) {
for (ProTaskDetail task : taskList) {
@ -697,15 +699,27 @@ public class ProTaskDetailService implements IProTaskDetailService {
if(ObjectUtil.isNotNull(roleId)){
//获取指定的角色
ProRole role = proRoleDao.selectByPrimaryKey(roleId);
roleList.add(role);
}else {
//查询项目下所有角色的任务
List<ProjectVo.RoleInfo> roleInfoList = proRoleService.getRealMemberRolesByProjectId(projectId);
if(CollectionUtil.isNotEmpty(roleInfoList)) {
for (ProjectVo.RoleInfo roleInfo : roleInfoList) {
ProRole role = proRoleDao.selectByPrimaryKey(roleInfo.getId());
roleList.add(role);
if(ObjectUtil.isNotNull(role)){
ProRole parentRole = proRoleDao.selectByPrimaryKey(role.getParentId());
if(ObjectUtil.isNotNull(parentRole)){
//若角色为项目经理或MVP,则查询全部角色
if (role.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.MVP.value) ||
parentRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.PM.value)) {
//查询项目下所有角色的任务
List<ProjectVo.RoleInfo> roleInfoList = proRoleService.getRealMemberRolesByProjectId(projectId);
if(CollectionUtil.isNotEmpty(roleInfoList)) {
for (ProjectVo.RoleInfo roleInfo : roleInfoList) {
ProRole proRole = proRoleDao.selectByPrimaryKey(roleInfo.getId());
roleList.add(proRole);
}
}
}else {
//否则只查询指定角色的任务清单
roleList.add(role);
}
}
}else{
throw new BaseException(CodeEnum.NOT_ROLE);
}
}
@ -838,7 +852,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
* 删除任务和所有相关信息
*/
@Override
public void deleteTask(Long currentUserId, Long taskId) {
public void deleteTask(Long currentUserId, Long taskId) throws Exception {
//检查id是详情id还是subTimeId
ProTaskDetail taskDetail = null;
ProTaskSubTime subTime = taskSubTimeDao.selectByPrimaryKey(taskId);
@ -847,13 +861,17 @@ public class ProTaskDetailService implements IProTaskDetailService {
} else {
taskDetail = taskDetailDao.selectByPrimaryKey(taskId);
}
//本用户在项目中的角色
List<ProRole> proRoles = proRoleService.getProRoleByProjectIdAndUserId(taskDetail.getProjectId(), currentUserId);
// //本用户在项目中的角色
// List<ProRole> proRoles = proRoleService.getProRoleByProjectIdAndUserId(taskDetail.getProjectId(), currentUserId);
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId,taskDetail.getProjectId());
if (power > 1) {
if (ObjectUtil.isNotNull(taskDetail)) {
deleteTaskByTaskId(taskDetail.getId());
//修改任务删除状态
taskDetail.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
taskDetailDao.updateByPrimaryKeySelective(taskDetail);
// //彻底删除任务
// deleteTaskByTaskId(taskDetail.getId());
}
} else {
throw new BaseException(CodeEnum.NOT_POWER);
@ -861,7 +879,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
@Override
public void deleteTaskByRoleId(Long roleId) {
public void deleteTaskByRoleId(Long roleId) throws Exception {
ProTaskDetailExample taskDetailExample = new ProTaskDetailExample();
taskDetailExample.createCriteria().andExecutorRoleEqualTo(roleId);
List<ProTaskDetail> detailList = taskDetailDao.selectByExample(taskDetailExample);
@ -872,7 +890,7 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
}
private void deleteTaskByTaskId(Long taskId) {
private void deleteTaskByTaskId(Long taskId) throws Exception {
//1、删除交付物相关信息
taskDeliverService.deleteDeliverByTaskId(taskId);
//2、删除插件
@ -932,40 +950,32 @@ public class ProTaskDetailService implements IProTaskDetailService {
taskDetail.setDelayTime(updateTaskInfo.getDelayTime());
}
//时间
boolean isUpdateTime = false;
//一级任务没有时间,不能修改
if(taskDetail.getLevel() != 1 && taskDetail.getLevel() != 0) {
if (ObjectUtil.isNotNull(updateTaskInfo.getBeginTime())) {
taskDetail.setBeginTime(updateTaskInfo.getBeginTime());
isUpdateTime = true;
}
if (ObjectUtil.isNotNull(updateTaskInfo.getEndTime())) {
taskDetail.setEndTime(updateTaskInfo.getEndTime());
isUpdateTime = true;
}
if (StrUtil.isNotEmpty(updateTaskInfo.getCycle())) {
taskDetail.setCycle(updateTaskInfo.getCycle());
isUpdateTime = true;
}
//时间赋完值后,检查开始时间是否小于结束时间。(赋值前判断太麻烦)
if (taskDetail.getBeginTime() >= taskDetail.getEndTime()){
throw new BaseException(CodeEnum.TIME_ERROR_BEGIN);
if(ObjectUtil.isNotNull(updateTaskInfo.getBeginTime()) ||
ObjectUtil.isNotNull(updateTaskInfo.getEndTime()) ||
StrUtil.isNotEmpty(updateTaskInfo.getCycle())){
//一级任务没有时间,不能修改
if(taskDetail.getLevel() != 1 && taskDetail.getLevel() != 0) {
changeTime(taskDetail,updateTaskInfo.getBeginTime(),updateTaskInfo.getEndTime(),project);
if (StrUtil.isNotEmpty(updateTaskInfo.getCycle())) {
taskDetail.setCycle(updateTaskInfo.getCycle());
}
//时间赋完值后,检查开始时间是否小于结束时间。(赋值前判断太麻烦)
if (taskDetail.getBeginTime() >= taskDetail.getEndTime()){
throw new BaseException(CodeEnum.TIME_ERROR_BEGIN);
}
//删掉旧的subTime
ProTaskSubTimeExample subTimeExample = new ProTaskSubTimeExample();
subTimeExample.createCriteria().andTaskDetailIdEqualTo(taskDetail.getId());
taskSubTimeDao.deleteByExample(subTimeExample);
//重新生成subTime
partTaskSubTime(taskDetail);
}
}
//若时间相关被修改,删掉旧的subTime,根据新时间重新生成
if(isUpdateTime){
//删掉旧的subTime
ProTaskSubTimeExample subTimeExample = new ProTaskSubTimeExample();
subTimeExample.createCriteria().andTaskDetailIdEqualTo(taskDetail.getId());
taskSubTimeDao.deleteByExample(subTimeExample);
//重新生成subTime
partTaskSubTime(taskDetail);
}
//修改数据
taskDetailDao.updateByPrimaryKeySelective(taskDetail);
//返回的任务详细信息
normalTask = getTaskInfoByTaskId(currentUserId,project.getId(),updateTaskInfo.getId());
Long subTimeId = taskDeliverService.isTaskOrSubTime(taskDetail.getId());
normalTask = getTaskInfoByTaskId(currentUserId,project.getId(),subTimeId);
}
}else {
throw new BaseException(CodeEnum.NOT_POWER);
@ -976,7 +986,8 @@ public class ProTaskDetailService implements IProTaskDetailService {
return normalTask;
}
private void changeTime(ProTaskDetail taskDetail,Long beginTime,Long endTime,SysProject project){
if(beginTime >= project.getBeginTime() || endTime <= project.getEndTime()){
if((ObjectUtil.isNotNull(beginTime) && beginTime >= project.getEndTime()) ||
(ObjectUtil.isNotNull(endTime) && endTime <= project.getBeginTime())){
throw new BaseException(CodeEnum.TIME_ERROR_PROJECT);
}
@ -993,7 +1004,62 @@ public class ProTaskDetailService implements IProTaskDetailService {
}
}
}else if(taskDetail.getLevel() == 3){
ProTaskDetail parentTask = taskDetailDao.selectByPrimaryKey(taskDetail.getParentId());
if(parentTask.getHasGroup() == 1){
//查找组任务中的最早和最晚时间
Long bTime = null;
Long eTime = null;
ProTaskDetailExample detailExample = new ProTaskDetailExample();
detailExample.createCriteria().andParentIdEqualTo(parentTask.getId());
List<ProTaskDetail> groupTaskList = taskDetailDao.selectByExample(detailExample);
if(CollectionUtil.isNotEmpty(groupTaskList)){
for (ProTaskDetail groupTask : groupTaskList){
if(groupTask.getId().longValue() == taskDetail.getId().longValue()){
if (ObjectUtil.isNotNull(beginTime)) {
groupTask.setBeginTime(beginTime);
taskDetail.setBeginTime(beginTime);
}
if (ObjectUtil.isNotNull(endTime)) {
groupTask.setEndTime(endTime);
taskDetail.setEndTime(endTime);
}
}
if(ObjectUtil.isNull(bTime)){
bTime = groupTask.getBeginTime();
}
if(ObjectUtil.isNull(eTime)){
eTime = groupTask.getEndTime();
}
bTime = bTime < groupTask.getBeginTime() ? bTime : groupTask.getBeginTime();
eTime = eTime > groupTask.getEndTime() ? eTime : groupTask.getEndTime();;
}
}
//如果子任务最早最晚时间和父任务不同,则修改父任务时间
if(ObjectUtil.isNotNull(bTime) && ObjectUtil.isNotNull(eTime)) {
if (bTime != parentTask.getBeginTime().longValue() || eTime != parentTask.getEndTime().longValue()) {
parentTask.setBeginTime(bTime);
parentTask.setEndTime(eTime);
taskDetailDao.updateByPrimaryKeySelective(parentTask);
//修改父任务的subTime
ProTaskSubTimeExample subTimeExample = new ProTaskSubTimeExample();
subTimeExample.createCriteria().andTaskDetailIdEqualTo(parentTask.getId());
List<ProTaskSubTime> subTimes = taskSubTimeDao.selectByExample(subTimeExample);
if (CollectionUtil.isNotEmpty(subTimes)) {
ProTaskSubTime subTime = subTimes.get(0);
subTime.setBeginTime(parentTask.getBeginTime());
subTime.setEndTime(parentTask.getEndTime());
taskSubTimeDao.updateByPrimaryKeySelective(subTime);
}
}
}
}else {
if (ObjectUtil.isNotNull(beginTime)) {
taskDetail.setBeginTime(beginTime);
}
if (ObjectUtil.isNotNull(endTime)) {
taskDetail.setEndTime(endTime);
}
}
}
}
private void partTaskSubTime(ProTaskDetail taskDetail){

13
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -388,12 +388,11 @@ public class ProjectService implements IProjectService {
//用户在项目中的最高权限
int power = proRoleService.selectPowerByRoleName(currentUserId, projectId);
if (power > 1) {
// //修改项目状态
// SysProject project = sysProjectDao.selectByPrimaryKey(projectId);
// project.setRecStatus((byte) 1);
// sysProjectDao.updateByPrimaryKeySelective(project);
//彻底删除项目
deleteProjectById(projectId);
// //修改项目删除状态
project.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
sysProjectDao.updateByPrimaryKeySelective(project);
// //彻底删除项目
// deleteProjectById(projectId);
} else {
throw new BaseException(CodeEnum.NOT_POWER);
}
@ -405,7 +404,7 @@ public class ProjectService implements IProjectService {
/**
* 删除项目
*/
private void deleteProjectById(Long projectId) {
private void deleteProjectById(Long projectId) throws Exception {
//删除任务下的角色
proRoleService.deleteRoleByProjectId(projectId);
//删除这个项目被关注的信息

29
tall/src/main/java/com/ccsens/tall/service/SysDomainService.java

@ -2,6 +2,8 @@ package com.ccsens.tall.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.tall.bean.po.SysDomain;
import com.ccsens.tall.bean.po.SysDomainExample;
import com.ccsens.tall.bean.vo.DomainVo;
@ -9,6 +11,7 @@ import com.ccsens.tall.persist.dao.SysDomainDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.Struct;
import java.util.List;
@Service
@ -21,16 +24,26 @@ public class SysDomainService implements ISysDomainService{
*/
@Override
public DomainVo.DomainInfo getDomainByName(String domainName) {
DomainVo.DomainInfo domainInfo = new DomainVo.DomainInfo();
SysDomainExample domainExample = new SysDomainExample();
domainExample.createCriteria().andDomainNameEqualTo(domainName);
List<SysDomain> domainList = sysDomainDao.selectByExample(domainExample);
if(CollectionUtil.isNotEmpty(domainList)){
for(SysDomain domain :domainList){
BeanUtil.copyProperties(domain,domainInfo);
DomainVo.DomainInfo domainInfo = null;
if(StrUtil.isNotEmpty(domainName)) {
SysDomainExample domainExample = new SysDomainExample();
domainExample.createCriteria().andDomainNameEqualTo(domainName);
List<SysDomain> domainList = sysDomainDao.selectByExample(domainExample);
if (CollectionUtil.isNotEmpty(domainList)) {
domainInfo = new DomainVo.DomainInfo();
BeanUtil.copyProperties(domainList.get(0), domainInfo);
}
}
if(ObjectUtil.isNull(domainInfo)){
domainInfo = new DomainVo.DomainInfo();
domainInfo.setDomainName("https://test.tall.wiki/gateway/tall/v1.0");
domainInfo.setLogo("");
domainInfo.setCompanyName("传控电子科技有限公司");
domainInfo.setSystemName("欢迎登录时物链条");
domainInfo.setCaption("TM");
domainInfo.setHeadline("TALL");
domainInfo.setShowCalender(1);
}
return domainInfo;
}
}

5
tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java

@ -97,7 +97,7 @@ public class TaskDeliverService implements ITaskDeliverService {
checkerExample.createCriteria().andDeliverPostLogIdEqualTo(postLog.getId());
List<ProTaskDeliverPostLogChecker> postLogCheckerList = postLogCheckerDao.selectByExample(checkerExample);
if (CollectionUtil.isNotEmpty(postLogCheckerList)) {
Boolean isChecker = false;
Boolean isChecker = true;
for (ProTaskDeliverPostLogChecker checker : postLogCheckerList) {
if (checker.getCheckStatus() == 0) {
deliverInfoByMVP.setStatus("待检查");
@ -269,7 +269,8 @@ public class TaskDeliverService implements ITaskDeliverService {
/**
* 判断id是taskId还是subTimeId
*/
private Long isTaskOrSubTime(Long id) {
@Override
public Long isTaskOrSubTime(Long id) {
Long subTimeId = null;
//获取今天的开始结束时间
Long startTime = DateUtil.getYMD(cn.hutool.core.date.DateUtil.date()).getTime();

2
tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java

@ -148,7 +148,7 @@ public class TaskSubTimeService implements ITaskSubTimeService {
}
}
/**
* 该成员是否完成了此任务
* 该成员是否完成了此任务(返回成员对任务的完成情况)
*/
private ProSubTimeMember isFinishTask(Long memberId, Long subTimeId){
ProSubTimeMember subTimeMember = null;

2
tall/src/main/java/com/ccsens/tall/web/DomainController.java

@ -25,7 +25,7 @@ public class DomainController {
@ApiOperation(value = "通过域名查找域的信息",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "项目Id", required = true, paramType = "path")
@ApiImplicitParam(name = "domainName", value = "域名", required = true, paramType = "query")
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<DomainVo.DomainInfo> getDomainByName(HttpServletRequest request,

2
tall/src/main/java/com/ccsens/tall/web/TaskController.java

@ -138,7 +138,7 @@ public class TaskController {
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务id", required = true, paramType = "query")
})
@RequestMapping(value = "change", method = RequestMethod.DELETE, produces = {"application/json;charset=UTF-8"})
@RequestMapping(value = "change", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateTask(HttpServletRequest request,
@Validated @RequestBody TaskDto.UpdateTaskInfo updateTaskInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());

19
tall/src/main/resources/mapper_dao/ProRoleDao.xml

@ -49,6 +49,8 @@
and
(pr.project_id = #{projectId})
)
AND
rec_status = 0
</select>
<select id="selectSecondRolesByProjectId" parameterType="java.util.Map"
@ -71,6 +73,9 @@
(SELECT name FROM t_pro_role r WHERE pr.parent_id = r.id) in ('PM','Member')
AND
pr.name not IN ('全体成员','观众')
AND
pr.rec_status = 0
</select>
<select id="selectCareLessRoleByProjectIdAndUserId" parameterType="java.util.Map"
@ -85,6 +90,9 @@
(m.user_id = #{userId})
and
(pr.project_id = #{projectId})
AND
pr.rec_status = 0
</select>
<select id="selectRolesByProjectIdAndUserId" parameterType="java.util.Map"
@ -101,6 +109,10 @@
(m.user_id = #{userId})
and
(r.project_id = #{projectId})
AND
r.rec_status = 0
AND
mr.rec_status = 0
</select>
<select id="selectPowerByRoleName" parameterType="java.util.Map"
@ -122,9 +134,10 @@
r.project_id = #{projectId}
AND
(SELECT name FROM t_pro_role pr WHERE r.parent_id = pr.id) in ('PM','Member')
AND
r.name not IN ('全体成员','观众','MVP')
AND
r.name not IN ('全体成员','观众','MVP')
AND
r.rec_status = 0
</select>
<select id="selectByProjectAndName" resultMap="com.ccsens.tall.persist.mapper.ProRoleMapper.BaseResultMap">

2
tall/src/main/resources/mapper_dao/SysProjectDao.xml

@ -76,6 +76,8 @@
a.user_id=#{userId}
AND
s.name like concat('%',#{key},'%')
AND
rec_status = 0
</select>

16
tall/src/main/resources/mapper_dao/TaskDetailDao.xml

@ -63,6 +63,8 @@
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
AND
d.project_id = #{projectId}
AND
d.executor_role = #{roleId}
@ -105,6 +107,8 @@
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
AND
d.project_id = #{projectId}
AND
d.parent_id = #{parentId}
@ -138,6 +142,8 @@
FROM
t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id
WHERE
d.rec_status = 0
AND
d.id = #{taskId}
AND
s.id = #{subTimeId}
@ -169,6 +175,8 @@
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
AND
d.parent_id = #{parentId}
group by s.task_detail_id
</select>
@ -180,6 +188,8 @@
FROM
t_pro_task_sub_time s JOIN t_pro_task_detail t ON s.task_detail_id = t.id
WHERE
t.rec_status = 0
AND
t.parent_id = #{parentId}
AND
s.begin_time &gt;= #{beginTime}
@ -195,6 +205,8 @@
WHERE
a.user_id = #{userId}
AND
t.rec_status = 0
AND
t.name like concat('%',#{key},'%')
<if test="projectId != null" >
AND
@ -226,6 +238,8 @@
LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id
LEFT JOIN t_sys_plugin sp ON sp.id = p.plugin_id
WHERE
d.rec_status = 0
AND
d.parent_id = #{parentId}
AND
s.begin_time &lt; #{endTime}
@ -243,6 +257,8 @@
FROM
t_pro_task_sub_time s join t_pro_task_detail d on s.task_detail_id = d.id
WHERE
d.rec_status = 0
AND
d.id = #{detailId}
AND
s.begin_time &lt;= #{now}

42
tall/src/main/resources/mapper_raw/SysDomainMapper.xml

@ -9,6 +9,8 @@
<result column="system_name" jdbcType="VARCHAR" property="systemName" />
<result column="show_calendar" jdbcType="TINYINT" property="showCalendar" />
<result column="show_project_id" jdbcType="BIGINT" property="showProjectId" />
<result column="caption" jdbcType="VARCHAR" property="caption" />
<result column="headline" jdbcType="VARCHAR" property="headline" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -73,7 +75,7 @@
</sql>
<sql id="Base_Column_List">
id, domain_name, logo, company_name, system_name, show_calendar, show_project_id,
created_at, updated_at, rec_status
caption, headline, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysDomainExample" resultMap="BaseResultMap">
select
@ -108,12 +110,14 @@
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysDomain">
insert into t_sys_domain (id, domain_name, logo,
company_name, system_name, show_calendar,
show_project_id, created_at, updated_at,
rec_status)
show_project_id, caption, headline,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{domainName,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR},
#{companyName,jdbcType=VARCHAR}, #{systemName,jdbcType=VARCHAR}, #{showCalendar,jdbcType=TINYINT},
#{showProjectId,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{showProjectId,jdbcType=BIGINT}, #{caption,jdbcType=VARCHAR}, #{headline,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysDomain">
insert into t_sys_domain
@ -139,6 +143,12 @@
<if test="showProjectId != null">
show_project_id,
</if>
<if test="caption != null">
caption,
</if>
<if test="headline != null">
headline,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -171,6 +181,12 @@
<if test="showProjectId != null">
#{showProjectId,jdbcType=BIGINT},
</if>
<if test="caption != null">
#{caption,jdbcType=VARCHAR},
</if>
<if test="headline != null">
#{headline,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -212,6 +228,12 @@
<if test="record.showProjectId != null">
show_project_id = #{record.showProjectId,jdbcType=BIGINT},
</if>
<if test="record.caption != null">
caption = #{record.caption,jdbcType=VARCHAR},
</if>
<if test="record.headline != null">
headline = #{record.headline,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -235,6 +257,8 @@
system_name = #{record.systemName,jdbcType=VARCHAR},
show_calendar = #{record.showCalendar,jdbcType=TINYINT},
show_project_id = #{record.showProjectId,jdbcType=BIGINT},
caption = #{record.caption,jdbcType=VARCHAR},
headline = #{record.headline,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -263,6 +287,12 @@
<if test="showProjectId != null">
show_project_id = #{showProjectId,jdbcType=BIGINT},
</if>
<if test="caption != null">
caption = #{caption,jdbcType=VARCHAR},
</if>
<if test="headline != null">
headline = #{headline,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -283,6 +313,8 @@
system_name = #{systemName,jdbcType=VARCHAR},
show_calendar = #{showCalendar,jdbcType=TINYINT},
show_project_id = #{showProjectId,jdbcType=BIGINT},
caption = #{caption,jdbcType=VARCHAR},
headline = #{headline,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

4
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -65,8 +65,8 @@ public enum CodeEnum {
REPEAT_PROJECT_NAME(51,"项目名不能重复,请修改后重试",true),
TIME_ERROR_BEGIN(52,"时间异常,开始时间不能大于结束时间",true),
TIME_ERROR_PROJECT(53,"时间异常,时间不在项目范围内",true),
HAS_GROUP_TIME_CHANGE(54,"分组任务不能修改时间,请修改其子任务时间",true)
TIME_ERROR_PROJECT(53,"时间异常,任务的时间不能超出项目的时间",true),
HAS_GROUP_TIME_CHANGE(54,"分组任务不能直接修改时间,请修改其子任务时间",true)
;
public CodeEnum addMsg(String msg){

116
util/src/main/java/com/ccsens/util/WebConstant.java

@ -92,21 +92,6 @@ public class WebConstant {
this.value =value;
this.phase = thePhase;
}
// public static ROLE_NAME valueOf(int value) {
// switch (value) {
// case "上帝": return God;
// case "管代": return ManageRepresent;
// case "干系人": return Stakeholder;
// case "项目经理": return PM;
// case "项目成员": return Member;
// case "MVP": return MVP;
// case "Attention": return Attention;
// case "Creator": return Creator;
// case "MoneyStakeholder": return MoneyStakeholder;
// case "AllMember": return AllMember;
// default: return null;
// }
// }
}
public enum TASK_VIRTUAL {
Normal(0,"普通任务"), Virtual(1,"虚拟任务");
@ -136,11 +121,11 @@ public class WebConstant {
}
}
public enum REC_STATUS {
Normal(0,"正常"), Disabled(1,"已禁用"),Deleted(2,"已删除");
Normal((byte) 0,"正常"), Disabled((byte) 1,"已禁用"),Deleted((byte) 2,"已删除");
public int value;
public byte value;
public String phase;
REC_STATUS(int value,String thePhase){
REC_STATUS(byte value,String thePhase){
this.value =value;
this.phase = thePhase;
}
@ -457,10 +442,11 @@ public class WebConstant {
}
}
public static Message_Ack_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Ack"))
if(phase.equalsIgnoreCase("Ack")) {
return Ack;
else
} else {
return null;
}
}
}
@ -485,20 +471,26 @@ public class WebConstant {
}
}
public static Message_Sync_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Start"))
if(phase.equalsIgnoreCase("Start")) {
return Start;
if(phase.equalsIgnoreCase("ChangeDuration"))
}
if(phase.equalsIgnoreCase("ChangeDuration")) {
return ChangeDuration;
if(phase.equalsIgnoreCase("Move"))
}
if(phase.equalsIgnoreCase("Move")) {
return Move;
if(phase.equalsIgnoreCase("Remove"))
}
if(phase.equalsIgnoreCase("Remove")) {
return Remove;
if(phase.equalsIgnoreCase("Add"))
}
if(phase.equalsIgnoreCase("Add")) {
return Add;
if(phase.equalsIgnoreCase("ChangeBeginTime"))
}
if(phase.equalsIgnoreCase("ChangeBeginTime")) {
return ChangeBeginTime;
else
} else {
return null;
}
}
}
@ -519,14 +511,17 @@ public class WebConstant {
}
}
public static Message_Node_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("ChangeStatus"))
if(phase.equalsIgnoreCase("ChangeStatus")) {
return ChangeStatus;
if(phase.equalsIgnoreCase("PostComment"))
}
if(phase.equalsIgnoreCase("PostComment")) {
return PostComment;
if(phase.equalsIgnoreCase("UploadDeliver"))
}
if(phase.equalsIgnoreCase("UploadDeliver")) {
return UploadDeliver;
else
} else {
return null;
}
}
}
@ -546,12 +541,14 @@ public class WebConstant {
}
}
public static Message_User_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("HasRead"))
if(phase.equalsIgnoreCase("HasRead")) {
return HasRead;
if(phase.equalsIgnoreCase("User"))
}
if(phase.equalsIgnoreCase("User")) {
return User;
else
} else {
return null;
}
}
}
@ -593,10 +590,11 @@ public class WebConstant {
}
}
public static Message_Auth_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Auth"))
if(phase.equalsIgnoreCase("Auth")) {
return Auth;
else
} else {
return null;
}
}
}
@ -615,10 +613,11 @@ public class WebConstant {
}
}
public static Message_Channel_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Channel"))
if(phase.equalsIgnoreCase("Channel")) {
return Channel;
else
} else {
return null;
}
}
}
@ -639,14 +638,17 @@ public class WebConstant {
}
}
public static Message_MasterStatus_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Report"))
if(phase.equalsIgnoreCase("Report")) {
return Report;
if(phase.equalsIgnoreCase("Query"))
}
if(phase.equalsIgnoreCase("Query")) {
return Query;
if(phase.equalsIgnoreCase("Answer"))
}
if(phase.equalsIgnoreCase("Answer")) {
return Answer;
else
} else {
return null;
}
}
}
@ -697,10 +699,12 @@ public class WebConstant {
}
}
public static Message_BatchSetting_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Apply"))
if(phase.equalsIgnoreCase("Apply")) {
return Apply;
if(phase.equalsIgnoreCase("Answer"))
}
if(phase.equalsIgnoreCase("Answer")) {
return Answer;
}
return null;
}
}
@ -720,10 +724,11 @@ public class WebConstant {
}
}
public static Message_Admin_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("FindAll"))
if(phase.equalsIgnoreCase("FindAll")) {
return FindAll;
else
} else {
return null;
}
}
}
@ -744,12 +749,14 @@ public class WebConstant {
}
}
public static Message_Ring_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Send"))
if(phase.equalsIgnoreCase("Send")) {
return Send;
if(phase.equalsIgnoreCase("Read"))
}
if(phase.equalsIgnoreCase("Read")) {
return Read;
else
} else {
return null;
}
}
}
public enum Message_Deliver_Event{
@ -771,14 +778,17 @@ public class WebConstant {
}
}
public static Message_Deliver_Event phaseOf(String phase) { // 手写的从String到enum的转换函数
if(phase.equalsIgnoreCase("Upload"))
if(phase.equalsIgnoreCase("Upload")) {
return Upload;
if(phase.equalsIgnoreCase("Checker"))
}
if(phase.equalsIgnoreCase("Checker")) {
return Checker;
if(phase.equalsIgnoreCase("Delete"))
}
if(phase.equalsIgnoreCase("Delete")) {
return Delete;
else
} else {
return null;
}
}
}

Loading…
Cancel
Save