Browse Source

project+wps

master
zhizhi wu 5 years ago
parent
commit
fc512dd5ea
  1. 12
      game/src/main/java/com/ccsens/game/service/MessageService.java
  2. 12
      mt/src/main/java/com/ccsens/mt/service/MessageServicer.java
  3. 25
      tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java
  4. 45
      tall/src/main/java/com/ccsens/tall/bean/po/ProProjectFile.java
  5. 238
      tall/src/main/java/com/ccsens/tall/bean/po/ProProjectFileExample.java
  6. 11
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFile.java
  7. 70
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFileExample.java
  8. 11
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFileVersion.java
  9. 70
      tall/src/main/java/com/ccsens/tall/bean/po/WpsFileVersionExample.java
  10. 9
      tall/src/main/java/com/ccsens/tall/bean/vo/WpsVo.java
  11. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/WpsFileDao.java
  12. 17
      tall/src/main/java/com/ccsens/tall/service/IWpsService.java
  13. 24
      tall/src/main/java/com/ccsens/tall/service/MessageService.java
  14. 24
      tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java
  15. 14
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  16. 159
      tall/src/main/java/com/ccsens/tall/service/WpsService.java
  17. 3
      tall/src/main/java/com/ccsens/tall/web/FileController.java
  18. 6
      tall/src/main/java/com/ccsens/tall/web/WpsController.java
  19. 14
      tall/src/main/resources/mapper_dao/WpsFileDao.xml
  20. 76
      tall/src/main/resources/mapper_raw/ProProjectFileMapper.xml
  21. 31
      tall/src/main/resources/mapper_raw/WpsFileMapper.xml
  22. 25
      tall/src/main/resources/mapper_raw/WpsFileVersionMapper.xml
  23. 25
      util/src/main/java/com/ccsens/util/WebConstant.java
  24. 12
      util/src/test/java/com/ccsens/util/TestWpsSignature.java

12
game/src/main/java/com/ccsens/game/service/MessageService.java

@ -36,13 +36,13 @@ public class MessageService implements IMessageService {
@Override
public void sendGameMessageWithGetUrl(ChromeMessageDto message) throws Exception {
System.out.println(JacksonUtil.beanToJson(message));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(message));
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
// JacksonUtil.beanToJson(message));
// InMessage inMessage = new InMessage();
// inMessage.setTos(message.receiversTransTos());
// inMessage.setData(JSONObject.toJSONString(message.getData()));
// rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
InMessage inMessage = new InMessage();
inMessage.setTos(message.receiversTransTos());
inMessage.setData(JSONObject.toJSONString(message.getData()));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
}
@Override

12
mt/src/main/java/com/ccsens/mt/service/MessageServicer.java

@ -17,12 +17,12 @@ public class MessageServicer implements IMessageService{
@Override
public void sendSyncMessageWithShow(SyncMessageWithShowDto message) throws Exception {
System.out.println(JacksonUtil.beanToJson(message));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(message));
// InMessage inMessage = new InMessage();
// inMessage.setTos(message.receiversTransTos());
// inMessage.setData(JSONObject.toJSONString(message.getData()));
// rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
// JacksonUtil.beanToJson(message));
InMessage inMessage = new InMessage();
inMessage.setTos(message.receiversTransTos());
inMessage.setData(JSONObject.toJSONString(message.getData()));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
}
}

25
tall/src/main/java/com/ccsens/tall/bean/dto/WpsDto.java

@ -158,4 +158,29 @@ public class WpsDto {
@ApiModelProperty("应用id")
private String _w_appid;
}
@Data
@ApiModel("业务和WPS")
public static class Business{
@ApiModelProperty("业务ID")
private Long businessId;
@ApiModelProperty("wps文件ID")
private Long wpsFileId;
@ApiModelProperty("业务类型")
private Byte businessType;
@ApiModelProperty("用户ID")
private Long userId;
@ApiModelProperty("文件名")
private String fileName;
@ApiModelProperty("文件路径,默认在WebConstant.UPLOAD_PATH_BASE下")
private String filePath;
@ApiModelProperty("文件大小")
private Long fileSize;
@ApiModelProperty("操作类型 值:WebConstant Wps USER_OPERATION... ")
private byte operation;
@ApiModelProperty("操作权限 WebConstant Wps PROJECT_PRIVILEGE...")
private byte privilege;
@ApiModelProperty("操作权限查询路径")
private String privilegeQueryUrl;
}
}

45
tall/src/main/java/com/ccsens/tall/bean/po/ProProjectFile.java

