Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zhizhi wu 4 years ago
parent
commit
84543350a3
  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. 48
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  6. 8
      tall/src/main/resources/application-dev.yml
  7. 7
      tall/src/main/resources/application-prod.yml
  8. 5
      tall/src/main/resources/application-test.yml
  9. 4
      tall/src/main/resources/application.yml
  10. 3
      tall/src/main/resources/mapper_dao/DeliverDao.xml
  11. 29
      tall/src/main/resources/mapper_raw/SysOperationMapper.xml
  12. 2
      util/src/main/java/com/ccsens/util/PropUtil.java

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

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

@ -41,6 +41,8 @@ public class DeliverVo {
private Long deleteTime;
@ApiModelProperty("交付物访问路径")
private String url;
@ApiModelProperty("交付物文件名称")
private String fileName;
@ApiModelProperty("WPS文件信息")
private List<String> wpsFilePaths;
@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(",")){
String[] split = plugin.getFileIdList().split(",");
List<String> splits =new ArrayList<>(Arrays.asList(split));
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
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)){
for (int i = 0; i < filePositions.size(); i++) {
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
try{
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
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)){
for (int i = 0; i < filePositions.size(); i++) {
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
}
}
plugin.setPreviewImgs(filePositions);
}
plugin.setPreviewImgs(filePositions);
}catch (Exception e){
log.info("查询文件信息失败:{}", e);
}
}else{
//不包含逗号说明没有预览图,只有图标
List<String> id = new ArrayList<>();
id.add(plugin.getFileIdList());
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
String c = RestTemplateUtil.postBody1(requestUrl,id);
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
try {
//获取文件项目的路径
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);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0));
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0));
}
}catch (Exception e){
log.info("查询文件信息失败:{}",e);
}
}
});
return plugins;
@ -160,37 +168,45 @@ public class SysPluginService implements ISysPluginService{
if (plugin.getFileIdList().contains(",")){
String[] split = plugin.getFileIdList().split(",");
List<String> splits =new ArrayList<>(Arrays.asList(split));
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
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)){
for (int i = 0; i < filePositions.size(); i++) {
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
try {
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
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)){
for (int i = 0; i < filePositions.size(); i++) {
if (filePositions.get(i).getId().equals(plugin.getPluginIcon())){
plugin.setIconUrl(filePositions.get(i));
filePositions.remove(filePositions.get(i));
}
}
plugin.setPreviewImgs(filePositions);
}
plugin.setPreviewImgs(filePositions);
}catch (Exception e){
log.info("获取文件信息失败",e);
}
}else{
//不包含逗号说明没有预览图,只有图标
List<String> id = new ArrayList<>();
id.add(plugin.getFileIdList());
//获取文件项目的路径
String requestUrl = PropUtil.filedeal;
//通过文件id查询文件信息
String c = RestTemplateUtil.postBody1(requestUrl,id);
JsonResponse a = JSONObject.parseObject(c, JsonResponse.class);
try {
//获取文件项目的路径
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);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0));
List<FileVo.FilePosition> filePositions = JSONArray.parseArray(a.getData().toString(), FileVo.FilePosition.class);
if(ObjectUtil.isNotNull(filePositions) && ObjectUtil.isNotNull(filePositions) && !filePositions.isEmpty()){
plugin.setIconUrl(filePositions.get(0));
}
}catch (Exception e){
log.info("获取文件信息失败");
}
}
});
return new PageInfo<>(plugins);

