Browse Source

0701

master
zy_Java 5 years ago
parent
commit
a29f00fa7d
  1. 11
      tall/src/main/java/com/ccsens/tall/bean/po/ProNotes.java
  2. 60
      tall/src/main/java/com/ccsens/tall/bean/po/ProNotesExample.java
  3. 1
      tall/src/main/java/com/ccsens/tall/bean/vo/PluginVo.java
  4. 13
      tall/src/main/java/com/ccsens/tall/persist/dao/ProNotesDao.java
  5. 9
      tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java
  6. 2
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  7. 7
      tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java
  8. 19
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  9. 4
      tall/src/main/resources/application.yml
  10. 29
      tall/src/main/resources/mapper_raw/ProNotesMapper.xml

11
tall/src/main/java/com/ccsens/tall/bean/po/ProNotes.java

@ -12,6 +12,8 @@ public class ProNotes implements Serializable {
private Long pluginId;
private Long userId;
private Long roleId;
private Long time;
@ -58,6 +60,14 @@ public class ProNotes implements Serializable {
this.pluginId = pluginId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId() {
return roleId;
}
@ -116,6 +126,7 @@ public class ProNotes implements Serializable {
sb.append(", value=").append(value);
sb.append(", taskId=").append(taskId);
sb.append(", pluginId=").append(pluginId);
sb.append(", userId=").append(userId);
sb.append(", roleId=").append(roleId);
sb.append(", time=").append(time);
sb.append(", publicity=").append(publicity);

60
tall/src/main/java/com/ccsens/tall/bean/po/ProNotesExample.java

@ -355,6 +355,66 @@ public class ProNotesExample {
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andRoleIdIsNull() {
addCriterion("role_id is null");
return (Criteria) this;

1
tall/src/main/java/com/ccsens/tall/bean/vo/PluginVo.java

@ -82,4 +82,5 @@ public class PluginVo {
@ApiModelProperty("是否公开展示 0否 1是")
private int publicity;
}
}

13
tall/src/main/java/com/ccsens/tall/persist/dao/ProNotesDao.java

@ -1,11 +1,24 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.persist.mapper.ProNotesMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author
*/
@Repository
public interface ProNotesDao extends ProNotesMapper {
/**
* 查找任务下的笔记
* @param userId 用户id
* @param taskId 任务id
* @param pluginId 被记笔记的插件的id可以为null
* @return 返回笔记list
*/
List<PluginVo.NotesInfo> listNotesInfo(@Param("userId") Long userId, @Param("taskId")Long taskId,@Param("pluginId") Long pluginId);
}

9
tall/src/main/java/com/ccsens/tall/service/ITaskPluginService.java

@ -28,4 +28,13 @@ public interface ITaskPluginService {
* @return 返回笔记的详情
*/
PluginVo.NotesInfo saveNotes(Long currentUserId, PluginDto.SaveNotes saveNotes);
/**
* 查询任务下的笔记
* @param currentUserId userId
* @param taskId 任务Id
* @param pluginId 被查询的插件的id不是笔记插件的id,只查询任务的笔记时不需要传参
* @return 返回任务下的所有笔记信息
*/
List<PluginVo.NotesInfo> listNotesInfo(Long currentUserId, Long taskId, Long pluginId);
}

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

@ -527,7 +527,7 @@ public class TaskDeliverService implements ITaskDeliverService {
if (checkDeliver.getCheckStatus()) {
postLogChecker.setCheckStatus(1);
} else {
postLogChecker.setCheckStatus(-1);
postLogChecker.setCheckStatus(2);
returnTask(subTimeId);
}
postLogCheckerDao.updateByPrimaryKeySelective(postLogChecker);

7
tall/src/main/java/com/ccsens/tall/service/TaskPluginService.java

@ -220,6 +220,7 @@ public class TaskPluginService implements ITaskPluginService{
proNotes.setId(snowflake.nextId());
proNotes.setTaskId(taskSubTime.getId());
proNotes.setRoleId(saveNotes.getRoleId());
proNotes.setUserId(currentUserId);
proNotes.setPluginId(saveNotes.getPluginId());
proNotes.setValue(saveNotes.getValue());
if(ObjectUtil.isNotNull(saveNotes.getPublicity())) {
@ -239,4 +240,10 @@ public class TaskPluginService implements ITaskPluginService{
notesInfo.setPublicity(proNotes.getPublicity());
return notesInfo;
}
@Override
public List<PluginVo.NotesInfo> listNotesInfo(Long currentUserId, Long taskId, Long pluginId) {
// List<PluginVo.NotesInfo> notesInfoList = proNotesDao.listNotesInfo(currentUserId,taskId,pluginId);
return null;
}
}

19
tall/src/main/java/com/ccsens/tall/web/PluginController.java

@ -10,10 +10,7 @@ import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.annotation.OperateType;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -121,4 +118,18 @@ public class PluginController {
PluginVo.NotesInfo notesInfo = taskPluginService.saveNotes(currentUserId,saveNotes);
return JsonResponse.newInstance().ok(notesInfo);
}
@ApiOperation(value = "查找笔记", notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "任务Id", required = true, paramType = "query"),
@ApiImplicitParam(name = "page", value = "被查询的插件的id,不是笔记插件的id,只查询任务的笔记时不需要传参", required = true, paramType = "query")
})
@RequestMapping(value = "comment", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PluginVo.NotesInfo>> getNotesInfo(HttpServletRequest request,
@RequestParam(required = true) Long taskId,
@RequestParam(required = false) Long pluginId) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
List<PluginVo.NotesInfo> notesInfoList = taskPluginService.listNotesInfo(currentUserId,taskId,pluginId);
return JsonResponse.newInstance().ok(notesInfoList);
}
}

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

29
tall/src/main/resources/mapper_raw/ProNotesMapper.xml

@ -6,6 +6,7 @@
<result column="value" jdbcType="VARCHAR" property="value" />
<result column="task_id" jdbcType="BIGINT" property="taskId" />
<result column="plugin_id" jdbcType="BIGINT" property="pluginId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="role_id" jdbcType="BIGINT" property="roleId" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="publicity" jdbcType="TINYINT" property="publicity" />
@ -72,7 +73,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, value, task_id, plugin_id, role_id, time, publicity, created_at, updated_at,
id, value, task_id, plugin_id, user_id, role_id, time, publicity, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProNotesExample" resultMap="BaseResultMap">
@ -107,13 +108,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProNotes">
insert into t_pro_notes (id, value, task_id,
plugin_id, role_id, time,
publicity, created_at, updated_at,
rec_status)
plugin_id, user_id, role_id,
time, publicity, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{value,jdbcType=VARCHAR}, #{taskId,jdbcType=BIGINT},
#{pluginId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, #{time,jdbcType=BIGINT},
#{publicity,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{pluginId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT},
#{time,jdbcType=BIGINT}, #{publicity,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProNotes">
insert into t_pro_notes
@ -130,6 +131,9 @@
<if test="pluginId != null">
plugin_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="roleId != null">
role_id,
</if>
@ -162,6 +166,9 @@
<if test="pluginId != null">
#{pluginId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
@ -203,6 +210,9 @@
<if test="record.pluginId != null">
plugin_id = #{record.pluginId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=BIGINT},
</if>
@ -232,6 +242,7 @@
value = #{record.value,jdbcType=VARCHAR},
task_id = #{record.taskId,jdbcType=BIGINT},
plugin_id = #{record.pluginId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
role_id = #{record.roleId,jdbcType=BIGINT},
time = #{record.time,jdbcType=BIGINT},
publicity = #{record.publicity,jdbcType=TINYINT},
@ -254,6 +265,9 @@
<if test="pluginId != null">
plugin_id = #{pluginId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=BIGINT},
</if>
@ -280,6 +294,7 @@
set value = #{value,jdbcType=VARCHAR},
task_id = #{taskId,jdbcType=BIGINT},
plugin_id = #{pluginId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=BIGINT},
role_id = #{roleId,jdbcType=BIGINT},
time = #{time,jdbcType=BIGINT},
publicity = #{publicity,jdbcType=TINYINT},

Loading…
Cancel
Save