@ -6,10 +6,16 @@ import java.util.Date;
public class ProProjectFile implements Serializable {
private Long id;
private Long projectId;
private Long businessId;
private Long fileId;
private Byte businessType;
private Byte privilege;
private String privilegeQueryUrl;
private Date createdAt;
private Date updatedAt;
@ -26,12 +32,12 @@ public class ProProjectFile implements Serializable {
this.id = id;
}
public Long getProjectId() {
return projectId;
public Long getBusinessId() {
return businessId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public Long getFileId() {
@ -42,6 +48,30 @@ public class ProProjectFile implements Serializable {
this.fileId = fileId;
}
public Byte getBusinessType() {
return businessType;
}
public void setBusinessType(Byte businessType) {
this.businessType = businessType;
}
public Byte getPrivilege() {
return privilege;
}
public void setPrivilege(Byte privilege) {
this.privilege = privilege;
}
public String getPrivilegeQueryUrl() {
return privilegeQueryUrl;
}
public void setPrivilegeQueryUrl(String privilegeQueryUrl) {
this.privilegeQueryUrl = privilegeQueryUrl == null ? null : privilegeQueryUrl.trim();
}
public Date getCreatedAt() {
return createdAt;
}
@ -73,8 +103,11 @@ public class ProProjectFile implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", projectId=").append(projectId);
sb.append(", businessId=").append(businessId);
sb.append(", fileId=").append(fileId);
sb.append(", businessType=").append(businessType);
sb.append(", privilege=").append(privilege);
sb.append(", privilegeQueryUrl=").append(privilegeQueryUrl);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);

238
tall/src/main/java/com/ccsens/tall/bean/po/ProProjectFileExample.java

@ -165,63 +165,63 @@ public class ProProjectFileExample {
return (Criteria) this;
}
public Criteria andProjectIdIsNull() {
addCriterion("project_id is null");
public Criteria andBusinessIdIsNull() {
addCriterion("business_id is null");
return (Criteria) this;
}
public Criteria andProjectIdIsNotNull() {
addCriterion("project_id is not null");
public Criteria andBusinessIdIsNotNull() {
addCriterion("business_id is not null");
return (Criteria) this;
}
public Criteria andProjectIdEqualTo(Long value) {
addCriterion("project_id =", value, "projectId");
public Criteria andBusinessIdEqualTo(Long value) {
addCriterion("business_id =", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdNotEqualTo(Long value) {
addCriterion("project_id <>", value, "projectId");
public Criteria andBusinessIdNotEqualTo(Long value) {
addCriterion("business_id <>", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThan(Long value) {
addCriterion("project_id >", value, "projectId");
public Criteria andBusinessIdGreaterThan(Long value) {
addCriterion("business_id >", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdGreaterThanOrEqualTo(Long value) {
addCriterion("project_id >=", value, "projectId");
public Criteria andBusinessIdGreaterThanOrEqualTo(Long value) {
addCriterion("business_id >=", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdLessThan(Long value) {
addCriterion("project_id <", value, "projectId");
public Criteria andBusinessIdLessThan(Long value) {
addCriterion("business_id <", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdLessThanOrEqualTo(Long value) {
addCriterion("project_id <=", value, "projectId");
public Criteria andBusinessIdLessThanOrEqualTo(Long value) {
addCriterion("business_id <=", value, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdIn(List<Long> values) {
addCriterion("project_id in", values, "projectId");
public Criteria andBusinessIdIn(List<Long> values) {
addCriterion("business_id in", values, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdNotIn(List<Long> values) {
addCriterion("project_id not in", values, "projectId");
public Criteria andBusinessIdNotIn(List<Long> values) {
addCriterion("business_id not in", values, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdBetween(Long value1, Long value2) {
addCriterion("project_id between", value1, value2, "projectId");
public Criteria andBusinessIdBetween(Long value1, Long value2) {
addCriterion("business_id between", value1, value2, "businessId");
return (Criteria) this;
}
public Criteria andProjectIdNotBetween(Long value1, Long value2) {
addCriterion("project_id not between", value1, value2, "projectId");
public Criteria andBusinessIdNotBetween(Long value1, Long value2) {
addCriterion("business_id not between", value1, value2, "businessId");
return (Criteria) this;
}
@ -285,6 +285,196 @@ public class ProProjectFileExample {
return (Criteria) this;
}
public Criteria andBusinessTypeIsNull() {
addCriterion("business_type is null");
return (Criteria) this;
}
public Criteria andBusinessTypeIsNotNull() {
addCriterion("business_type is not null");
return (Criteria) this;
}
public Criteria andBusinessTypeEqualTo(Byte value) {
addCriterion("business_type =", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotEqualTo(Byte value) {
addCriterion("business_type <>", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeGreaterThan(Byte value) {
addCriterion("business_type >", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("business_type >=", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeLessThan(Byte value) {
addCriterion("business_type <", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeLessThanOrEqualTo(Byte value) {
addCriterion("business_type <=", value, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeIn(List<Byte> values) {
addCriterion("business_type in", values, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotIn(List<Byte> values) {
addCriterion("business_type not in", values, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeBetween(Byte value1, Byte value2) {
addCriterion("business_type between", value1, value2, "businessType");
return (Criteria) this;
}
public Criteria andBusinessTypeNotBetween(Byte value1, Byte value2) {
addCriterion("business_type not between", value1, value2, "businessType");
return (Criteria) this;
}
public Criteria andPrivilegeIsNull() {
addCriterion("privilege is null");
return (Criteria) this;
}
public Criteria andPrivilegeIsNotNull() {
addCriterion("privilege is not null");
return (Criteria) this;
}
public Criteria andPrivilegeEqualTo(Byte value) {
addCriterion("privilege =", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeNotEqualTo(Byte value) {
addCriterion("privilege <>", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeGreaterThan(Byte value) {
addCriterion("privilege >", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeGreaterThanOrEqualTo(Byte value) {
addCriterion("privilege >=", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeLessThan(Byte value) {
addCriterion("privilege <", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeLessThanOrEqualTo(Byte value) {
addCriterion("privilege <=", value, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeIn(List<Byte> values) {
addCriterion("privilege in", values, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeNotIn(List<Byte> values) {
addCriterion("privilege not in", values, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeBetween(Byte value1, Byte value2) {
addCriterion("privilege between", value1, value2, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeNotBetween(Byte value1, Byte value2) {
addCriterion("privilege not between", value1, value2, "privilege");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlIsNull() {
addCriterion("privilege_query_url is null");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlIsNotNull() {
addCriterion("privilege_query_url is not null");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlEqualTo(String value) {
addCriterion("privilege_query_url =", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlNotEqualTo(String value) {
addCriterion("privilege_query_url <>", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlGreaterThan(String value) {
addCriterion("privilege_query_url >", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlGreaterThanOrEqualTo(String value) {
addCriterion("privilege_query_url >=", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlLessThan(String value) {
addCriterion("privilege_query_url <", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlLessThanOrEqualTo(String value) {
addCriterion("privilege_query_url <=", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlLike(String value) {
addCriterion("privilege_query_url like", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlNotLike(String value) {
addCriterion("privilege_query_url not like", value, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlIn(List<String> values) {
addCriterion("privilege_query_url in", values, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlNotIn(List<String> values) {
addCriterion("privilege_query_url not in", values, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlBetween(String value1, String value2) {
addCriterion("privilege_query_url between", value1, value2, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andPrivilegeQueryUrlNotBetween(String value1, String value2) {
addCriterion("privilege_query_url not between", value1, value2, "privilegeQueryUrl");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;

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

@ -14,6 +14,8 @@ public class WpsFile implements Serializable {
private String downloadUrl;
private String saveUrl;
private Long creator;
private Long modifier;
@ -66,6 +68,14 @@ public class WpsFile implements Serializable {
this.downloadUrl = downloadUrl == null ? null : downloadUrl.trim();
}
public String getSaveUrl() {
return saveUrl;
}
public void setSaveUrl(String saveUrl) {
this.saveUrl = saveUrl == null ? null : saveUrl.trim();
}
public Long getCreator() {
return creator;
}
@ -117,6 +127,7 @@ public class WpsFile implements Serializable {
sb.append(", name=").append(name);
sb.append(", size=").append(size);
sb.append(", downloadUrl=").append(downloadUrl);
sb.append(", saveUrl=").append(saveUrl);
sb.append(", creator=").append(creator);
sb.append(", modifier=").append(modifier);
sb.append(", createdAt=").append(createdAt);

70
tall/src/main/java/com/ccsens/tall/bean/po/WpsFileExample.java

@ -425,6 +425,76 @@ public class WpsFileExample {
return (Criteria) this;
}
public Criteria andSaveUrlIsNull() {
addCriterion("save_url is null");
return (Criteria) this;
}
public Criteria andSaveUrlIsNotNull() {
addCriterion("save_url is not null");
return (Criteria) this;
}
public Criteria andSaveUrlEqualTo(String value) {
addCriterion("save_url =", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotEqualTo(String value) {
addCriterion("save_url <>", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlGreaterThan(String value) {
addCriterion("save_url >", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlGreaterThanOrEqualTo(String value) {
addCriterion("save_url >=", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLessThan(String value) {
addCriterion("save_url <", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLessThanOrEqualTo(String value) {
addCriterion("save_url <=", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLike(String value) {
addCriterion("save_url like", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotLike(String value) {
addCriterion("save_url not like", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlIn(List<String> values) {
addCriterion("save_url in", values, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotIn(List<String> values) {
addCriterion("save_url not in", values, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlBetween(String value1, String value2) {
addCriterion("save_url between", value1, value2, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotBetween(String value1, String value2) {
addCriterion("save_url not between", value1, value2, "saveUrl");
return (Criteria) this;
}
public Criteria andCreatorIsNull() {
addCriterion("creator is null");
return (Criteria) this;

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

@ -16,6 +16,8 @@ public class WpsFileVersion implements Serializable {
private String downloadUrl;
private String saveUrl;
private Long modifier;
private Date createdAt;
@ -74,6 +76,14 @@ public class WpsFileVersion implements Serializable {
this.downloadUrl = downloadUrl == null ? null : downloadUrl.trim();
}
public String getSaveUrl() {
return saveUrl;
}
public void setSaveUrl(String saveUrl) {
this.saveUrl = saveUrl == null ? null : saveUrl.trim();
}
public Long getModifier() {
return modifier;
}
@ -118,6 +128,7 @@ public class WpsFileVersion implements Serializable {
sb.append(", name=").append(name);
sb.append(", size=").append(size);
sb.append(", downloadUrl=").append(downloadUrl);
sb.append(", saveUrl=").append(saveUrl);
sb.append(", modifier=").append(modifier);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);

70
tall/src/main/java/com/ccsens/tall/bean/po/WpsFileVersionExample.java

@ -485,6 +485,76 @@ public class WpsFileVersionExample {
return (Criteria) this;
}
public Criteria andSaveUrlIsNull() {
addCriterion("save_url is null");
return (Criteria) this;
}
public Criteria andSaveUrlIsNotNull() {
addCriterion("save_url is not null");
return (Criteria) this;
}
public Criteria andSaveUrlEqualTo(String value) {
addCriterion("save_url =", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotEqualTo(String value) {
addCriterion("save_url <>", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlGreaterThan(String value) {
addCriterion("save_url >", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlGreaterThanOrEqualTo(String value) {
addCriterion("save_url >=", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLessThan(String value) {
addCriterion("save_url <", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLessThanOrEqualTo(String value) {
addCriterion("save_url <=", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlLike(String value) {
addCriterion("save_url like", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotLike(String value) {
addCriterion("save_url not like", value, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlIn(List<String> values) {
addCriterion("save_url in", values, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotIn(List<String> values) {
addCriterion("save_url not in", values, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlBetween(String value1, String value2) {
addCriterion("save_url between", value1, value2, "saveUrl");
return (Criteria) this;
}
public Criteria andSaveUrlNotBetween(String value1, String value2) {
addCriterion("save_url not between", value1, value2, "saveUrl");
return (Criteria) this;
}
public Criteria andModifierIsNull() {
addCriterion("modifier is null");
return (Criteria) this;

9
tall/src/main/java/com/ccsens/tall/bean/vo/WpsVo.java

@ -267,4 +267,13 @@ public class WpsVo {
this.value = value;
}
}
@ApiModel("业务关联的文件")
@Data
public static class BusinessFile{
@ApiModelProperty("文件ID")
private Long fileId;
@ApiModelProperty("文件名字")
private String fileName;
}
}

8
tall/src/main/java/com/ccsens/tall/persist/dao/WpsFileDao.java

@ -35,4 +35,12 @@ public interface WpsFileDao extends WpsFileMapper {
* @return 历史文件信息
*/
List<WpsVo.FileHistoryMsg> queryFileHistory(WpsDto.FileHistoryBody body);
/**
* 根据业务ID和类型查询文件相关
* @param businessId 业务ID
* @param businessType 业务类型
* @return 文件信息
*/
List<WpsVo.BusinessFile> queryFileByBusiness(@Param("businessId") long businessId, @Param("businessType") byte businessType);
}

17
tall/src/main/java/com/ccsens/tall/service/IWpsService.java

@ -74,6 +74,23 @@ public interface IWpsService {
* wps通知
* @param token 身份识别
* @param body 通知内容
* @throws Exception 异常
*/
void notify(String token, WpsDto.NotifyBody body) throws Exception;
/**
* 保存业务和文件记录
* @param business 业务和文件关系
*/
void saveFile(WpsDto.Business business);
/**
* 根据业务ID和类型返回文件预览
*
* @param businessId 业务ID
* @param businessType 业务类型
* @param token token
* @return WPS访问路径
*/
List<String> queryVisitUrls(long businessId, byte businessType, String token);
}

24
tall/src/main/java/com/ccsens/tall/service/MessageService.java

@ -62,13 +62,13 @@ public class MessageService implements IMessageService{
SyncMessageWithStartDto message = new SyncMessageWithStartDto(projectId, sender, receivers, roleId, taskId, null, time, duration,player);
//FixMe 发送到消息队列
System.out.println("+++++++++++++"+JacksonUtil.beanToJson(message));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(message));
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
// JacksonUtil.beanToJson(message));
// InMessage inMessage = new InMessage();
// inMessage.setTos(message.receiversTransTos());
// inMessage.setData(JSONObject.toJSONString(message.getData()));
// rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
InMessage inMessage = new InMessage();
inMessage.setTos(message.receiversTransTos());
inMessage.setData(JSONObject.toJSONString(message.getData()));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
}
}
@ -99,12 +99,12 @@ public class MessageService implements IMessageService{
public void sendStartTaskMessage(SyncMessageWithStartDto syncMessage) throws Exception {
System.out.println(JacksonUtil.beanToJson(syncMessage));
//FixMe 发送到消息队列
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME ,
JacksonUtil.beanToJson(syncMessage));
// InMessage inMessage = new InMessage();
// inMessage.setTos(syncMessage.receiversTransTos());
// inMessage.setData(JSONObject.toJSONString(syncMessage.getData()));
// rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME ,
// JacksonUtil.beanToJson(syncMessage));
InMessage inMessage = new InMessage();
inMessage.setTos(syncMessage.receiversTransTos());
inMessage.setData(JSONObject.toJSONString(syncMessage.getData()));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, inMessage);
}

24
tall/src/main/java/com/ccsens/tall/service/ProjectMessageService.java

@ -104,21 +104,21 @@ public class ProjectMessageService implements IProjectMessageService {
//mq-->ws
// 操作发送
initMessageSend(userIds, oauthUserIds, operationId);
// InMessage inMessage = new InMessage();
// inMessage.setTos(InMessage.transTos(userIds));
// inMessage.setData(JSONObject.toJSONString(newMessages));
// rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, JSONObject.toJSONString(inMessage));
// log.info("mq通知消息:{}", inMessage);
com.ccsens.tall.bean.dto.message.ProjectMessageDto dto = new com.ccsens.tall.bean.dto.message.ProjectMessageDto();
dto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIds));
List<com.ccsens.tall.bean.dto.message.ProjectMessageDto.Message> messages = JSONObject.parseArray(JSONObject.toJSONString(newMessages), com.ccsens.tall.bean.dto.message.ProjectMessageDto.Message.class);
dto.getData().setMessages(messages);
InMessage inMessage = new InMessage();
inMessage.setTos(InMessage.transTos(userIds));
inMessage.setData(JSONObject.toJSONString(newMessages));
rabbitTemplate.convertAndSend(RabbitMQConfig.MESSAGE_QUEUE_NAME, JSONObject.toJSONString(inMessage));
log.info("mq通知消息:{}", inMessage);
// com.ccsens.tall.bean.dto.message.ProjectMessageDto dto = new com.ccsens.tall.bean.dto.message.ProjectMessageDto();
// dto.setReceivers(BaseMessageDto.MessageUser.userIdToUsers(userIds));
// List<com.ccsens.tall.bean.dto.message.ProjectMessageDto.Message> messages = JSONObject.parseArray(JSONObject.toJSONString(newMessages), com.ccsens.tall.bean.dto.message.ProjectMessageDto.Message.class);
// dto.getData().setMessages(messages);
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
// JacksonUtil.beanToJson(dto));
//更新ws消息发送成功
updateStatus(operationId, WebConstant.Message.SEND_WS);
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(dto));
//TODO 公众号通知消息
if (CollectionUtil.isEmpty(openids)) {
log.info("项目{}下没有关注公众号的用户,未发送公众号关注", inform.getProjectId());

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

@ -574,13 +574,13 @@ public class TaskDeliverService implements ITaskDeliverService {
}
checkerDto.setReceivers(messageUserList);
log.info("检查交付物:{}",JacksonUtil.beanToJson(checkerDto));
rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
JacksonUtil.beanToJson(checkerDto));
// MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User);
// String s = JacksonUtil.beanToJson(checkerDto);
// InMessage inMessage = InMessage.newToUserMessage(currentUserId.toString(),userIdSet,null,messageRule,s);
//
// messageService.sendDeliverMessageWithChecker(inMessage);
// rabbitTemplate.convertAndSend(RabbitMQConfig.RabbitMQ_QUEUE_NAME,
// JacksonUtil.beanToJson(checkerDto));
MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User);
String s = JacksonUtil.beanToJson(checkerDto);
InMessage inMessage = InMessage.newToUserMessage(currentUserId.toString(),userIdSet,null,messageRule,s);
messageService.sendDeliverMessageWithChecker(inMessage);
//检查完,返回数据
DeliverVo.DeliverInfo deliverInfo = selectDeliverInfo(currentUserId, deliver.getId(), checkDeliver.getTaskId());

159
tall/src/main/java/com/ccsens/tall/service/WpsService.java

@ -19,7 +19,6 @@ import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import io.jsonwebtoken.Claims;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -27,15 +26,12 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.Part;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @description:
* wps文件
* @author: whj
* @time: 2020/6/17 18:05
* @date: 2020/6/17 18:05
*/
@Slf4j
@Service
@ -55,17 +51,78 @@ public class WpsService implements IWpsService {
@Resource
private WpsNotifyMapper wpsNotifyMapper;
@Resource
private IProRoleService proRoleService;
@Resource
private RedisUtil redisUtil;
@Resource
private Snowflake snowflake;
private String fileUrl = "http://wwo.wps.cn/office/{}/{}?_w_appid="+WebConstant.Wps.APPID+"&_w_signature={}";
@Override
public List<String> queryVisitUrls(long businessId, byte businessType, String token) {
log.info("查询访问路径:{},{}", businessId, businessType);
List<String> urls = new ArrayList<>();
List<WpsVo.BusinessFile> files = wpsFileDao.queryFileByBusiness(businessId, businessType);
files.forEach(file -> {
String name = file.getFileName();
log.info("文件名:{}", name);
String url = getUrl(String.valueOf(file.getFileId()), name.substring(name.lastIndexOf(".") + 1), token);
urls.add(url);
});
log.info("访问路径返回结果:{}", urls);
return urls;
}
@Override
public void saveFile(WpsDto.Business business) {
ProProjectFile proProjectFile = null;
if (business.getWpsFileId() != null) {
ProProjectFileExample example = new ProProjectFileExample();
example.createCriteria().andBusinessIdEqualTo(business.getBusinessId())
.andBusinessTypeEqualTo(business.getBusinessType())
.andFileIdEqualTo(business.getWpsFileId());
List<ProProjectFile> proProjectFiles = proProjectFileMapper.selectByExample(example);
if (CollectionUtil.isEmpty(proProjectFiles)) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
proProjectFile = proProjectFiles.get(0);
}
// 保存文件版本信息
WpsFile wpsFile = saveWpsFile(business.getWpsFileId() == null ? null : String.valueOf(business.getWpsFileId()),
business.getFileSize(), business.getUserId(), business.getFilePath(),
business.getFileName());
// 更新文件记录
WpsFileVersion version = saveVersion(wpsFile);
// 调用接口,更新数据项目接口(异步调用)
// 保存用户提交记录
WpsFileUser wpsFileUser = initFileUser(business.getUserId(), version.getId());
wpsFileUser.setOperation(business.getOperation());
wpsFileUserMapper.insertSelective(wpsFileUser);
// 文件ID为空,保存文件和业务的关系
if (proProjectFile == null) {
saveBusiness(business, wpsFile);
}
}
/**
* 保存业务文件关联
* @param business 业务信息
* @param wpsFile 获取文件ID
*/
private void saveBusiness(WpsDto.Business business, WpsFile wpsFile) {
ProProjectFile proProjectFile;
proProjectFile = new ProProjectFile();
proProjectFile.setId(snowflake.nextId());
proProjectFile.setFileId(wpsFile.getId());
proProjectFile.setBusinessId(business.getBusinessId());
proProjectFile.setBusinessType(business.getBusinessType());
proProjectFile.setPrivilege(business.getPrivilege());
proProjectFile.setPrivilegeQueryUrl(business.getPrivilegeQueryUrl());
proProjectFileMapper.insertSelective(proProjectFile);
}
@Override
public void notify(String token, WpsDto.NotifyBody body) throws Exception {
Long userId = getUserId(token);
getUserId(token);
WpsNotify wpsNotify = new WpsNotify();
wpsNotify.setId(snowflake.nextId());
wpsNotify.setCmd(body.getCmd());
@ -73,6 +130,7 @@ public class WpsService implements IWpsService {
wpsNotifyMapper.insertSelective(wpsNotify);
}
@Override
public void fileRename(String token, long fileId, WpsDto.FileRenameBody renameBody) throws Exception {
Long userId = getUserId(token);
@ -106,9 +164,8 @@ public class WpsService implements IWpsService {
@Override
public List<WpsVo.FileHistoryMsg> queryFileHistory(String token, WpsDto.FileHistoryBody body) throws Exception {
Long userId = getUserId(token);
List<WpsVo.FileHistoryMsg> msgs = wpsFileDao.queryFileHistory(body);
return msgs;
getUserId(token);
return wpsFileDao.queryFileHistory(body);
}
@Override
@ -132,17 +189,29 @@ public class WpsService implements IWpsService {
WpsFile wpsFile = saveWpsFile(token, fileId, file,WebConstant.Wps.USER_OPERATION_NEW);
String fileName = UploadFileUtil_Servlet3.getFileNameByPart(file);
String ext = FileUtil.extName(fileName);
String url = getUrl(fileId, ext, token);
WpsVo.FileNew fileNew = new WpsVo.FileNew();
fileNew.setRedirect_url(url);
fileNew.setUser_id(String.valueOf(wpsFile.getCreator()));
return fileNew;
}
/**
* 返回WPS文件访问路径
* @param fileId 文件ID
* @param ext 后缀
* @param token token
* @return wps访问路径
*/
private String getUrl(String fileId, String ext, String token) {
String fileType = WebConstant.Wps.getFileType(ext);
Map<String, String> paramMap= new HashMap<>();
paramMap.put("_w_appid", WebConstant.Wps.APPID);
// paramMap.put("_w_fname", fileName);
// paramMap.put("_w_userid", String.valueOf(wpsFile.getCreator()));
String newSignature = WpsSignature.getSignature(paramMap, WebConstant.Wps.APPKEY);
String url = StrUtil.format(fileUrl, fileType, wpsFile.getId(), newSignature);
WpsVo.FileNew fileNew = new WpsVo.FileNew();
fileNew.setRedirect_url(url);
fileNew.setUser_id(String.valueOf(wpsFile.getCreator()));
return fileNew;
String fileUrl = "http://wwo.wps.cn/office/{}/{}?_w_appid=" + WebConstant.Wps.APPID + "&_w_signature={}&token={}";
return StrUtil.format(fileUrl, fileType, fileId, newSignature, token);
}
@Override
@ -189,21 +258,39 @@ public class WpsService implements IWpsService {
return fileInfo;
}
int power = proRoleService.selectPowerByRoleName(userId, proProjectFiles.get(0).getId());
log.info("权限:{}", power);
if (power > 1) {
ProProjectFile projectFile = proProjectFiles.get(0);
byte businessType = projectFile.getBusinessType();
switch (businessType) {
case WebConstant.Wps.PROJECT_PRIVILEGE_READ :
user.setPermission(WebConstant.Wps.PERMISSION_READ);
break;
case WebConstant.Wps.PROJECT_PRIVILEGE_WRITE:
user.setPermission(WebConstant.Wps.PERMISSION_WRITE);
break;
default:
JSONObject json = new JSONObject();
json.put("id", projectFile.getBusinessId());
json.put("type", projectFile.getBusinessType());
json.put("fileId", projectFile.getFileId());
String result = RestTemplateUtil.postBody(projectFile.getPrivilegeQueryUrl(), json);
user.setPermission(result);
}
wpsFileUser.setOperation(power > 1 ? WebConstant.Wps.USER_OPERATION_WRITE : WebConstant.Wps.USER_OPERATION_READ);
// int power = proRoleService.selectPowerByRoleName(userId, proProjectFiles.get(0).getId());
// log.info("权限:{}", power);
// if (power > 1) {
// user.setPermission(WebConstant.Wps.PERMISSION_WRITE);
// }
wpsFileUser.setOperation(WebConstant.Wps.PERMISSION_READ.equals(user.getPermission()) ? WebConstant.Wps.USER_OPERATION_READ : WebConstant.Wps.USER_OPERATION_WRITE);
wpsFileUserMapper.insertSelective(wpsFileUser);
return fileInfo;
}
/**
* 初始化用户和文档无操作类型
* @param userId
* @param fileId
* @return
* @param userId 用户id
* @param fileId 文件id
* @return 用户操作文件记录
*/
private WpsFileUser initFileUser(Long userId, Long fileId) {
WpsFileUser wpsFileUser = new WpsFileUser();
@ -238,7 +325,7 @@ public class WpsService implements IWpsService {
String filePath = WebConstant.UPLOAD_PATH_WPS + File.separator + path;
String name = UploadFileUtil_Servlet3.getFileNameByPart(file);
// 保存文件版本信息
WpsFile wpsFile = saveWpsFile(fileId, file, userId, filePath, name);
WpsFile wpsFile = saveWpsFile(fileId, file.getSize(), userId, filePath, name);
// 更新文件记录
WpsFileVersion version = saveVersion(wpsFile);
// 调用接口,更新数据项目接口(异步调用)
@ -257,6 +344,7 @@ public class WpsService implements IWpsService {
version.setName(wpsFile.getName());
version.setSize(wpsFile.getSize());
version.setDownloadUrl(wpsFile.getDownloadUrl());
version.setSaveUrl(wpsFile.getSaveUrl());
version.setModifier(wpsFile.getModifier());
wpsFileVersionMapper.insertSelective(version);
return version;
@ -264,14 +352,14 @@ public class WpsService implements IWpsService {
/**
* 保存文件信息
* @param fileId
* @param file
* @param userId
* @param filePath
* @param name
* @return
* @param fileId 文件ID无则保存有则修改
* @param fileSize 文件大小
* @param userId 用户id
* @param filePath 文件位置默认在WebConstant.UPLOAD_PATH_BASE
* @param name 文件名字
* @return wpsFile
*/
private WpsFile saveWpsFile(String fileId, Part file, Long userId, String filePath, String name) {
private WpsFile saveWpsFile(String fileId, Long fileSize, Long userId, String filePath, String name) {
WpsFile wpsFile;
if (StrUtil.isEmpty(fileId)) {
// 创建文件ID
@ -289,8 +377,9 @@ public class WpsService implements IWpsService {
wpsFile.setCreatedAt(new Date());
wpsFile.setUpdatedAt(new Date());
wpsFile.setName(name);
wpsFile.setSize(file.getSize());
wpsFile.setSize(fileSize);
wpsFile.setDownloadUrl(PropUtil.domain + "file/download/" + name + "?path=" + filePath);
wpsFile.setSaveUrl(WebConstant.UPLOAD_PATH_BASE + File.separator + filePath);
wpsFile.setModifier(userId);
if (StrUtil.isEmpty(fileId)) {

3
tall/src/main/java/com/ccsens/tall/web/FileController.java

@ -3,7 +3,6 @@ package com.ccsens.tall.web;
import com.ccsens.util.UploadFileUtil_Servlet3;
import com.ccsens.util.WebConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@ -22,7 +21,7 @@ import java.io.File;
@RequestMapping("/file")
public class FileController {
@ApiOperation(value = "文件下载", notes = "")
@ApiOperation(value = "文件下载")
@GetMapping(value = "download/{fileName}")
public void download(HttpServletResponse response, @PathVariable("fileName")String fileName, String path) throws Exception {
String parentPath = WebConstant.UPLOAD_PATH_BASE + File.separator + path;

6
tall/src/main/java/com/ccsens/tall/web/WpsController.java

@ -191,7 +191,11 @@ public class WpsController {
public static WpsHeader getHeader(HttpServletRequest request) {
WpsHeader header = new WpsHeader();
header.setUserAgent(request.getHeader("User-Agent"));
header.setToken(request.getHeader("x-wps-weboffice-token"));
String token = request.getHeader("x-wps-weboffice-token");
if (StrUtil.isEmpty(token)) {
token = request.getParameter("token");
}
header.setToken(token);
// header.setToken("eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1OTM0MTI5ODEsInN1YiI6IjEyMTgwMjUyNDk0OTMzNTY1NDQiLCJhdXRoSWQiOiIxMTgzNjM2MjkxNjQ5MTQ2ODgwIiwiZXhwIjoxNTkzNDk5MzgxfQ.c1kAovpN7tq6O4rykIoSF-VPgmYBAM2ZNeqH_jsipI4");
header.setFileId(request.getHeader("x-weboffice-file-id"));
return header;

14
tall/src/main/resources/mapper_dao/WpsFileDao.xml

@ -79,4 +79,18 @@
v.version DESC
LIMIT #{offset},#{count}
</select>
<select id="queryFileByBusiness" resultType="com.ccsens.tall.bean.vo.WpsVo$BusinessFile">
SELECT
f.id AS fileId,
f.NAME AS fileName
FROM
t_pro_project_file p,
t_wps_file f
WHERE
p.file_id = f.id
AND p.business_id = #{businessId}
AND p.business_type = #{businessType}
AND p.rec_status = 0
AND f.rec_status = 0
</select>
</mapper>

76
tall/src/main/resources/mapper_raw/ProProjectFileMapper.xml

@ -3,8 +3,11 @@
<mapper namespace="com.ccsens.tall.persist.mapper.ProProjectFileMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProProjectFile">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="file_id" jdbcType="BIGINT" property="fileId" />
<result column="business_type" jdbcType="TINYINT" property="businessType" />
<result column="privilege" jdbcType="TINYINT" property="privilege" />
<result column="privilege_query_url" jdbcType="VARCHAR" property="privilegeQueryUrl" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -68,7 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, file_id, created_at, updated_at, rec_status
id, business_id, file_id, business_type, privilege, privilege_query_url, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProProjectFileExample" resultMap="BaseResultMap">
select
@ -101,10 +105,12 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProProjectFile">
insert into t_pro_project_file (id, project_id, file_id,
insert into t_pro_project_file (id, business_id, file_id,
business_type, privilege, privilege_query_url,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{businessId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT},
#{businessType,jdbcType=TINYINT}, #{privilege,jdbcType=TINYINT}, #{privilegeQueryUrl,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
@ -114,12 +120,21 @@
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
<if test="businessId != null">
business_id,
</if>
<if test="fileId != null">
file_id,
</if>
<if test="businessType != null">
business_type,
</if>
<if test="privilege != null">
privilege,
</if>
<if test="privilegeQueryUrl != null">
privilege_query_url,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -134,12 +149,21 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
#{fileId,jdbcType=BIGINT},
</if>
<if test="businessType != null">
#{businessType,jdbcType=TINYINT},
</if>
<if test="privilege != null">
#{privilege,jdbcType=TINYINT},
</if>
<if test="privilegeQueryUrl != null">
#{privilegeQueryUrl,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -163,12 +187,21 @@
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=BIGINT},
<if test="record.businessId != null">
business_id = #{record.businessId,jdbcType=BIGINT},
</if>
<if test="record.fileId != null">
file_id = #{record.fileId,jdbcType=BIGINT},
</if>
<if test="record.businessType != null">
business_type = #{record.businessType,jdbcType=TINYINT},
</if>
<if test="record.privilege != null">
privilege = #{record.privilege,jdbcType=TINYINT},
</if>
<if test="record.privilegeQueryUrl != null">
privilege_query_url = #{record.privilegeQueryUrl,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -186,8 +219,11 @@
<update id="updateByExample" parameterType="map">
update t_pro_project_file
set id = #{record.id,jdbcType=BIGINT},
project_id = #{record.projectId,jdbcType=BIGINT},
business_id = #{record.businessId,jdbcType=BIGINT},
file_id = #{record.fileId,jdbcType=BIGINT},
business_type = #{record.businessType,jdbcType=TINYINT},
privilege = #{record.privilege,jdbcType=TINYINT},
privilege_query_url = #{record.privilegeQueryUrl,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -198,12 +234,21 @@
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProProjectFile">
update t_pro_project_file
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
<if test="businessId != null">
business_id = #{businessId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
file_id = #{fileId,jdbcType=BIGINT},
</if>
<if test="businessType != null">
business_type = #{businessType,jdbcType=TINYINT},
</if>
<if test="privilege != null">
privilege = #{privilege,jdbcType=TINYINT},
</if>
<if test="privilegeQueryUrl != null">
privilege_query_url = #{privilegeQueryUrl,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -218,8 +263,11 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProProjectFile">
update t_pro_project_file
set project_id = #{projectId,jdbcType=BIGINT},
set business_id = #{businessId,jdbcType=BIGINT},
file_id = #{fileId,jdbcType=BIGINT},
business_type = #{businessType,jdbcType=TINYINT},
privilege = #{privilege,jdbcType=TINYINT},
privilege_query_url = #{privilegeQueryUrl,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}

31
tall/src/main/resources/mapper_raw/WpsFileMapper.xml

@ -7,6 +7,7 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="size" jdbcType="BIGINT" property="size" />
<result column="download_url" jdbcType="VARCHAR" property="downloadUrl" />
<result column="save_url" jdbcType="VARCHAR" property="saveUrl" />
<result column="creator" jdbcType="BIGINT" property="creator" />
<result column="modifier" jdbcType="BIGINT" property="modifier" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -72,8 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, current_version, name, size, download_url, creator, modifier, created_at, updated_at,
rec_status
id, current_version, name, size, download_url, save_url, creator, modifier, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.WpsFileExample" resultMap="BaseResultMap">
select
@ -107,13 +108,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.WpsFile">
insert into t_wps_file (id, current_version, name,
size, download_url, creator,
modifier, created_at, updated_at,
rec_status)
size, download_url, save_url,
creator, modifier, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{currentVersion,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{size,jdbcType=BIGINT}, #{downloadUrl,jdbcType=VARCHAR}, #{creator,jdbcType=BIGINT},
#{modifier,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{size,jdbcType=BIGINT}, #{downloadUrl,jdbcType=VARCHAR}, #{saveUrl,jdbcType=VARCHAR},
#{creator,jdbcType=BIGINT}, #{modifier,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.WpsFile">
insert into t_wps_file
@ -133,6 +134,9 @@
<if test="downloadUrl != null">
download_url,
</if>
<if test="saveUrl != null">
save_url,
</if>
<if test="creator != null">
creator,
</if>
@ -165,6 +169,9 @@
<if test="downloadUrl != null">
#{downloadUrl,jdbcType=VARCHAR},
</if>
<if test="saveUrl != null">
#{saveUrl,jdbcType=VARCHAR},
</if>
<if test="creator != null">
#{creator,jdbcType=BIGINT},
</if>
@ -206,6 +213,9 @@
<if test="record.downloadUrl != null">
download_url = #{record.downloadUrl,jdbcType=VARCHAR},
</if>
<if test="record.saveUrl != null">
save_url = #{record.saveUrl,jdbcType=VARCHAR},
</if>
<if test="record.creator != null">
creator = #{record.creator,jdbcType=BIGINT},
</if>
@ -233,6 +243,7 @@
name = #{record.name,jdbcType=VARCHAR},
size = #{record.size,jdbcType=BIGINT},
download_url = #{record.downloadUrl,jdbcType=VARCHAR},
save_url = #{record.saveUrl,jdbcType=VARCHAR},
creator = #{record.creator,jdbcType=BIGINT},
modifier = #{record.modifier,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -257,6 +268,9 @@
<if test="downloadUrl != null">
download_url = #{downloadUrl,jdbcType=VARCHAR},
</if>
<if test="saveUrl != null">
save_url = #{saveUrl,jdbcType=VARCHAR},
</if>
<if test="creator != null">
creator = #{creator,jdbcType=BIGINT},
</if>
@ -281,6 +295,7 @@
name = #{name,jdbcType=VARCHAR},
size = #{size,jdbcType=BIGINT},
download_url = #{downloadUrl,jdbcType=VARCHAR},
save_url = #{saveUrl,jdbcType=VARCHAR},
creator = #{creator,jdbcType=BIGINT},
modifier = #{modifier,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},

25
tall/src/main/resources/mapper_raw/WpsFileVersionMapper.xml

@ -8,6 +8,7 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="size" jdbcType="BIGINT" property="size" />
<result column="download_url" jdbcType="VARCHAR" property="downloadUrl" />
<result column="save_url" jdbcType="VARCHAR" property="saveUrl" />
<result column="modifier" jdbcType="BIGINT" property="modifier" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@ -72,7 +73,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, file_id, version, name, size, download_url, modifier, created_at, updated_at,
id, file_id, version, name, size, download_url, save_url, modifier, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.WpsFileVersionExample" resultMap="BaseResultMap">
@ -108,12 +109,12 @@
<insert id="insert" parameterType="com.ccsens.tall.bean.po.WpsFileVersion">
insert into t_wps_file_version (id, file_id, version,
name, size, download_url,
modifier, created_at, updated_at,
rec_status)
save_url, modifier, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT}, #{version,jdbcType=INTEGER},
#{name,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, #{downloadUrl,jdbcType=VARCHAR},
#{modifier,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
#{saveUrl,jdbcType=VARCHAR}, #{modifier,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.WpsFileVersion">
insert into t_wps_file_version
@ -136,6 +137,9 @@
<if test="downloadUrl != null">
download_url,
</if>
<if test="saveUrl != null">
save_url,
</if>
<if test="modifier != null">
modifier,
</if>
@ -168,6 +172,9 @@
<if test="downloadUrl != null">
#{downloadUrl,jdbcType=VARCHAR},
</if>
<if test="saveUrl != null">
#{saveUrl,jdbcType=VARCHAR},
</if>
<if test="modifier != null">
#{modifier,jdbcType=BIGINT},
</if>
@ -209,6 +216,9 @@
<if test="record.downloadUrl != null">
download_url = #{record.downloadUrl,jdbcType=VARCHAR},
</if>
<if test="record.saveUrl != null">
save_url = #{record.saveUrl,jdbcType=VARCHAR},
</if>
<if test="record.modifier != null">
modifier = #{record.modifier,jdbcType=BIGINT},
</if>
@ -234,6 +244,7 @@
name = #{record.name,jdbcType=VARCHAR},
size = #{record.size,jdbcType=BIGINT},
download_url = #{record.downloadUrl,jdbcType=VARCHAR},
save_url = #{record.saveUrl,jdbcType=VARCHAR},
modifier = #{record.modifier,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@ -260,6 +271,9 @@
<if test="downloadUrl != null">
download_url = #{downloadUrl,jdbcType=VARCHAR},
</if>
<if test="saveUrl != null">
save_url = #{saveUrl,jdbcType=VARCHAR},
</if>
<if test="modifier != null">
modifier = #{modifier,jdbcType=BIGINT},
</if>
@ -282,6 +296,7 @@
name = #{name,jdbcType=VARCHAR},
size = #{size,jdbcType=BIGINT},
download_url = #{downloadUrl,jdbcType=VARCHAR},
save_url = #{saveUrl,jdbcType=VARCHAR},
modifier = #{modifier,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},

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

@ -43,12 +43,25 @@ public class WebConstant {
public static final String FILE_TYPE_DEMO = " ppt,pptx,pptm,ppsx,ppsm,pps,potx,potm,dpt,dps";
public static final String FILE_TYPE_PDF = "pdf";
public static final Byte USER_OPERATION_NEW = 0;
public static final Byte USER_OPERATION_READ = 1;
public static final Byte USER_OPERATION_WRITE = 2;
public static final Byte USER_OPERATION_SAVE = 3;
public static final Byte USER_OPERATION_OLD = 4;
public static final Byte USER_OPERATION_RENAME = 5;
/**新建*/
public static final byte USER_OPERATION_NEW = 0;
/**读权限*/
public static final byte USER_OPERATION_READ = 1;
/**写权限*/
public static final byte USER_OPERATION_WRITE = 2;
/**编辑保存*/
public static final byte USER_OPERATION_SAVE = 3;
/**打开旧版本号*/
public static final byte USER_OPERATION_OLD = 4;
/**重命名*/
public static final byte USER_OPERATION_RENAME = 5;
/**业务权限:只读*/
public static final byte PROJECT_PRIVILEGE_READ = 0;
/**业务权限:可写*/
public static final byte PROJECT_PRIVILEGE_WRITE = 1;
/**业务权限:查询接口决定*/
public static final byte PROJECT_PRIVILEGE_QUERY = 2;
/**
* 获取文件类型

12
util/src/test/java/com/ccsens/util/TestWpsSignature.java

@ -13,11 +13,15 @@ import java.util.Map;
public class TestWpsSignature {
@Test
public void test01(){
Map<String, String> paramMap= new HashMap<>();
paramMap.put("_w_appid", WebConstant.Wps.APPID);
// Map<String, String> paramMap= new HashMap<>();
// paramMap.put("_w_appid", WebConstant.Wps.APPID);
// paramMap.put("_w_fname", "222.docx");
// paramMap.put("_w_userid", "id1000");
String signature = WpsSignature.getSignature(paramMap,WebConstant.Wps.APPKEY);
System.out.println(signature);
// String signature = WpsSignature.getSignature(paramMap,WebConstant.Wps.APPKEY);
// System.out.println(signature);
int i = Integer.MAX_VALUE;
System.out.println(i+2);
System.out.println(Integer.MIN_VALUE);
}
}

Loading…
Cancel
Save