Browse Source

修改交付物图片展示路径,增加消息的操作类型

recovery
ma 4 years ago
parent
commit
6586732af8
  1. 11
      tall/src/main/java/com/ccsens/tall/bean/po/SysOperation.java
  2. 60
      tall/src/main/java/com/ccsens/tall/bean/po/SysOperationExample.java
  3. 2
      tall/src/main/java/com/ccsens/tall/bean/vo/DeliverVo.java
  4. 104
      tall/src/main/java/com/ccsens/tall/service/SysPluginService.java
  5. 26
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  6. 4
      tall/src/main/resources/application-dev.yml
  7. 3
      tall/src/main/resources/mapper_dao/DeliverDao.xml
  8. 29
      tall/src/main/resources/mapper_raw/SysOperationMapper.xml

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

@ -22,6 +22,8 @@ public class SysOperation implements Serializable {
private Long taskDetailId; private Long taskDetailId;
private Byte doType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -96,6 +98,14 @@ public class SysOperation implements Serializable {
this.taskDetailId = taskDetailId; this.taskDetailId = taskDetailId;
} }
public Byte getDoType() {
return doType;
}
public void setDoType(Byte doType) {
this.doType = doType;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -111,6 +121,7 @@ public class SysOperation implements Serializable {
sb.append(", updatedAt=").append(updatedAt); sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus); sb.append(", recStatus=").append(recStatus);
sb.append(", taskDetailId=").append(taskDetailId); sb.append(", taskDetailId=").append(taskDetailId);
sb.append(", doType=").append(doType);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }

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