48
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.util.ObjectUtil;
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.WpsDto;
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.po.*;
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.TaskVo;
import com.ccsens.tall.persist.dao.*;
@ -217,15 +220,15 @@ public class TaskDeliverService implements ITaskDeliverService {
//将文件信息与交付物绑定,添加记录deliverPostLog
if (CollectionUtil.isNotEmpty(uploadDeliver.getFileInfo())) {
for (DeliverDto.FileInfo fileInfo : uploadDeliver.getFileInfo()) {
SysCommitedFile file = commitedFileDao.selectByPrimaryKey(fileInfo.getId());
if(ObjectUtil.isNull(file)){
throw new BaseException(CodeEnum.NOT_DELIVER_FILE);
}
// SysCommitedFile file = commitedFileDao.selectByPrimaryKey(fileInfo.getId());
// if(ObjectUtil.isNull(file)){
// throw new BaseException(CodeEnum.NOT_DELIVER_FILE);
// }
ProTaskDeliverPostLog deliverPostLog = new ProTaskDeliverPostLog();
deliverPostLog.setId(snowflake.nextId());
deliverPostLog.setDeliverId(uploadDeliver.getDeliverId());
deliverPostLog.setTaskSubTimeId(subTimeId);
deliverPostLog.setFileId(file.getId());
deliverPostLog.setFileId(fileInfo.getId());
deliverPostLog.setUserId(currentUserId);
deliverPostLog.setDescription(uploadDeliver.getDescription());
deliverPostLog.setTime(now);
@ -302,9 +305,9 @@ public class TaskDeliverService implements ITaskDeliverService {
inMessage.setData(JacksonUtil.beanToJson(uploadMessage));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME,
JacksonUtil.beanToJson(inMessage) );
// //用智能助手发送消息
// SysProject project = sysProjectDao.selectByPrimaryKey(taskDetail.getProjectId());
// robotService.addDeliverRobotSend(currentUserId,taskDeliver.getName(),subTimeId, project);
//用智能助手发送消息
SysProject project = sysProjectDao.selectByPrimaryKey(taskDetail.getProjectId());
robotService.addDeliverRobotSend(currentUserId,taskDeliver.getName(),subTimeId, project);
//返回
List<ProjectVo.DeliverInfo> deliverInfoList = taskDeliverDao.selectByDeliverId(uploadDeliver.getDeliverId());
@ -332,9 +335,10 @@ public class TaskDeliverService implements ITaskDeliverService {
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_READ);
wpsService.saveFile(business);
}else {
throw new BaseException(CodeEnum.NOT_DELIVER_FILE);
}
// else {
// throw new BaseException(CodeEnum.NOT_DELIVER_FILE);
// }
}
/**
@ -468,12 +472,28 @@ public class TaskDeliverService implements ITaskDeliverService {
if("1".equalsIgnoreCase(filePath.getIsHistory())){
filePath.setDeleteTime(filePath.getUpdateTime().getTime());
}
// TODO 修改文件路径为可下载路径
try {
// TODO 修改文件路径为可下载路径
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(PropUtil.imgDomain + "/" + filePath.getUrl());
}
// filePath.setUrl(PropUtil.imgDomain + "/" + filePath.getUrl());
// }
if (ObjectUtil.isNotNull(filePath.getUploaderId())) {
//添加上传人的姓名信息
ProMember member = proMemberService.selectByUserId(filePath.getUploaderId(), task.getProjectId());

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

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

7
tall/src/main/resources/application-prod.yml

@ -46,8 +46,9 @@ file:
path: /home/cloud/tall/uploads/
domain: https://www.tall.wiki/gateway/tall/v1.0/
imgDomain: https://www.tall.wiki/gateway/tall/v1.0/uploads
filedeal: https://www.tall.wiki/filedeal/file/query
project:
# redis是否需要加载 0:否 1 是
redisUpdate: 1
redisUpdateUrl: https://www.tall.wiki/filedeal/constant/updateAll/
redisUpdate: 0
redisUpdateUrl: https://www.tall.wiki/filedeal/constant/updateAll/
filedeal: https://www.tall.wiki/filedeal/file/query

5
tall/src/main/resources/application-test.yml

@ -46,11 +46,12 @@ file:
path: /home/cloud/tall/uploads/
domain: https://test.tall.wiki/gateway/tall/v1.0/
imgDomain: https://test.tall.wiki/gateway/tall/v1.0/uploads
filedeal: https://test.tall.wiki/filedeal/file/query
project:
# redis是否需要加载 0:否 1 是
redisUpdate: 1
redisUpdate: 0
redisUpdateUrl: http://127.0.0.1:8001/constant/updateAll/
filedeal: https://test.tall.wiki/filedeal/file/query
#file:
# domain: http://192.168.0.99/gateway/tall/v1.0/
# imgDomain: http://192.168.0.99/gateway/tall/v1.0/uploads

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

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

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

@ -140,10 +140,9 @@
resultMap="resultMap_FilePath">
SELECT
l.id as deliverLogId,
f.id as fileId,
l.file_id as fileId,
l.updated_at as updateTime,
l.description as description,
f.path as url,
l.time as uploadTime,
l.is_history as history,
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="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="task_detail_id" jdbcType="BIGINT" property="taskDetailId" />
<result column="do_type" jdbcType="TINYINT" property="doType" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -72,7 +73,7 @@
</sql>
<sql id="Base_Column_List">
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>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultMap="BaseResultMap">
select
@ -107,12 +108,12 @@
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysOperation">
insert into t_sys_operation (id, operator_id, project_id,
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},
#{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 id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysOperation">
insert into t_sys_operation
@ -144,6 +145,9 @@
<if test="taskDetailId != null">
task_detail_id,
</if>
<if test="doType != null">
do_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -173,6 +177,9 @@
<if test="taskDetailId != null">
#{taskDetailId,jdbcType=BIGINT},
</if>
<if test="doType != null">
#{doType,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.SysOperationExample" resultType="java.lang.Long">
@ -211,6 +218,9 @@
<if test="record.taskDetailId != null">
task_detail_id = #{record.taskDetailId,jdbcType=BIGINT},
</if>
<if test="record.doType != null">
do_type = #{record.doType,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -226,7 +236,8 @@
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
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">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -258,6 +269,9 @@
<if test="taskDetailId != null">
task_detail_id = #{taskDetailId,jdbcType=BIGINT},
</if>
<if test="doType != null">
do_type = #{doType,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -270,7 +284,8 @@
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
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}
</update>
</mapper>

2
util/src/main/java/com/ccsens/util/PropUtil.java

@ -109,7 +109,7 @@ public class PropUtil {
public void setAccessPath(String accessPath) {
PropUtil.accessPath = accessPath;
}
@Value("${filedeal:}")
@Value("${project.filedeal:}")
public void setFiledeal(String filedeal) {
PropUtil.filedeal = filedeal;
}

Loading…
Cancel
Save