@ -644,6 +644,66 @@ public class SysOperationExample {
addCriterion("task_detail_id not between", value1, value2, "taskDetailId"); addCriterion("task_detail_id not between", value1, value2, "taskDetailId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDoTypeIsNull() {
addCriterion("do_type is null");
return (Criteria) this;
}
public Criteria andDoTypeIsNotNull() {
addCriterion("do_type is not null");
return (Criteria) this;
}
public Criteria andDoTypeEqualTo(Byte value) {
addCriterion("do_type =", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeNotEqualTo(Byte value) {
addCriterion("do_type <>", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeGreaterThan(Byte value) {
addCriterion("do_type >", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("do_type >=", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeLessThan(Byte value) {
addCriterion("do_type <", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeLessThanOrEqualTo(Byte value) {
addCriterion("do_type <=", value, "doType");
return (Criteria) this;
}
public Criteria andDoTypeIn(List<Byte> values) {
addCriterion("do_type in", values, "doType");
return (Criteria) this;
}
public Criteria andDoTypeNotIn(List<Byte> values) {
addCriterion("do_type not in", values, "doType");
return (Criteria) this;
}
public Criteria andDoTypeBetween(Byte value1, Byte value2) {
addCriterion("do_type between", value1, value2, "doType");
return (Criteria) this;
}
public Criteria andDoTypeNotBetween(Byte value1, Byte value2) {
addCriterion("do_type not between", value1, value2, "doType");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {

2
tall/src/main/java/com/ccsens/tall/bean/vo/DeliverVo.java

@ -41,6 +41,8 @@ public class DeliverVo {
private Long deleteTime; private Long deleteTime;
@ApiModelProperty("交付物访问路径") @ApiModelProperty("交付物访问路径")
private String url; private String url;
@ApiModelProperty("交付物文件名称")
private String fileName;
@ApiModelProperty("WPS文件信息") @ApiModelProperty("WPS文件信息")
private List<String> wpsFilePaths; private List<String> wpsFilePaths;
@ApiModelProperty("是否是历史交付物 1是 0不是") @ApiModelProperty("是否是历史交付物 1是 0不是")

104
tall/src/main/java/com/ccsens/tall/service/SysPluginService.java

@ -105,37 +105,45 @@ public class SysPluginService implements ISysPluginService{
if (plugin.getFileIdList().contains(",")){ if (plugin.getFileIdList().contains(",")){
String[] split = plugin.getFileIdList().split(","); String[] split = plugin.getFileIdList().split(",");
List<String> splits =new ArrayList<>(Arrays.asList(split)); List<String> splits =new ArrayList<>(Arrays.asList(split));
//获取文件项目的路径 try{
String requestUrl = PropUtil.filedeal; //获取文件项目的路径
//通过文件id查询文件信息 String requestUrl = PropUtil.filedeal;
String c = RestTemplateUtil.postBody1(requestUrl,splits); //通过文件id查询文件信息
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class); String c = RestTemplateUtil.postBody1(requestUrl,splits);
//遍历区分是图标还是预览图 JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class); //遍历区分是图标还是预览图
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions)){ List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
for (int i = 0; i < filePositions.size(); i++) { if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions)){
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){ for (int i = 0; i < filePositions.size(); i++) {
plugin.setIconUrl(filePositions.get(i)); if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
filePositions.remove(filePositions.get(i)); plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
}
} }
plugin.setPreviewImgs(filePositions);
} }
plugin.setPreviewImgs(filePositions); }catch (Exception e){
log.info("查询文件信息失败:{}", e);
} }
}else{ }else{
//不包含逗号说明没有预览图,只有图标 //不包含逗号说明没有预览图,只有图标
List<String> id = new ArrayList<>(); List<String> id = new ArrayList<>();
id.add(plugin.getFileIdList()); id.add(plugin.getFileIdList());
//获取文件项目的路径 try {
String requestUrl = PropUtil.filedeal; //获取文件项目的路径
//通过文件id查询文件信息 String requestUrl = PropUtil.filedeal;
String c = RestTemplateUtil.postBody1(requestUrl,id); //通过文件id查询文件信息
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class); String c = RestTemplateUtil.postBody1(requestUrl,id);
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class); List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){ if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0)); plugin.setIconUrl(filePositions.get(0));
}
}catch (Exception e){
log.info("查询文件信息失败:{}",e);
} }
} }
}); });
return plugins; return plugins;
@ -160,37 +168,45 @@ public class SysPluginService implements ISysPluginService{
if (plugin.getFileIdList().contains(",")){ if (plugin.getFileIdList().contains(",")){
String[] split = plugin.getFileIdList().split(","); String[] split = plugin.getFileIdList().split(",");
List<String> splits =new ArrayList<>(Arrays.asList(split)); List<String> splits =new ArrayList<>(Arrays.asList(split));
//获取文件项目的路径 try {
String requestUrl = PropUtil.filedeal; //获取文件项目的路径
//通过文件id查询文件信息 String requestUrl = PropUtil.filedeal;
String c = RestTemplateUtil.postBody1(requestUrl,splits); //通过文件id查询文件信息
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class); String c = RestTemplateUtil.postBody1(requestUrl,splits);
//遍历区分是图标还是预览图 JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class); //遍历区分是图标还是预览图
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions)){ List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
for (int i = 0; i < filePositions.size(); i++) { if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions)){
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){ for (int i = 0; i < filePositions.size(); i++) {
plugin.setIconUrl(filePositions.get(i)); if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
filePositions.remove(filePositions.get(i)); plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
}
} }
plugin.setPreviewImgs(filePositions);
} }
plugin.setPreviewImgs(filePositions); }catch (Exception e){
log.info("获取文件信息失败",e);
} }
}else{ }else{
//不包含逗号说明没有预览图,只有图标 //不包含逗号说明没有预览图,只有图标
List<String> id = new ArrayList<>(); List<String> id = new ArrayList<>();
id.add(plugin.getFileIdList()); id.add(plugin.getFileIdList());
//获取文件项目的路径 try {
String requestUrl = PropUtil.filedeal; //获取文件项目的路径
//通过文件id查询文件信息 String requestUrl = PropUtil.filedeal;
String c = RestTemplateUtil.postBody1(requestUrl,id); //通过文件id查询文件信息
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class); String c = RestTemplateUtil.postBody1(requestUrl,id);
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class); List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){ if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0)); plugin.setIconUrl(filePositions.get(0));
}
}catch (Exception e){
log.info("获取文件信息失败");
} }
} }
}); });
return new PageInfo<>(plugins); return new PageInfo<>(plugins);

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

@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake; import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.tall.bean.dto.DeliverDto; import com.ccsens.tall.bean.dto.DeliverDto;
import com.ccsens.tall.bean.dto.WpsDto; import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.dto.message.BaseMessageDto; import com.ccsens.tall.bean.dto.message.BaseMessageDto;
@ -12,6 +14,7 @@ import com.ccsens.tall.bean.dto.message.DeliverMessageWithDeleteDto;
import com.ccsens.tall.bean.dto.message.DeliverMessageWithUploadDto; import com.ccsens.tall.bean.dto.message.DeliverMessageWithUploadDto;
import com.ccsens.tall.bean.po.*; import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.DeliverVo; import com.ccsens.tall.bean.vo.DeliverVo;
import com.ccsens.tall.bean.vo.FileVo;
import com.ccsens.tall.bean.vo.ProjectVo; import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.bean.vo.TaskVo; import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.persist.dao.*; import com.ccsens.tall.persist.dao.*;
@ -468,13 +471,26 @@ public class TaskDeliverService implements ITaskDeliverService {
if("1".equalsIgnoreCase(filePath.getIsHistory())){ if("1".equalsIgnoreCase(filePath.getIsHistory())){
filePath.setDeleteTime(filePath.getUpdateTime().getTime()); filePath.setDeleteTime(filePath.getUpdateTime().getTime());
} }
// TODO 修改文件路径为可下载路径 try {
List<String> a = new ArrayList<>(); // TODO 修改文件路径为可下载路径
a.add(filePath.getFileId().toString()); List<String> id = new ArrayList<>();
id.add(filePath.getFileId().toString());
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
String c = RestTemplateUtil.postBody1(requestUrl,id);
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
for (FileVo.FilePosition filePosition : filePositions) {
filePath.setUrl(filePosition.getVisitUrl());
filePath.setFileName(filePosition.getName());
}
}catch (Exception e){
log.info("查询文件信息失败:{}", e);
}
// if(StrUtil.isNotEmpty(filePath.getUrl())) { // if(StrUtil.isNotEmpty(filePath.getUrl())) {
//// filePath.setUrl(WebConstant.TEST_URL_BASE + filePath.getUrl()); // filePath.setUrl(WebConstant.TEST_URL_BASE + filePath.getUrl());
// filePath.setUrl(PropUtil.imgDomain + "/" + filePath.getUrl()); // filePath.setUrl(PropUtil.imgDomain + "/" + filePath.getUrl());
// } // }
if (ObjectUtil.isNotNull(filePath.getUploaderId())) { if (ObjectUtil.isNotNull(filePath.getUploaderId())) {

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

@ -41,8 +41,8 @@ file:
domain: http://localhost:7030/v1.0/ domain: http://localhost:7030/v1.0/
imgDomain: http://localhost:7030/v1.0/uploads imgDomain: http://localhost:7030/v1.0/uploads
#filedeal: http://localhost:8001/file/query #filedeal: http://localhost:8001/file/query
filedeal: https://test.tall.wiki/file/query filedeal: https://test.tall.wiki/filedeal/file/query
project: project:
# redis是否需要加载 0:否 1 是 # redis是否需要加载 0:否 1 是
redisUpdate: 1 redisUpdate: 1
redisUpdateUrl: http://localhost:8001/constant/updateAll/ redisUpdateUrl: http://localhost:8001/constant/updateAll/

3
tall/src/main/resources/mapper_dao/DeliverDao.xml

@ -140,10 +140,9 @@
resultMap="resultMap_FilePath"> resultMap="resultMap_FilePath">
SELECT SELECT
l.id as deliverLogId, l.id as deliverLogId,
f.id as fileId, l.file_id as fileId,
l.updated_at as updateTime, l.updated_at as updateTime,
l.description as description, l.description as description,
f.path as url,
l.time as uploadTime, l.time as uploadTime,
l.is_history as history, l.is_history as history,
l.user_id as userId l.user_id as userId

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

@ -11,6 +11,7 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> <result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="task_detail_id" jdbcType="BIGINT" property="taskDetailId" /> <result column="task_detail_id" jdbcType="BIGINT" property="taskDetailId" />
<result column="do_type" jdbcType="TINYINT" property="doType" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -72,7 +73,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, operator_id, project_id, operate_type, operation_time, created_at, updated_at, id, operator_id, project_id, operate_type, operation_time, created_at, updated_at,
rec_status, task_detail_id rec_status, task_detail_id, do_type
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultMap="BaseResultMap">
select select
@ -107,12 +108,12 @@
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysOperation"> <insert id="insert" parameterType="com.ccsens.tall.bean.po.SysOperation">
insert into t_sys_operation (id, operator_id, project_id, insert into t_sys_operation (id, operator_id, project_id,
operate_type, operation_time, created_at, operate_type, operation_time, created_at,
updated_at, rec_status, task_detail_id updated_at, rec_status, task_detail_id,
) do_type)
values (#{id,jdbcType=BIGINT}, #{operatorId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{operatorId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT},
#{operateType,jdbcType=TINYINT}, #{operationTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{operateType,jdbcType=TINYINT}, #{operationTime,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{taskDetailId,jdbcType=BIGINT} #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{taskDetailId,jdbcType=BIGINT},
) #{doType,jdbcType=TINYINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysOperation"> <insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysOperation">
insert into t_sys_operation insert into t_sys_operation
@ -144,6 +145,9 @@
<if test="taskDetailId != null"> <if test="taskDetailId != null">
task_detail_id, task_detail_id,
</if> </if>
<if test="doType != null">
do_type,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -173,6 +177,9 @@
<if test="taskDetailId != null"> <if test="taskDetailId != null">
#{taskDetailId,jdbcType=BIGINT}, #{taskDetailId,jdbcType=BIGINT},
</if> </if>
<if test="doType != null">
#{doType,jdbcType=TINYINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultType="java.lang.Long">
@ -211,6 +218,9 @@
<if test="record.taskDetailId != null"> <if test="record.taskDetailId != null">
task_detail_id = #{record.taskDetailId,jdbcType=BIGINT}, task_detail_id = #{record.taskDetailId,jdbcType=BIGINT},
</if> </if>
<if test="record.doType != null">
do_type = #{record.doType,jdbcType=TINYINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -226,7 +236,8 @@
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}, rec_status = #{record.recStatus,jdbcType=TINYINT},
task_detail_id = #{record.taskDetailId,jdbcType=BIGINT} task_detail_id = #{record.taskDetailId,jdbcType=BIGINT},
do_type = #{record.doType,jdbcType=TINYINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -258,6 +269,9 @@
<if test="taskDetailId != null"> <if test="taskDetailId != null">
task_detail_id = #{taskDetailId,jdbcType=BIGINT}, task_detail_id = #{taskDetailId,jdbcType=BIGINT},
</if> </if>
<if test="doType != null">
do_type = #{doType,jdbcType=TINYINT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -270,7 +284,8 @@
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}, rec_status = #{recStatus,jdbcType=TINYINT},
task_detail_id = #{taskDetailId,jdbcType=BIGINT} task_detail_id = #{taskDetailId,jdbcType=BIGINT},
do_type = #{doType,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
Loading…
Cancel
Save