Browse Source

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

recovery
zy_Java 4 years ago
parent
commit
9a531aab78
  1. 6
      tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java
  2. 90
      tall/src/main/java/com/ccsens/tall/bean/dto/PluginDto.java
  3. 18
      tall/src/main/java/com/ccsens/tall/bean/dto/RoleDto.java
  4. 6
      tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java
  5. 95
      tall/src/main/java/com/ccsens/tall/bean/po/ProPluginPreviewFile.java
  6. 631
      tall/src/main/java/com/ccsens/tall/bean/po/ProPluginPreviewFileExample.java
  7. 8
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetail.java
  8. 30
      tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetailExample.java
  9. 326
      tall/src/main/java/com/ccsens/tall/bean/po/ProTasketail.java
  10. 1941
      tall/src/main/java/com/ccsens/tall/bean/po/ProTasketailExample.java
  11. 45
      tall/src/main/java/com/ccsens/tall/bean/po/SysPlugin.java
  12. 228
      tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java
  13. 42
      tall/src/main/java/com/ccsens/tall/bean/vo/PluginVo.java
  14. 3
      tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java
  15. 4
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  16. 9
      tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginPreviewFileDao.java
  17. 8
      tall/src/main/java/com/ccsens/tall/persist/dao/ProRoleDao.java
  18. 26
      tall/src/main/java/com/ccsens/tall/persist/dao/TaskPluginDao.java
  19. 30
      tall/src/main/java/com/ccsens/tall/persist/mapper/ProPluginPreviewFileMapper.java
  20. 30
      tall/src/main/java/com/ccsens/tall/persist/mapper/ProTasketailMapper.java
  21. 103
      tall/src/main/java/com/ccsens/tall/service/ExcelService.java
  22. 4
      tall/src/main/java/com/ccsens/tall/service/IProRoleService.java
  23. 34
      tall/src/main/java/com/ccsens/tall/service/ISysPluginService.java
  24. 6
      tall/src/main/java/com/ccsens/tall/service/InputDocService.java
  25. 258
      tall/src/main/java/com/ccsens/tall/service/ProRoleService.java
  26. 248
      tall/src/main/java/com/ccsens/tall/service/SysPluginService.java
  27. 1
      tall/src/main/java/com/ccsens/tall/service/TaskDeliverService.java
  28. 1
      tall/src/main/java/com/ccsens/tall/service/TaskSubTimeService.java
  29. 6
      tall/src/main/java/com/ccsens/tall/web/InputDocController.java
  30. 53
      tall/src/main/java/com/ccsens/tall/web/PluginController.java
  31. 16
      tall/src/main/java/com/ccsens/tall/web/RoleController.java
  32. 2
      tall/src/main/resources/application-prod.yml
  33. 2
      tall/src/main/resources/application-test.yml
  34. 4
      tall/src/main/resources/application.yml
  35. 17
      tall/src/main/resources/mapper_dao/ProRoleDao.xml
  36. 1
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  37. 68
      tall/src/main/resources/mapper_dao/TaskPluginDao.xml
  38. 243
      tall/src/main/resources/mapper_raw/ProPluginPreviewFileMapper.xml
  39. 14
      tall/src/main/resources/mapper_raw/ProTaskDetailMapper.xml
  40. 575
      tall/src/main/resources/mapper_raw/ProTasketailMapper.xml
  41. 80
      tall/src/main/resources/mapper_raw/SysPluginMapper.xml
  42. 52
      tcm/src/main/java/com/ccsens/tcm/api/OcrController.java
  43. 27
      tcm/src/main/java/com/ccsens/tcm/bean/dto/QuestionOcrDto.java
  44. 139
      tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionOcr.java
  45. 901
      tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionOcrExample.java
  46. 45
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionOcrVo.java
  47. 2
      tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java
  48. 20
      tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionOcrDao.java
  49. 30
      tcm/src/main/java/com/ccsens/tcm/persist/mapper/QuestionOcrMapper.java
  50. 20
      tcm/src/main/java/com/ccsens/tcm/service/IOcrService.java
  51. 118
      tcm/src/main/java/com/ccsens/tcm/service/OcrService.java
  52. 7
      tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java
  53. 4
      tcm/src/main/resources/application-green.yml
  54. 25
      tcm/src/main/resources/mapper_dao/QuestionOcrDao.xml
  55. 6
      tcm/src/main/resources/mapper_dao/ReportCodeDao.xml
  56. 305
      tcm/src/main/resources/mapper_raw/QuestionOcrMapper.xml
  57. 11
      util/src/main/java/com/ccsens/util/CodeEnum.java
  58. 10
      util/src/main/java/com/ccsens/util/RestTemplateUtil.java
  59. 19
      util/src/main/java/com/ccsens/util/baidu/BaiDuDto.java
  60. 95
      util/src/main/java/com/ccsens/util/baidu/BaiDuUtil.java
  61. 33
      util/src/main/java/com/ccsens/util/baidu/BaiDuVo.java

6
tall/src/main/java/com/ccsens/tall/bean/dto/InputDocDto.java

@ -59,7 +59,7 @@ public class InputDocDto {
@ApiModelProperty("任务id")
private Long taskId;
@NotEmpty(message = "文档名称不能为空")
@ApiModelProperty("文名称")
@ApiModelProperty("文名称")
private String[] fileName;
}
@ -93,8 +93,8 @@ public class InputDocDto {
@Data
@ApiModel("修改上传文件的备注信息")
public static class UpdateDocOfRemark{
@NotNull(message = "请选择要删除的备注信息")
@ApiModelProperty("文档上传记录id")
@NotNull(message = "请选择要修改输入文件上传id")
@ApiModelProperty("输入文件上传id")
private Long recordId;
@ApiModelProperty("备注信息")
private String remark;

90
tall/src/main/java/com/ccsens/tall/bean/dto/PluginDto.java

@ -5,9 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import java.util.List;
/**
@ -18,14 +16,94 @@ public class PluginDto {
@Data
@ApiModel("添加插件")
public static class SaveSysPlugin {
@NotEmpty
@NotEmpty(message = "请输入插件名")
@ApiModelProperty("插件名(英文的code)")
private String name;
@NotEmpty
@ApiModelProperty("插件描述")
@Size(max = 100,message = "详情不能超过一百字")
@NotEmpty(message = "请输入插件详情")
@ApiModelProperty("插件详情")
private String description;
@ApiModelProperty("插件展示位置 默认2:0不显示,1任务头上右侧图标,2任务详情显示按钮,3任务展开面板显示(特殊形式)")
private byte showType = 2;
@ApiModelProperty("插件图标")
private Long pluginIcon;
@ApiModelProperty("插件作者")
private Long pluginAuthor;
@ApiModelProperty("插件类型(0-公共,1-会务,2-医疗,3-pims)")
private Byte pluginClass;
@ApiModelProperty("预览图片")
private List<PreviewImg> previewImgs;
}
@Data
@ApiModel("添加插件预览图")
public static class PreviewImg {
@ApiModelProperty("预览图id")
private Long previewId;
@Size(max = 100,message = "详情不能超过一百字")
@ApiModelProperty("预览图描述")
private String previewDescription;
}
@Data
@ApiModel("根据任务id查询插件列表(已添加的)")
public static class FindPluginByTask {
@NotNull(message = "请选择任务")
@ApiModelProperty("任务id")
private Long taskId;
@NotNull(message = "获取角色信息失败")
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("插件名称")
private String pluginName;
@ApiModelProperty("插件类型(0-公共,1-会务,2-医疗,3-pims)单选")
private Byte pluginType;
}
@Data
@ApiModel("根据任务id查询插件列表(该任务未添加的的)")
public static class FindPluginByTaskNo {
@NotNull(message = "请选择任务")
@ApiModelProperty("任务id")
private Long taskId;
@NotNull(message = "获取角色信息失败")
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("插件名称")
private String pluginName;
@ApiModelProperty("插件类型(0-公共,1-会务,2-医疗,3-pims)单选")
private Byte pluginType;
@ApiModelProperty("页数")
private Integer pageNum = 1;
@ApiModelProperty("每页多少条")
private Integer pageSize = 10;
}
@Data
@ApiModel("给任务添加插件")
public static class AddPluginForTask {
@NotNull(message = "请选择任务")
@ApiModelProperty("任务id")
private Long taskId;
@NotNull(message = "获取角色信息失败")
@ApiModelProperty("角色id")
private Long roleId;
@NotNull(message = "请选择插件")
@ApiModelProperty("插件id")
private Long pluginId;
}
@Data
@ApiModel("给任务删除插件")
public static class DeletePluginForTask {
@NotNull(message = "请选择任务")
@ApiModelProperty("任务id")
private Long taskId;
@NotNull(message = "获取角色信息失败")
@ApiModelProperty("角色id")
private Long roleId;
@NotNull(message = "请选择插件")
@ApiModelProperty("插件id")
private Long pluginId;
}

18
tall/src/main/java/com/ccsens/tall/bean/dto/RoleDto.java

@ -79,4 +79,22 @@ public class RoleDto {
@ApiModelProperty("项目id")
private Long projectId;
}
@Data
@ApiModel("修改角色是否展示")
public static class QueryRoleIsShows {
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("角色id")
private List<Long> roleIds;
@ApiModelProperty("是否展示 true是展示,false是删除不展示")
private Boolean isShow;
}
@Data
@ApiModel("为角色排序得集合")
public static class UpRoleShowsOrder {
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("按照展示的排序进行排序号")
private List<Long> roleIds;
}
}

6
tall/src/main/java/com/ccsens/tall/bean/dto/TaskDto.java

@ -44,6 +44,8 @@ public class TaskDto {
private List<Long> pluginList;
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0")
private Byte priority;
@ApiModelProperty("标签")
private String milestone;
@ApiModelProperty("任务提醒消息")
private TaskRemindByAdd taskRemind;
}
@ -209,8 +211,8 @@ public class TaskDto {
private Long delayTime;
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0")
private Byte priority;
@ApiModelProperty("是否是里程碑 0否 1是 2普通任务 3关键任务")
private Byte milestone;
@ApiModelProperty("标签")
private String milestone;
@ApiModelProperty("交付物id和修改后的名字")
private List<UpdateTaskDeliverName> deliverList;
@ApiModelProperty("输入文档的id和修改后的名字")

95
tall/src/main/java/com/ccsens/tall/bean/po/ProPluginPreviewFile.java

@ -0,0 +1,95 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class ProPluginPreviewFile implements Serializable {
private Long id;
private Long pluginId;
private Long fileId;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private String previewDescription;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPluginId() {
return pluginId;
}
public void setPluginId(Long pluginId) {
this.pluginId = pluginId;
}
public Long getFileId() {
return fileId;
}
public void setFileId(Long fileId) {
this.fileId = fileId;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
public String getPreviewDescription() {
return previewDescription;
}
public void setPreviewDescription(String previewDescription) {
this.previewDescription = previewDescription == null ? null : previewDescription.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", pluginId=").append(pluginId);
sb.append(", fileId=").append(fileId);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", previewDescription=").append(previewDescription);
sb.append("]");
return sb.toString();
}
}

631
tall/src/main/java/com/ccsens/tall/bean/po/ProPluginPreviewFileExample.java

@ -0,0 +1,631 @@
package com.ccsens.tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ProPluginPreviewFileExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public ProPluginPreviewFileExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPluginIdIsNull() {
addCriterion("plugin_id is null");
return (Criteria) this;
}
public Criteria andPluginIdIsNotNull() {
addCriterion("plugin_id is not null");
return (Criteria) this;
}
public Criteria andPluginIdEqualTo(Long value) {
addCriterion("plugin_id =", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotEqualTo(Long value) {
addCriterion("plugin_id <>", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThan(Long value) {
addCriterion("plugin_id >", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThanOrEqualTo(Long value) {
addCriterion("plugin_id >=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThan(Long value) {
addCriterion("plugin_id <", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThanOrEqualTo(Long value) {
addCriterion("plugin_id <=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdIn(List<Long> values) {
addCriterion("plugin_id in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotIn(List<Long> values) {
addCriterion("plugin_id not in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdBetween(Long value1, Long value2) {
addCriterion("plugin_id between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotBetween(Long value1, Long value2) {
addCriterion("plugin_id not between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andFileIdIsNull() {
addCriterion("file_id is null");
return (Criteria) this;
}
public Criteria andFileIdIsNotNull() {
addCriterion("file_id is not null");
return (Criteria) this;
}
public Criteria andFileIdEqualTo(Long value) {
addCriterion("file_id =", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotEqualTo(Long value) {
addCriterion("file_id <>", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdGreaterThan(Long value) {
addCriterion("file_id >", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdGreaterThanOrEqualTo(Long value) {
addCriterion("file_id >=", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdLessThan(Long value) {
addCriterion("file_id <", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdLessThanOrEqualTo(Long value) {
addCriterion("file_id <=", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdIn(List<Long> values) {
addCriterion("file_id in", values, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotIn(List<Long> values) {
addCriterion("file_id not in", values, "fileId");
return (Criteria) this;
}
public Criteria andFileIdBetween(Long value1, Long value2) {
addCriterion("file_id between", value1, value2, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotBetween(Long value1, Long value2) {
addCriterion("file_id not between", value1, value2, "fileId");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andPreviewDescriptionIsNull() {
addCriterion("preview_description is null");
return (Criteria) this;
}
public Criteria andPreviewDescriptionIsNotNull() {
addCriterion("preview_description is not null");
return (Criteria) this;
}
public Criteria andPreviewDescriptionEqualTo(String value) {
addCriterion("preview_description =", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionNotEqualTo(String value) {
addCriterion("preview_description <>", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionGreaterThan(String value) {
addCriterion("preview_description >", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("preview_description >=", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionLessThan(String value) {
addCriterion("preview_description <", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionLessThanOrEqualTo(String value) {
addCriterion("preview_description <=", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionLike(String value) {
addCriterion("preview_description like", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionNotLike(String value) {
addCriterion("preview_description not like", value, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionIn(List<String> values) {
addCriterion("preview_description in", values, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionNotIn(List<String> values) {
addCriterion("preview_description not in", values, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionBetween(String value1, String value2) {
addCriterion("preview_description between", value1, value2, "previewDescription");
return (Criteria) this;
}
public Criteria andPreviewDescriptionNotBetween(String value1, String value2) {
addCriterion("preview_description not between", value1, value2, "previewDescription");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

8
tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetail.java

@ -58,7 +58,7 @@ public class ProTaskDetail implements Serializable {
private Byte priority;
private Byte milestone;
private String milestone;
private static final long serialVersionUID = 1L;
@ -278,12 +278,12 @@ public class ProTaskDetail implements Serializable {
this.priority = priority;
}
public Byte getMilestone() {
public String getMilestone() {
return milestone;
}
public void setMilestone(Byte milestone) {
this.milestone = milestone;
public void setMilestone(String milestone) {
this.milestone = milestone == null ? null : milestone.trim();
}
@Override

30
tall/src/main/java/com/ccsens/tall/bean/po/ProTaskDetailExample.java

@ -1785,52 +1785,62 @@ public class ProTaskDetailExample {
return (Criteria) this;
}
public Criteria andMilestoneEqualTo(Byte value) {
public Criteria andMilestoneEqualTo(String value) {
addCriterion("milestone =", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneNotEqualTo(Byte value) {
public Criteria andMilestoneNotEqualTo(String value) {
addCriterion("milestone <>", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneGreaterThan(Byte value) {
public Criteria andMilestoneGreaterThan(String value) {
addCriterion("milestone >", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneGreaterThanOrEqualTo(Byte value) {
public Criteria andMilestoneGreaterThanOrEqualTo(String value) {
addCriterion("milestone >=", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneLessThan(Byte value) {
public Criteria andMilestoneLessThan(String value) {
addCriterion("milestone <", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneLessThanOrEqualTo(Byte value) {
public Criteria andMilestoneLessThanOrEqualTo(String value) {
addCriterion("milestone <=", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneIn(List<Byte> values) {
public Criteria andMilestoneLike(String value) {
addCriterion("milestone like", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneNotLike(String value) {
addCriterion("milestone not like", value, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneIn(List<String> values) {
addCriterion("milestone in", values, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneNotIn(List<Byte> values) {
public Criteria andMilestoneNotIn(List<String> values) {
addCriterion("milestone not in", values, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneBetween(Byte value1, Byte value2) {
public Criteria andMilestoneBetween(String value1, String value2) {
addCriterion("milestone between", value1, value2, "milestone");
return (Criteria) this;
}
public Criteria andMilestoneNotBetween(Byte value1, Byte value2) {
public Criteria andMilestoneNotBetween(String value1, String value2) {
addCriterion("milestone not between", value1, value2, "milestone");
return (Criteria) this;
}

326
tall/src/main/java/com/ccsens/tall/bean/po/ProTasketail.java

@ -0,0 +1,326 @@
package com.ccsens.tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class ProTasketail implements Serializable {
private Long id;
private Long projectId;
private String name;
private String description;
private Long beginTime;
private Long endTime;
private String cycle;
private Long parentId;
private String subTask;
private Long subProjectId;
private String subProject;
private Long executorRole;
private Long checkerRole;
private Long money;
private Byte delay;
private Long delayTime;
private Long loopTo;
private Integer loopTimes;
private Byte virtual;
private Byte level;
private Byte hasGroup;
private Byte finishNeedAll;
private Byte allMember;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte priority;
private String milestone;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public Long getBeginTime() {
return beginTime;
}
public void setBeginTime(Long beginTime) {
this.beginTime = beginTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public String getCycle() {
return cycle;
}
public void setCycle(String cycle) {
this.cycle = cycle == null ? null : cycle.trim();
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getSubTask() {
return subTask;
}
public void setSubTask(String subTask) {
this.subTask = subTask == null ? null : subTask.trim();
}
public Long getSubProjectId() {
return subProjectId;
}
public void setSubProjectId(Long subProjectId) {
this.subProjectId = subProjectId;
}
public String getSubProject() {
return subProject;
}
public void setSubProject(String subProject) {
this.subProject = subProject == null ? null : subProject.trim();
}
public Long getExecutorRole() {
return executorRole;
}
public void setExecutorRole(Long executorRole) {
this.executorRole = executorRole;
}
public Long getCheckerRole() {
return checkerRole;
}
public void setCheckerRole(Long checkerRole) {
this.checkerRole = checkerRole;
}
public Long getMoney() {
return money;
}
public void setMoney(Long money) {
this.money = money;
}
public Byte getDelay() {
return delay;
}
public void setDelay(Byte delay) {
this.delay = delay;
}
public Long getDelayTime() {
return delayTime;
}
public void setDelayTime(Long delayTime) {
this.delayTime = delayTime;
}
public Long getLoopTo() {
return loopTo;
}
public void setLoopTo(Long loopTo) {
this.loopTo = loopTo;
}
public Integer getLoopTimes() {
return loopTimes;
}
public void setLoopTimes(Integer loopTimes) {
this.loopTimes = loopTimes;
}
public Byte getVirtual() {
return virtual;
}
public void setVirtual(Byte virtual) {
this.virtual = virtual;
}
public Byte getLevel() {
return level;
}
public void setLevel(Byte level) {
this.level = level;
}
public Byte getHasGroup() {
return hasGroup;
}
public void setHasGroup(Byte hasGroup) {
this.hasGroup = hasGroup;
}
public Byte getFinishNeedAll() {
return finishNeedAll;
}
public void setFinishNeedAll(Byte finishNeedAll) {
this.finishNeedAll = finishNeedAll;
}
public Byte getAllMember() {
return allMember;
}
public void setAllMember(Byte allMember) {
this.allMember = allMember;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
public Byte getPriority() {
return priority;
}
public void setPriority(Byte priority) {
this.priority = priority;
}
public String getMilestone() {
return milestone;
}
public void setMilestone(String milestone) {
this.milestone = milestone == null ? null : milestone.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", projectId=").append(projectId);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", beginTime=").append(beginTime);
sb.append(", endTime=").append(endTime);
sb.append(", cycle=").append(cycle);
sb.append(", parentId=").append(parentId);
sb.append(", subTask=").append(subTask);
sb.append(", subProjectId=").append(subProjectId);
sb.append(", subProject=").append(subProject);
sb.append(", executorRole=").append(executorRole);
sb.append(", checkerRole=").append(checkerRole);
sb.append(", money=").append(money);
sb.append(", delay=").append(delay);
sb.append(", delayTime=").append(delayTime);
sb.append(", loopTo=").append(loopTo);
sb.append(", loopTimes=").append(loopTimes);
sb.append(", virtual=").append(virtual);
sb.append(", level=").append(level);
sb.append(", hasGroup=").append(hasGroup);
sb.append(", finishNeedAll=").append(finishNeedAll);
sb.append(", allMember=").append(allMember);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", priority=").append(priority);
sb.append(", milestone=").append(milestone);
sb.append("]");
return sb.toString();
}
}

1941
tall/src/main/java/com/ccsens/tall/bean/po/ProTasketailExample.java

File diff suppressed because it is too large

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

@ -12,13 +12,19 @@ public class SysPlugin implements Serializable {
private Byte scene;
private Byte showType;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte showType;
private Long pluginIcon;
private Long pluginAuthor;
private Byte pluginClass;
private static final long serialVersionUID = 1L;
@ -54,6 +60,14 @@ public class SysPlugin implements Serializable {
this.scene = scene;
}
public Byte getShowType() {
return showType;
}
public void setShowType(Byte showType) {
this.showType = showType;
}
public Date getCreatedAt() {
return createdAt;
}
@ -78,12 +92,28 @@ public class SysPlugin implements Serializable {
this.recStatus = recStatus;
}
public Byte getShowType() {
return showType;
public Long getPluginIcon() {
return pluginIcon;
}
public void setShowType(Byte showType) {
this.showType = showType;
public void setPluginIcon(Long pluginIcon) {
this.pluginIcon = pluginIcon;
}
public Long getPluginAuthor() {
return pluginAuthor;
}
public void setPluginAuthor(Long pluginAuthor) {
this.pluginAuthor = pluginAuthor;
}
public Byte getPluginClass() {
return pluginClass;
}
public void setPluginClass(Byte pluginClass) {
this.pluginClass = pluginClass;
}
@Override
@ -96,10 +126,13 @@ public class SysPlugin implements Serializable {
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", scene=").append(scene);
sb.append(", showType=").append(showType);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", showType=").append(showType);
sb.append(", pluginIcon=").append(pluginIcon);
sb.append(", pluginAuthor=").append(pluginAuthor);
sb.append(", pluginClass=").append(pluginClass);
sb.append("]");
return sb.toString();
}

228
tall/src/main/java/com/ccsens/tall/bean/po/SysPluginExample.java

@ -365,6 +365,66 @@ public class SysPluginExample {
return (Criteria) this;
}
public Criteria andShowTypeIsNull() {
addCriterion("show_type is null");
return (Criteria) this;
}
public Criteria andShowTypeIsNotNull() {
addCriterion("show_type is not null");
return (Criteria) this;
}
public Criteria andShowTypeEqualTo(Byte value) {
addCriterion("show_type =", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotEqualTo(Byte value) {
addCriterion("show_type <>", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThan(Byte value) {
addCriterion("show_type >", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("show_type >=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThan(Byte value) {
addCriterion("show_type <", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThanOrEqualTo(Byte value) {
addCriterion("show_type <=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeIn(List<Byte> values) {
addCriterion("show_type in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotIn(List<Byte> values) {
addCriterion("show_type not in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeBetween(Byte value1, Byte value2) {
addCriterion("show_type between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotBetween(Byte value1, Byte value2) {
addCriterion("show_type not between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
@ -545,63 +605,183 @@ public class SysPluginExample {
return (Criteria) this;
}
public Criteria andShowTypeIsNull() {
addCriterion("show_type is null");
public Criteria andPluginIconIsNull() {
addCriterion("plugin_icon is null");
return (Criteria) this;
}
public Criteria andShowTypeIsNotNull() {
addCriterion("show_type is not null");
public Criteria andPluginIconIsNotNull() {
addCriterion("plugin_icon is not null");
return (Criteria) this;
}
public Criteria andShowTypeEqualTo(Byte value) {
addCriterion("show_type =", value, "showType");
public Criteria andPluginIconEqualTo(Long value) {
addCriterion("plugin_icon =", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeNotEqualTo(Byte value) {
addCriterion("show_type <>", value, "showType");
public Criteria andPluginIconNotEqualTo(Long value) {
addCriterion("plugin_icon <>", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThan(Byte value) {
addCriterion("show_type >", value, "showType");
public Criteria andPluginIconGreaterThan(Long value) {
addCriterion("plugin_icon >", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("show_type >=", value, "showType");
public Criteria andPluginIconGreaterThanOrEqualTo(Long value) {
addCriterion("plugin_icon >=", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeLessThan(Byte value) {
addCriterion("show_type <", value, "showType");
public Criteria andPluginIconLessThan(Long value) {
addCriterion("plugin_icon <", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeLessThanOrEqualTo(Byte value) {
addCriterion("show_type <=", value, "showType");
public Criteria andPluginIconLessThanOrEqualTo(Long value) {
addCriterion("plugin_icon <=", value, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeIn(List<Byte> values) {
addCriterion("show_type in", values, "showType");
public Criteria andPluginIconIn(List<Long> values) {
addCriterion("plugin_icon in", values, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeNotIn(List<Byte> values) {
addCriterion("show_type not in", values, "showType");
public Criteria andPluginIconNotIn(List<Long> values) {
addCriterion("plugin_icon not in", values, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeBetween(Byte value1, Byte value2) {
addCriterion("show_type between", value1, value2, "showType");
public Criteria andPluginIconBetween(Long value1, Long value2) {
addCriterion("plugin_icon between", value1, value2, "pluginIcon");
return (Criteria) this;
}
public Criteria andShowTypeNotBetween(Byte value1, Byte value2) {
addCriterion("show_type not between", value1, value2, "showType");
public Criteria andPluginIconNotBetween(Long value1, Long value2) {
addCriterion("plugin_icon not between", value1, value2, "pluginIcon");
return (Criteria) this;
}
public Criteria andPluginAuthorIsNull() {
addCriterion("plugin_author is null");
return (Criteria) this;
}
public Criteria andPluginAuthorIsNotNull() {
addCriterion("plugin_author is not null");
return (Criteria) this;
}
public Criteria andPluginAuthorEqualTo(Long value) {
addCriterion("plugin_author =", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorNotEqualTo(Long value) {
addCriterion("plugin_author <>", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorGreaterThan(Long value) {
addCriterion("plugin_author >", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorGreaterThanOrEqualTo(Long value) {
addCriterion("plugin_author >=", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorLessThan(Long value) {
addCriterion("plugin_author <", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorLessThanOrEqualTo(Long value) {
addCriterion("plugin_author <=", value, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorIn(List<Long> values) {
addCriterion("plugin_author in", values, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorNotIn(List<Long> values) {
addCriterion("plugin_author not in", values, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorBetween(Long value1, Long value2) {
addCriterion("plugin_author between", value1, value2, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginAuthorNotBetween(Long value1, Long value2) {
addCriterion("plugin_author not between", value1, value2, "pluginAuthor");
return (Criteria) this;
}
public Criteria andPluginClassIsNull() {
addCriterion("plugin_class is null");
return (Criteria) this;
}
public Criteria andPluginClassIsNotNull() {
addCriterion("plugin_class is not null");
return (Criteria) this;
}
public Criteria andPluginClassEqualTo(Byte value) {
addCriterion("plugin_class =", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassNotEqualTo(Byte value) {
addCriterion("plugin_class <>", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassGreaterThan(Byte value) {
addCriterion("plugin_class >", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassGreaterThanOrEqualTo(Byte value) {
addCriterion("plugin_class >=", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassLessThan(Byte value) {
addCriterion("plugin_class <", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassLessThanOrEqualTo(Byte value) {
addCriterion("plugin_class <=", value, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassIn(List<Byte> values) {
addCriterion("plugin_class in", values, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassNotIn(List<Byte> values) {
addCriterion("plugin_class not in", values, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassBetween(Byte value1, Byte value2) {
addCriterion("plugin_class between", value1, value2, "pluginClass");
return (Criteria) this;
}
public Criteria andPluginClassNotBetween(Byte value1, Byte value2) {
addCriterion("plugin_class not between", value1, value2, "pluginClass");
return (Criteria) this;
}
}

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

@ -1,9 +1,11 @@
package com.ccsens.tall.bean.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@ -121,6 +123,46 @@ public class PluginVo {
private String projectName;
}
@Data
@ApiModel("根据任务id查找插件列表(已添加)")
public static class PluginByTaskAdded {
@ApiModelProperty("插件名称")
private String pluginName;
@ApiModelProperty("插件图标")
private Long pluginIcon;
@ApiModelProperty("插件图标")
private FileVo.FilePosition iconUrl;
@ApiModelProperty("插件id")
private Long pluginId;
@ApiModelProperty("插件描述")
private String description;
@ApiModelProperty("插件作者")
private Long pluginAuthor;
@ApiModelProperty("插件预览图片")
private List<FileVo.FilePosition> previewImgs = new ArrayList<>();
@JsonIgnore
private String fileIdList;
}
@Data
@ApiModel("插件预览图信息(已添加)")
public static class ImgByTaskAdded {
@ApiModelProperty("预览图id")
private Long previewId;
@ApiModelProperty("预览图描述")
private String previewDescription;
}
@Data
@ApiModel("根据任务id查找插件列表(已添加)")
public static class PluginByTaskAdded1 {
@ApiModelProperty("插件名称")
private String pluginName;
@ApiModelProperty("插件id")
private Long pluginId;
@ApiModelProperty("插件描述")
private String description;
}
}

3
tall/src/main/java/com/ccsens/tall/bean/vo/RoleVo.java

@ -1,5 +1,6 @@
package com.ccsens.tall.bean.vo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -36,6 +37,8 @@ public class RoleVo {
private String name;
@ApiModelProperty("角色排序")
private Integer sequence;
@ApiModelProperty("是否是pm 是pm;true 不是pm; false ")
private Boolean isPM;
}
@Data
@ApiModel("添加时返回成员信息")

4
tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java

@ -156,7 +156,7 @@ public class TaskVo {
@ApiModelProperty("优先级 默认0 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急")
private Byte priority;
@ApiModelProperty("是否是里程碑 0否 1里程碑 2普通任务 3关键任务")
private Byte milestone;
private String milestone;
@ApiModelProperty("提醒的信息")
private List<RemindInfo> remindInfoList;
public Long getDuration(){
@ -500,7 +500,7 @@ public class TaskVo {
@ApiModelProperty("优先级 默认0 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急")
private Byte priority;
@ApiModelProperty("是否是里程碑 0否 1是")
private Byte milestone;
private String milestone;
@ApiModelProperty("二级任务")
private List<TaskListByProjectId> secondTasks;
}

9
tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginPreviewFileDao.java

@ -0,0 +1,9 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.persist.mapper.ProPluginPreviewFileMapper;
/**
* @author mz
*/
public interface ProPluginPreviewFileDao extends ProPluginPreviewFileMapper {
}

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

@ -72,18 +72,18 @@ public interface ProRoleDao extends ProRoleMapper{
/**
* 查询已经存在的角色
* @param projectId
* @param memberId
* @return
*/
List<RoleVo.JueSeByProId> queryRoleShowslistAfter(Long projectId);
List<RoleVo.JueSeByProId> queryRoleShowslistAfter(Long memberId);
/**
* 查询未添加的角色
* @param memberId
* @param projectId
* @param listBeforeId
* @return
*/
List<RoleVo.JueSeByProId> queryRoleShowslistBefore(Long memberId, List<Long> listBeforeId);
List<RoleVo.JueSeByProId> queryRoleShowslistBefore(Long projectId, List<Long> listBeforeId);
// /**
// * 查找项目下的所有成员的名字用“,”分隔

26
tall/src/main/java/com/ccsens/tall/persist/dao/TaskPluginDao.java

@ -1,8 +1,34 @@
package com.ccsens.tall.persist.dao;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.persist.mapper.ProTaskPluginMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author mz
*/
@Repository
public interface TaskPluginDao extends ProTaskPluginMapper{
/**
* 根据任务id查询插件列表(该任务已添加的)
* @param taskId 任务id
* @param roleId 角色id
* @param pluginName 插件名称
* @param pluginType 插件类型
* @return
*/
List<PluginVo.PluginByTaskAdded> findPluginOfAdded(@Param("taskId") Long taskId,@Param("roleId") Long roleId,@Param("pluginName") String pluginName,@Param("pluginType") Byte pluginType);
/**
* 根据任务id查询插件列表(该任务未添加的)
* @param taskId 任务id
* @param roleId 角色id
* @param pluginName 插件名称
* @param pluginType 插件类型
* @return
*/
List<PluginVo.PluginByTaskAdded> findPluginOfNoAdded(@Param("taskId") Long taskId,@Param("roleId") Long roleId,@Param("pluginName") String pluginName,@Param("pluginType") Byte pluginType);
}

30
tall/src/main/java/com/ccsens/tall/persist/mapper/ProPluginPreviewFileMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.ProPluginPreviewFile;
import com.ccsens.tall.bean.po.ProPluginPreviewFileExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ProPluginPreviewFileMapper {
long countByExample(ProPluginPreviewFileExample example);
int deleteByExample(ProPluginPreviewFileExample example);
int deleteByPrimaryKey(Long id);
int insert(ProPluginPreviewFile record);
int insertSelective(ProPluginPreviewFile record);
List<ProPluginPreviewFile> selectByExample(ProPluginPreviewFileExample example);
ProPluginPreviewFile selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ProPluginPreviewFile record, @Param("example") ProPluginPreviewFileExample example);
int updateByExample(@Param("record") ProPluginPreviewFile record, @Param("example") ProPluginPreviewFileExample example);
int updateByPrimaryKeySelective(ProPluginPreviewFile record);
int updateByPrimaryKey(ProPluginPreviewFile record);
}

30
tall/src/main/java/com/ccsens/tall/persist/mapper/ProTasketailMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tall.persist.mapper;
import com.ccsens.tall.bean.po.ProTasketail;
import com.ccsens.tall.bean.po.ProTasketailExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface ProTasketailMapper {
long countByExample(ProTasketailExample example);
int deleteByExample(ProTasketailExample example);
int deleteByPrimaryKey(Long id);
int insert(ProTasketail record);
int insertSelective(ProTasketail record);
List<ProTasketail> selectByExample(ProTasketailExample example);
ProTasketail selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") ProTasketail record, @Param("example") ProTasketailExample example);
int updateByExample(@Param("record") ProTasketail record, @Param("example") ProTasketailExample example);
int updateByPrimaryKeySelective(ProTasketail record);
int updateByPrimaryKey(ProTasketail record);
}

103
tall/src/main/java/com/ccsens/tall/service/ExcelService.java

@ -8,6 +8,7 @@ import com.ccsens.tall.bean.dto.WpsDto;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.tall.persist.mapper.ProTaskDeliverMapper;
import com.ccsens.util.*;
import com.ccsens.util.cron.CronConstant;
import com.ccsens.util.cron.NatureToDate;
@ -82,6 +83,8 @@ public class ExcelService implements IExcelService {
private ProRoleDao proRoleDao;
@Resource
private ProPluginConfigDao proPluginConfigDao;
@Resource
private ProTaskDeliverMapper proTaskDeliverMapper;
@Override
@ -848,15 +851,7 @@ public class ExcelService implements IExcelService {
taskDetail.setLevel((byte) WebConstant.TASK_LEVEL.SecondTask.value);
taskDetail.setHasGroup((byte) 0);
taskDetail.setAllMember((byte) 1);
if("关键任务".equals(label)){
taskDetail.setMilestone((byte) 3);
}else if("里程碑".equals(label)){
taskDetail.setMilestone((byte) 1);
}else {
//设置成默认的普通任务
taskDetail.setMilestone((byte) 2);
}
taskDetail.setMilestone(label);
//子项目
if (StrUtil.isNotEmpty(subProject)) {
subProject = StringUtil.replaceComma(subProject);
@ -1001,6 +996,7 @@ public class ExcelService implements IExcelService {
// else {
// //不是分组任务,直接添加交付物
readDeliverSheet(deliver, xssfWorkbook, taskDetail.getId());
// }
//添加任务
proTaskDetailService.saveTaskDetail(taskDetail);
@ -1178,45 +1174,60 @@ public class ExcelService implements IExcelService {
*/
@Override
public void readDeliverSheet(String deliverCell, XSSFWorkbook xssfWorkbook, Long taskId) {
if (StrUtil.isNotEmpty(deliverCell)) {
String str = "";
if (deliverCell.length() > 4) {
str = deliverCell.substring(0, 3);
}
if ("关联表".equalsIgnoreCase(str)) {
String subStr = deliverCell.substring(4);
XSSFSheet subSheet = xssfWorkbook.getSheet(subStr);
if(ObjectUtil.isNull(subSheet)){
throw new BaseException(CodeEnum.WBS_NOT_SUB_TASK);
}
for (int i = 2; i <= subSheet.getLastRowNum(); i++) {
XSSFRow row = subSheet.getRow(i);
if(ObjectUtil.isNull(row)){
continue;
}
String deliver = ExcelUtil.getCellValue(row.getCell(1));
if (StrUtil.isNotEmpty(deliver)) {
ProTaskDeliver taskDeliver = new ProTaskDeliver();
taskDeliver.setId(snowflake.nextId());
taskDeliver.setName(deliver);
taskDeliver.setTaskDetailId(taskId);
taskDeliver.setIsInput(0);
taskDeliver.setIsFinal(0);
if (i == subSheet.getLastRowNum()) {
taskDeliver.setIsFinal(1);
}
taskDeliverService.saveDeliver(taskDeliver);
}
// if (StrUtil.isNotEmpty(deliverCell)) {
// String str = "";
// if (deliverCell.length() > 4) {
// str = deliverCell.substring(0, 3);
// }
// if ("关联表".equalsIgnoreCase(str)) {
// String subStr = deliverCell.substring(4);
// XSSFSheet subSheet = xssfWorkbook.getSheet(subStr);
// if(ObjectUtil.isNull(subSheet)){
// throw new BaseException(CodeEnum.WBS_NOT_SUB_TASK);
// }
// for (int i = 2; i <= subSheet.getLastRowNum(); i++) {
// XSSFRow row = subSheet.getRow(i);
// if(ObjectUtil.isNull(row)){
// continue;
// }
// String deliver = ExcelUtil.getCellValue(row.getCell(1));
// if (StrUtil.isNotEmpty(deliver)) {
// ProTaskDeliver taskDeliver = new ProTaskDeliver();
// taskDeliver.setId(snowflake.nextId());
// taskDeliver.setName(deliver);
// taskDeliver.setTaskDetailId(taskId);
// taskDeliver.setIsInput(0);
// taskDeliver.setIsFinal(0);
// if (i == subSheet.getLastRowNum()) {
// taskDeliver.setIsFinal(1);
// }
// taskDeliverService.saveDeliver(taskDeliver);
// }
// }
// } else {
// ProTaskDeliver taskDeliver = new ProTaskDeliver();
// taskDeliver.setId(snowflake.nextId());
// taskDeliver.setTaskDetailId(taskId);
// taskDeliver.setName(deliverCell);
// taskDeliver.setIsInput(0);
// taskDeliver.setIsFinal(1);
// taskDeliverService.saveDeliver(taskDeliver);
// }
// }
String regex=",|,|;|:|;|:|、|。";
deliverCell= deliverCell.replace("\n","").replace("\r","");
String[] fileNames= deliverCell.split(regex);
if(fileNames.length>0){
for (int i = 0; i < fileNames.length; i++) {
if(StringUtils.isNotBlank(fileNames[i])){
ProTaskDeliver proTaskDeliver=new ProTaskDeliver();
proTaskDeliver.setName(fileNames[i].trim());
proTaskDeliver.setId(snowflake.nextId());
proTaskDeliver.setTaskDetailId(taskId);
proTaskDeliverMapper.insertSelective(proTaskDeliver);
}
} else {
ProTaskDeliver taskDeliver = new ProTaskDeliver();
taskDeliver.setId(snowflake.nextId());
taskDeliver.setTaskDetailId(taskId);
taskDeliver.setName(deliverCell);
taskDeliver.setIsInput(0);
taskDeliver.setIsFinal(1);
taskDeliverService.saveDeliver(taskDeliver);
}
}
}

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

@ -66,4 +66,8 @@ public interface IProRoleService {
* @return
*/
RoleVo.JueSeByProIdLists queryRoleShows(QueryDto<RoleDto.QueryRoleShows> param);
void queryRoleIsShows(QueryDto<RoleDto.QueryRoleIsShows> param);
void upRoleShowsOrder(QueryDto<RoleDto.UpRoleShowsOrder> param);
}

34
tall/src/main/java/com/ccsens/tall/service/ISysPluginService.java

@ -2,12 +2,18 @@ package com.ccsens.tall.service;
import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.vo.PluginVo;
import com.github.pagehelper.PageInfo;
import java.util.List;
public interface ISysPluginService {
void saveSysPlugin(PluginDto.SaveSysPlugin saveSysPlugin);
/**
* 添加插件(插件总表)
* @param param
* @param userId
*/
void saveSysPlugin(PluginDto.SaveSysPlugin param,Long userId);
List<PluginVo.PluginInfo> getPluginAll();
@ -17,4 +23,30 @@ public interface ISysPluginService {
Long getTaskDetailIdByPlugin(Long taskPluginId);
/**
* 根据任务id查询插件列表(该任务已添加的)
* @param param
* @return
*/
List<PluginVo.PluginByTaskAdded> findPluginOfAdded(PluginDto.FindPluginByTask param);
/**
* 根据任务id查询插件列表(该任务未添加的的)
* @param param
* @return
*/
PageInfo<PluginVo.PluginByTaskAdded> findPluginOfNoAdded(PluginDto.FindPluginByTaskNo param);
/**
* 给任务添加插件
* @param param
*/
void addPluginForTask(PluginDto.AddPluginForTask param,Long userId);
/**
* 给任务删除插件
* @param param
* @param userId
*/
void deletePluginForTask(PluginDto.DeletePluginForTask param, Long userId);
}

6
tall/src/main/java/com/ccsens/tall/service/InputDocService.java

@ -238,6 +238,9 @@ public class InputDocService implements IInputDocService {
if (ArrayUtil.isEmpty(param.getFileIds()) && StrUtil.isBlank(param.getRemark())){
throw new BaseException("请上传文件或填写备注信息");
}
if (ObjectUtil.isNull(proTaskInputDocMapper.selectByPrimaryKey(param.getDocId()))){
throw new BaseException("输入文档不存在或已删除");
}
//多文件添加
if (!ArrayUtil.isEmpty(param.getFileIds())){
String fileIds = "";
@ -333,6 +336,9 @@ public class InputDocService implements IInputDocService {
public void updateDoc(InputDocDto.UpdateDoc param) {
//判断是否有重复
ProTaskInputDoc proTaskInputDoc = proTaskInputDocMapper.selectByPrimaryKey(param.getDocId());
if (ObjectUtil.isNull(proTaskInputDoc)){
throw new BaseException(CodeEnum.DOC_NONE);
}
ProTaskInputDocExample proTaskInputDocExample = new ProTaskInputDocExample();
proTaskInputDocExample.createCriteria().andTaskDetailIdEqualTo(proTaskInputDoc.getTaskDetailId());
List<ProTaskInputDoc> proTaskInputDocs = proTaskInputDocMapper.selectByExample(proTaskInputDocExample);

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

@ -12,16 +12,14 @@ import com.ccsens.tall.bean.vo.ProjectVo;
import com.ccsens.tall.bean.vo.RoleVo;
import com.ccsens.tall.bean.vo.TaskVo;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.tall.persist.mapper.ProMemberMapper;
import com.ccsens.tall.persist.mapper.ProMemberRoleMapper;
import com.ccsens.tall.persist.mapper.ProMemberRoleShowMapper;
import com.ccsens.tall.persist.mapper.ProUserAttentionRoleMapper;
import com.ccsens.tall.persist.mapper.*;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.WebConstant;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.apache.bcel.classfile.Code;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -29,6 +27,7 @@ import org.w3c.dom.ls.LSInput;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
@ -71,6 +70,10 @@ public class ProRoleService implements IProRoleService {
private ProMemberMapper proMemberMapper;
@Resource
private ProMemberRoleMapper proMemberRoleMapper;
@Resource
private ProRoleMapper proRoleMapper;
@Resource
private ProRoleExcludeMapper proRoleExcludeMapper;
@Override
public void saveProRole(ProRole proRole) {
proRoleDao.insertSelective(proRole);
@ -265,6 +268,7 @@ public class ProRoleService implements IProRoleService {
proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(memberId).andRecStatusEqualTo((byte)0);
List<ProMemberRoleShow> proMemberRoleShows = proMemberRoleShowMapper.selectByExample(proMemberRoleShowExample);
if(CollectionUtil.isEmpty(proMemberRoleShows)){
Integer[] seq=new Integer[]{0};
//需要从原表中导入数据
ProMemberRoleExample proMemberRoleExample=new ProMemberRoleExample();
proMemberRoleExample.createCriteria().andMemberIdEqualTo(memberId).andRecStatusEqualTo((byte)0);
@ -272,7 +276,7 @@ public class ProRoleService implements IProRoleService {
if(CollectionUtil.isNotEmpty(proMemberRoles)){
ProMemberRoleShow proMemberRoleShow=new ProMemberRoleShow();
Long finalMemberId = memberId;
Integer[] seq=new Integer[]{0};
proMemberRoles.forEach(action->{
proMemberRoleShow.setId(action.getId());
proMemberRoleShow.setMemberId(finalMemberId);
@ -281,6 +285,68 @@ public class ProRoleService implements IProRoleService {
proMemberRoleShowMapper.insertSelective(proMemberRoleShow);
});
}
//这里插入项目经理
//查一下项目经理的角色id,
ProRoleExample proRoleExample=new ProRoleExample();
proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(projectId);
//一级角色项目经理
List<Long> jili=proRoleMapper.selectByExample(proRoleExample).stream().map(action->action.getId()).collect(Collectors.toList());
//二级角色项目经理
ProRoleExample proRoleExample1=new ProRoleExample();
proRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andParentIdIn(jili);
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1);
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList());
//是否是pm true是经理 false不是经理
boolean[] isPm = new boolean[]{false};
//经理是否对他不可见 true不可见 false可见
boolean[] isshow=new boolean[]{false};
//查询已经添加的角色
List<RoleVo.JueSeByProId> listBefor=proRoleDao.queryRoleShowslistAfter(memberId);
List<Long> listBeforeId= listBefor.stream().map(action ->{return action.getId();}).collect(Collectors.toList());
//判断该成员是不是项目经理
ProMemberRoleExample proMemberRoleExample1=new ProMemberRoleExample();
proMemberRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andMemberIdEqualTo(memberId).andRoleIdEqualTo(jili1.get(0));
List<ProMemberRole> proMemberRoles1 = proMemberRoleMapper.selectByExample(proMemberRoleExample1);
if(CollectionUtil.isEmpty(proMemberRoles1)){
isPm[0]=false;
}else {
isPm[0]=true;
}
if(!isPm[0]){
//先按照一个经理的算
ProRoleExcludeExample proRoleExcludeExample=new ProRoleExcludeExample();
proRoleExcludeExample.createCriteria().andRecStatusEqualTo((byte)0).andRoleIdEqualTo(jili1.get(0));
List<ProRoleExclude> proRoleExcludes = proRoleExcludeMapper.selectByExample(proRoleExcludeExample);
proRoleExcludes.forEach(action->{
//查看查询出的不可见角色id是否在角色id里面
if(listBeforeId.contains(action.getOtherRoleId()))
{
isshow[0]=true;
}
});
}
if(!isPm[0]&&!isshow[0]){
//添加经理
if(!listBeforeId.contains(jili1.get(0))) {
RoleVo.JueSeByProId jueSeByProId = new RoleVo.JueSeByProId();
jueSeByProId.setId(proRoles.get(0).getId());
jueSeByProId.setName(proRoles.get(0).getName());
jueSeByProId.setSequence(proRoles.get(0).getSequence());
listBefor.add(jueSeByProId);
//顺道插入到show表里面
ProMemberRoleShow proMemberRoleShow=new ProMemberRoleShow();
proMemberRoleShow.setId(snowflake.nextId());
proMemberRoleShow.setRoleId(proRoles.get(0).getId());
proMemberRoleShow.setMemberId(memberId);
proMemberRoleShow.setSequence(0);
proMemberRoleShowMapper.insertSelective(proMemberRoleShow);
}
}
}
//查询二级角色
List<ProjectVo.RoleInfo> memberRoleList;
@ -313,6 +379,9 @@ public class ProRoleService implements IProRoleService {
@Override
public int selectPowerByRoleName(Long userId, Long projectId) {
int power = 0;
if (null == userId || null == projectId){
return power;
}
SysProject project = projectDao.selectByPrimaryKey(projectId);
if (ObjectUtil.isNotNull(project)) {
if (project.getCreatorId().longValue() == userId) {
@ -646,9 +715,177 @@ public class ProRoleService implements IProRoleService {
@Override
public RoleVo.JueSeByProIdLists queryRoleShows(QueryDto<RoleDto.QueryRoleShows> param) {
RoleVo.JueSeByProIdLists jueSeByProIdLists=new RoleVo.JueSeByProIdLists();
//获取成员id
Long memberId = queryMemberId(param.getParam().getProjectId(), param.getUserId());
//获取经理角色id
ProRoleExample proRoleExample=new ProRoleExample();
proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(param.getParam().getProjectId());
//一级角色项目经理
List<Long> jili=proRoleMapper.selectByExample(proRoleExample).stream().map(action->action.getId()).collect(Collectors.toList());
//二级角色项目经理
ProRoleExample proRoleExample1=new ProRoleExample();
proRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andParentIdIn(jili);
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1);
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList());
//查询已经添加的角色
List<RoleVo.JueSeByProId> listBefor=proRoleDao.queryRoleShowslistAfter(memberId);
List<Long> listBeforeId= listBefor.stream().map(action ->{return action.getId();}).collect(Collectors.toList());
for (int i = 0; i < listBefor.size(); i++) {
if(jili1.contains(listBefor.get(i).getId())){
listBefor.get(i).setIsPM(true);
}else {
listBefor.get(i).setIsPM(false);
}
}
//查询未添加的角色
List<RoleVo.JueSeByProId> listAfter=proRoleDao.queryRoleShowslistBefore(param.getParam().getProjectId(),listBeforeId);
jueSeByProIdLists.setListAfter(listAfter);
jueSeByProIdLists.setListBefore(listBefor);
return jueSeByProIdLists;
}
/**
* 修改角色是否展示
* @param param
*/
@Override
public void queryRoleIsShows(QueryDto<RoleDto.QueryRoleIsShows> param) {
//获取成员id
Long memberId=queryMemberId(param.getParam().getProjectId(),param.getUserId());
//获取经理得id
ProRoleExample proRoleExample=new ProRoleExample();
proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(param.getParam().getProjectId());
//一级角色项目经理
List<Long> jili=proRoleMapper.selectByExample(proRoleExample).stream().map(action->action.getId()).collect(Collectors.toList());
//二级角色项目经理
ProRoleExample proRoleExample1=new ProRoleExample();
proRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andParentIdIn(jili);
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1);
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList());
if(param.getParam().getIsShow()){
//展示的 增加的 不需要考虑是否为经理
ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample();
proMemberRoleShowExample.createCriteria().andRecStatusEqualTo((byte) 0).andMemberIdEqualTo(memberId);
List<ProMemberRoleShow> proMemberRoleShows = proMemberRoleShowMapper.selectByExample(proMemberRoleShowExample);
if((proMemberRoleShows.size()+param.getParam().getRoleIds().size())>10){
throw new BaseException(CodeEnum.CHAOGUOSHI);
}else {
if(param.getParam().getRoleIds().size()>0){
//查一下目前最大得排序是多少
Integer[] seq=new Integer[]{proMemberRoleShows.stream().mapToInt(action->action.getSequence()).max().getAsInt()};
ProMemberRoleShowExample proMemberRoleShowExample1=new ProMemberRoleShowExample();
proMemberRoleShowExample1.createCriteria().andMemberIdEqualTo(memberId).andRoleIdIn(param.getParam().getRoleIds()).andRecStatusEqualTo((byte)0);
List<ProMemberRoleShow> proMemberRoleShows1 = proMemberRoleShowMapper.selectByExample(proMemberRoleShowExample1);
if(proMemberRoleShows1.size()>0){
throw new BaseException(CodeEnum.CHONGFUTIJIAO);
}
param.getParam().getRoleIds().forEach(ac->{
ProMemberRoleShow proMemberRoleShow=new ProMemberRoleShow();
proMemberRoleShow.setId(snowflake.nextId());
proMemberRoleShow.setRoleId(ac);
proMemberRoleShow.setMemberId(memberId);
if(jili1.contains(ac)){
proMemberRoleShow.setSequence(0);
}else {
proMemberRoleShow.setSequence(++seq[0]);
}
proMemberRoleShowMapper.insertSelective(proMemberRoleShow);
});
}
}
}else {
//不展示的,删除的
if(param.getParam().getRoleIds().size()>0){
//先判断是不是经理了
if(param.getParam().getRoleIds().contains(jili1.get(0))){
throw new BaseException(CodeEnum.BAOHANJINLI);
}
for (int i = 0; i <param.getParam().getRoleIds().size() ; i++) {
ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample();
proMemberRoleShowExample.createCriteria().andMemberIdEqualTo(memberId).andRoleIdEqualTo(param.getParam().getRoleIds().get(i)).andRecStatusEqualTo((byte)0);
ProMemberRoleShow proMemberRoleShow=new ProMemberRoleShow();
proMemberRoleShow.setRecStatus((byte)2);
proMemberRoleShowMapper.updateByExampleSelective(proMemberRoleShow,proMemberRoleShowExample);
}
}
}
}
/**
* 修改传入的角色的排序
* @param param
*/
@Override
public void upRoleShowsOrder(QueryDto<RoleDto.UpRoleShowsOrder> param) {
if(param.getParam().getRoleIds().size()<=1){
throw new BaseException(CodeEnum.ZUISHAOCHUANLIANGE);
}
Long memberId=queryMemberId(param.getParam().getProjectId(),param.getUserId());
ProRoleExample proRoleExample=new ProRoleExample();
proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(param.getParam().getProjectId());
//一级角色项目经理
List<Long> jili=proRoleMapper.selectByExample(proRoleExample).stream().map(action->action.getId()).collect(Collectors.toList());
//二级角色项目经理
ProRoleExample proRoleExample1=new ProRoleExample();
proRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andParentIdIn(jili);
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1);
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList());
for (int i = param.getParam().getRoleIds().size() - 1; i >= 0; i--) {
if(jili1.get(0).equals(param.getParam().getRoleIds().get(i))){
param.getParam().getRoleIds().remove(i);
}
}
//先查出来在数据库中这几个数据中最大的序号是多少,然后再最大的上面进行加加操作
ProMemberRoleShowExample proMemberRoleShowExample=new ProMemberRoleShowExample();
proMemberRoleShowExample.createCriteria().andRoleIdIn(param.getParam().getRoleIds()).andRecStatusEqualTo((byte)0);
List<ProMemberRoleShow> proMemberRoleShows = proMemberRoleShowMapper.selectByExample(proMemberRoleShowExample);
Integer[] seq=new Integer[]{ proMemberRoleShows.stream().mapToInt(action->action.getSequence()).max().getAsInt()};
param.getParam().getRoleIds().forEach(action->{
ProMemberRoleShowExample proMemberRoleShowExample1=new ProMemberRoleShowExample();
proMemberRoleShowExample1.createCriteria().andRecStatusEqualTo((byte)0).andMemberIdEqualTo(memberId).andRoleIdEqualTo(action);
ProMemberRoleShow proMemberRoleShow=new ProMemberRoleShow();
proMemberRoleShow.setSequence(++seq[0]);
proMemberRoleShowMapper.updateByExampleSelective(proMemberRoleShow,proMemberRoleShowExample1);
});
}
/**
* 是否是pm
* @return
*/
public boolean queryIsPm(Long projectId,Long memberId){
ProRoleExample proRoleExample=new ProRoleExample();
proRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andNameEqualTo(WebConstant.ROLE_NAME.PM.value).andParentIdEqualTo(0L).andProjectIdEqualTo(projectId);
//一级角色项目经理
List<Long> jili=proRoleMapper.selectByExample(proRoleExample).stream().map(action->action.getId()).collect(Collectors.toList());
//二级角色项目经理
ProRoleExample proRoleExample1=new ProRoleExample();
proRoleExample1.createCriteria().andRecStatusEqualTo((byte)0).andParentIdIn(jili);
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1);
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList());
//目前考虑的是只有一个经理
ProMemberRoleExample proMemberRoleExample=new ProMemberRoleExample();
proMemberRoleExample.createCriteria().andRecStatusEqualTo((byte)0).andMemberIdEqualTo(memberId).andRoleIdEqualTo(jili1.get(0));
List<ProMemberRole> proMemberRoles = proMemberRoleMapper.selectByExample(proMemberRoleExample);
if(CollectionUtil.isEmpty(proMemberRoles)){
return false;
}
return true;
}
/**
* 查询成员id
* @return
*/
public Long queryMemberId(Long projectId,Long userId){
ProMemberExample proMemberExample=new ProMemberExample();
proMemberExample.createCriteria().andUserIdEqualTo(param.getUserId()).andProjectIdEqualTo(param.getParam().getProjectId()).andRecStatusEqualTo((byte)0);
proMemberExample.createCriteria().andUserIdEqualTo(userId).andProjectIdEqualTo(projectId).andRecStatusEqualTo((byte)0);
List<ProMember> proMembers = proMemberMapper.selectByExample(proMemberExample);
Long memberId=0L;
if(CollectionUtil.isNotEmpty(proMembers)&&proMembers.size()==1){
@ -656,13 +893,6 @@ public class ProRoleService implements IProRoleService {
}else {
throw new BaseException(CodeEnum.CHONGFU);
}
RoleVo.JueSeByProIdLists jueSeByProIdLists=new RoleVo.JueSeByProIdLists();
//查询已经添加的角色
List<RoleVo.JueSeByProId> listAfter=proRoleDao.queryRoleShowslistAfter(param.getParam().getProjectId());
List<Long> listBeforeId= listAfter.stream().map(action ->{
return action.getId();
}).collect(Collectors.toList());
List<RoleVo.JueSeByProId> listBefor=proRoleDao.queryRoleShowslistBefore(memberId,listBeforeId);
return null;
return memberId;
}
}

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

@ -2,11 +2,22 @@ package com.ccsens.tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.po.*;
import com.ccsens.tall.bean.vo.FileVo;
import com.ccsens.tall.bean.vo.PluginVo;
import com.ccsens.tall.persist.dao.*;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.PropUtil;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -16,6 +27,7 @@ import org.springframework.web.context.ContextLoaderListener;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
@ -34,19 +46,242 @@ public class SysPluginService implements ISysPluginService{
private SigninFieldDao signinFieldDao;
@Resource
private Snowflake snowflake;
@Resource
private ProPluginPreviewFileDao proPluginPreviewFileDao;
@Resource
private ProRoleService proRoleService;
@Resource
private ProRoleDao proRoleDao;
@Resource
private ProMemberDao proMemberDao;
@Resource
private ProMemberRoleDao proMemberRoleDao;
@Resource
private TaskSubTimeDao taskSubTimeDao;
/**
* 添加插件
* @param saveSysPlugin
* @param param
*/
@Override
public void saveSysPlugin(PluginDto.SaveSysPlugin saveSysPlugin) {
public void saveSysPlugin(PluginDto.SaveSysPlugin param,Long userId) {
SysPlugin sysPlugin = new SysPlugin();
sysPlugin.setId(snowflake.nextId());
sysPlugin.setName(saveSysPlugin.getName());
sysPlugin.setDescription(saveSysPlugin.getDescription());
sysPlugin.setShowType(saveSysPlugin.getShowType());
sysPlugin.setName(param.getName());
sysPlugin.setDescription(param.getDescription());
sysPlugin.setShowType(param.getShowType());
sysPlugin.setPluginIcon(param.getPluginIcon());
sysPlugin.setPluginAuthor(param.getPluginAuthor());
sysPlugin.setPluginClass(param.getPluginClass());
sysPluginDao.insertSelective(sysPlugin);
//预览表中添加数据
if (CollectionUtil.isNotEmpty(param.getPreviewImgs())){
param.getPreviewImgs().forEach(previewImg -> {
ProPluginPreviewFile previewFile = new ProPluginPreviewFile();
previewFile.setId(snowflake.nextId());
previewFile.setPluginId(sysPlugin.getId());
previewFile.setFileId(previewImg.getPreviewId());
previewFile.setPreviewDescription(previewImg.getPreviewDescription());
proPluginPreviewFileDao.insertSelective(previewFile);
});
}
}
/**
* 根据任务id查询插件列表(该任务已添加的)
* @param param
* @return
*/
@Override
public List<PluginVo.PluginByTaskAdded> findPluginOfAdded(PluginDto.FindPluginByTask param) {
List<PluginVo.PluginByTaskAdded> plugins = taskPluginDao.findPluginOfAdded(param.getTaskId(),param.getRoleId(),param.getPluginName(),param.getPluginType());
plugins.forEach(plugin -> {
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));
}
}
plugin.setPreviewImgs(filePositions);
}
}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);
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));
}
}
});
return plugins;
}
/**
* 根据任务id查询插件列表(该任务未添加的的)
* @param param
* @return
*/
@Override
public PageInfo<PluginVo.PluginByTaskAdded> findPluginOfNoAdded(PluginDto.FindPluginByTaskNo param) {
PageHelper.startPage(param.getPageNum(),param.getPageSize());
List<PluginVo.PluginByTaskAdded> plugins = taskPluginDao.findPluginOfNoAdded(param.getTaskId(),param.getRoleId(),param.getPluginName(),param.getPluginType());
plugins.forEach(plugin -> {
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));
}
}
plugin.setPreviewImgs(filePositions);
}
}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);
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));
}
}
});
return new PageInfo<>(plugins);
}
/**
* 给任务添加插件
*/
@Override
public void addPluginForTask(PluginDto.AddPluginForTask param,Long currentUserId) {
//查找分解任务,通过分级任务找到任务详情
ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId());
if (ObjectUtil.isNull(proTaskSubTime)){
throw new BaseException("获取任务信息错误");
}
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(proTaskSubTime.getTaskDetailId());
if (ObjectUtil.isNull(taskDetail)){
throw new BaseException("获取任务信息错误");
}
//查找权限
int power = proRoleService.selectPowerByRoleName(currentUserId, taskDetail.getProjectId());
//当前用户是否是此任务的负责人
boolean flag = false;
ProRole executorRole = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole());
if (executorRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)) {
flag = true;
} else {
ProMemberExample memberExample = new ProMemberExample();
memberExample.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(taskDetail.getProjectId());
List<ProMember> memberList = proMemberDao.selectByExample(memberExample);
if (CollectionUtil.isNotEmpty(memberList)) {
if (ObjectUtil.isNotNull(executorRole)) {
ProMemberRoleExample memberRoleExample = new ProMemberRoleExample();
memberRoleExample.createCriteria().andRoleIdEqualTo(executorRole.getId()).andMemberIdEqualTo(memberList.get(0).getId());
if (proMemberRoleDao.countByExample(memberRoleExample) != 0) {
flag = true;
}
}
}
}
//给任务添加插件
if (1 < power || flag){
ProTaskPlugin taskPlugin = new ProTaskPlugin();
taskPlugin.setId(snowflake.nextId());
taskPlugin.setPluginId(param.getPluginId());
taskPlugin.setTaskDetailId(taskDetail.getId());
taskPlugin.setMemberRoleId(param.getRoleId());
taskPluginDao.insertSelective(taskPlugin);
}else {
throw new BaseException("权限不足");
}
}
/**
* 给任务删除插件
* @param param
* @param currentUserId
*/
@Override
public void deletePluginForTask(PluginDto.DeletePluginForTask param, Long currentUserId) {
//查找分解任务,通过分级任务找到任务详情
ProTaskSubTime proTaskSubTime = taskSubTimeDao.selectByPrimaryKey(param.getTaskId());
if (ObjectUtil.isNull(proTaskSubTime)){
throw new BaseException("获取任务信息错误");
}
ProTaskDetail taskDetail = taskDetailDao.selectByPrimaryKey(proTaskSubTime.getTaskDetailId());
if (ObjectUtil.isNull(taskDetail)){
throw new BaseException("获取任务信息错误");
}
//查找权限
int power = proRoleService.selectPowerByRoleName(currentUserId, taskDetail.getProjectId());
//当前用户是否是此任务的负责人
boolean flag = false;
ProRole executorRole = proRoleDao.selectByPrimaryKey(taskDetail.getExecutorRole());
if (executorRole.getName().equalsIgnoreCase(WebConstant.ROLE_NAME.AllMember.phase)) {
flag = true;
} else {
ProMemberExample memberExample = new ProMemberExample();
memberExample.createCriteria().andUserIdEqualTo(currentUserId).andProjectIdEqualTo(taskDetail.getProjectId());
List<ProMember> memberList = proMemberDao.selectByExample(memberExample);
if (CollectionUtil.isNotEmpty(memberList)) {
if (ObjectUtil.isNotNull(executorRole)) {
ProMemberRoleExample memberRoleExample = new ProMemberRoleExample();
memberRoleExample.createCriteria().andRoleIdEqualTo(executorRole.getId()).andMemberIdEqualTo(memberList.get(0).getId());
if (proMemberRoleDao.countByExample(memberRoleExample) != 0) {
flag = true;
}
}
}
}
//给任务删除插件
if (1 < power || flag){
ProTaskPluginExample taskPluginExample = new ProTaskPluginExample();
taskPluginExample.createCriteria().andPluginIdEqualTo(param.getPluginId())
.andTaskDetailIdEqualTo(taskDetail.getId())
.andMemberRoleIdNotEqualTo(param.getRoleId());
taskPluginDao.deleteByExample(taskPluginExample);
}else {
throw new BaseException("权限不足");
}
}
@Override
@ -55,6 +290,7 @@ public class SysPluginService implements ISysPluginService{
return pluginInfoList;
}
/**
* 透过插件id查询签到的信息
*/
@ -135,4 +371,6 @@ public class SysPluginService implements ISysPluginService{
}
return taskDetailId;
}
}

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

@ -83,6 +83,7 @@ public class TaskDeliverService implements ITaskDeliverService {
public void saveProTaskInputDoc(String[] inputs,Long taskId){
for (int i = 0; i < inputs.length; i++) {
if(StringUtils.isNotBlank(inputs[i])){
inputs[i]=inputs[i].replace("\r","").replace("\n","");
ProTaskInputDoc proTaskInputDoc = new ProTaskInputDoc();
proTaskInputDoc.setId(snowflake.nextId());
proTaskInputDoc.setTaskDetailId(taskId);

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

@ -362,6 +362,7 @@ public class TaskSubTimeService implements ITaskSubTimeService {
detail.setCycle(addTask.getCycle());
detail.setParentId(addTask.getParentTaskId());
detail.setExecutorRole(addTask.getExecutorId());
detail.setMilestone(addTask.getMilestone());
//添加任务优先级
if(ObjectUtil.isNotNull(addTask.getPriority())){
detail.setPriority(addTask.getPriority());

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

@ -30,9 +30,11 @@ import java.util.List;
@RestController
@RequestMapping("/inputDoc")
public class InputDocController {
@Autowired
private IInputDocService iInputDocService;
@MustLogin
/*@MustLogin
@ApiOperation(value = "添加输入文档", notes = "1007:添加输入文档")
@RequestMapping(value = "/addInputDoc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse addInputDoc(@ApiParam @Validated @RequestBody QueryDto<InputDocDto.AddAddInputDoc> params) {
@ -40,7 +42,7 @@ public class InputDocController {
//iInputDocService.addInputDoc(params.getParam(),params.getUserId());
log.info("添加输入文档");
return JsonResponse.newInstance().ok();
}
}*/
@MustLogin
@ApiOperation(value = "通过任务id查询输入文档", notes = "1007:通过任务id查询输入文档")

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

@ -1,5 +1,6 @@
package com.ccsens.tall.web;
import com.ccsens.tall.annotation.MustLoginTall;
import com.ccsens.tall.bean.dto.PluginDto;
import com.ccsens.tall.bean.dto.TaskDto;
import com.ccsens.tall.bean.dto.WeekMeetingDto;
@ -11,6 +12,7 @@ import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
@ -30,13 +32,56 @@ public class PluginController {
@Autowired
private ISysPluginService sysPluginService;
@ApiOperation(value = "添加插件", notes = "")
@MustLoginTall
@ApiOperation(value = "添加插件(插件总表)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveSysPlugin(HttpServletRequest request, @ApiParam @Validated @RequestBody PluginDto.SaveSysPlugin saveSysPlugin) throws Exception {
log.info("添加一个插件:{}",saveSysPlugin);
sysPluginService.saveSysPlugin(saveSysPlugin);
public JsonResponse saveSysPlugin(@ApiParam @Validated @RequestBody QueryDto<PluginDto.SaveSysPlugin> params) throws Exception {
log.info("添加一个插件:{}",params);
sysPluginService.saveSysPlugin(params.getParam(),params.getUserId());
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "根据任务id查询插件列表(该任务已添加的)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/findPluginOfAdded", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<PluginVo.PluginByTaskAdded>> findPluginOfAdded(@ApiParam @Validated @RequestBody QueryDto<PluginDto.FindPluginByTask> params) throws Exception {
log.info("根据任务id查询已添加插件列表:{}",params);
List<PluginVo.PluginByTaskAdded> pluginByTaskAddedList = sysPluginService.findPluginOfAdded(params.getParam());
return JsonResponse.newInstance().ok(pluginByTaskAddedList);
}
@ApiOperation(value = "根据任务id查询插件列表(该任务未添加的的)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/findPluginOfNoAdded", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<PluginVo.PluginByTaskAdded>> findPluginOfNoAdded(@ApiParam @Validated @RequestBody QueryDto<PluginDto.FindPluginByTaskNo> params) throws Exception {
log.info("根据任务id查询未添加插件列表:{}",params);
PageInfo<PluginVo.PluginByTaskAdded> pluginByTaskNoAddedList = sysPluginService.findPluginOfNoAdded(params.getParam());
return JsonResponse.newInstance().ok(pluginByTaskNoAddedList);
}
@MustLoginTall
@ApiOperation(value = "给任务添加插件", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/addPluginForTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse addPluginForTask(@ApiParam @Validated @RequestBody QueryDto<PluginDto.AddPluginForTask> params) throws Exception {
log.info("给任务添加插件:{}",params);
sysPluginService.addPluginForTask(params.getParam(),params.getUserId());
return JsonResponse.newInstance().ok();
}
@MustLoginTall
@ApiOperation(value = "给任务删除插件", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/deletePluginForTask", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse deletePluginForTask(@ApiParam @Validated @RequestBody QueryDto<PluginDto.DeletePluginForTask> params) throws Exception {
log.info("给任务删除插件:{}",params);
sysPluginService.deletePluginForTask(params.getParam(),params.getUserId());
return JsonResponse.newInstance().ok();
}

16
tall/src/main/java/com/ccsens/tall/web/RoleController.java

@ -128,4 +128,20 @@ public class RoleController {
RoleVo.JueSeByProIdLists jueSeByProIdLists=proRoleService.queryRoleShows(param);
return JsonResponse.newInstance().ok(jueSeByProIdLists);
}
@MustLoginTall
@ApiOperation(value = "修改角色是否展示",notes = "")
@RequestMapping(value = "/queryRoleIsShows", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse queryRoleIsShows(@ApiParam @Validated @RequestBody QueryDto<RoleDto.QueryRoleIsShows> param){
log.info("传入参数:{}", param);
proRoleService.queryRoleIsShows(param);
return JsonResponse.newInstance().ok();
}
@MustLoginTall
@ApiOperation(value = "给角色排序",notes = "")
@RequestMapping(value = "/upRoleShowsOrder", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse upRoleShowsOrder(@ApiParam @Validated @RequestBody QueryDto<RoleDto.UpRoleShowsOrder> param){
log.info("传入参数:{}", param);
proRoleService.upRoleShowsOrder(param);
return JsonResponse.newInstance().ok();
}
}

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

@ -46,4 +46,4 @@ 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/file/query
filedeal: https://www.tall.wiki/filedeal/file/query

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

@ -46,7 +46,7 @@ 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/file/query
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

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

@ -311,14 +311,25 @@
<select id="queryRoleShowslistAfter" resultType="com.ccsens.tall.bean.vo.RoleVo$JueSeByProId">
select tpr.id,tpr.name,tpmrs.sequence
from t_pro_member_role_show tpmrs
left join t_pro_role tpr on tpr.rec_status=0 and tpr.id=tpmrs=role_id
left join t_pro_role tpr on tpr.rec_status=0 and tpr.id=tpmrs.role_id
where
tpmrs.rec_status=0
and tpmrs.member_id=#{projectId}
and tpmrs.member_id=#{memberId}
order by tpmrs.sequence
</select>
<select id="queryRoleShowslistBefore" resultType="com.ccsens.tall.bean.vo.RoleVo$JueSeByProId">
select id,name,sequence
from t_pro_role tpr
where tpr.rec_status=0
and tpr.project_id=#{param1}
and tpr.parent_id !=0
<if test="param2!=null and param2.size>0">
and tpr.id not in
<foreach collection="param2" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</if>
order by tpr.sequence
</select>
</mapper>

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

@ -529,6 +529,7 @@
t.cycle as cycle,
t.money as money,
t.project_id as projectId,
t.milestone,
(SELECT `name` FROM t_sys_project WHERE id = t.project_id) as projectName,
t.executor_role as executorRole,
(SELECT `name` FROM t_pro_role WHERE id = t.executor_role) as executorRoleName,

68
tall/src/main/resources/mapper_dao/TaskPluginDao.xml

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.dao.TaskPluginDao">
<select id="findPluginOfAdded" resultType="com.ccsens.tall.bean.vo.PluginVo$PluginByTaskAdded">
SELECT
sp.id AS pluginId,
sp.`name` AS pluginName,
sp.plugin_icon AS pluginIcon,
tf.visit_location AS iconUrl,
sp.description AS description,
sp.plugin_author AS pluginAuthor,
ptp.task_detail_id,
ptp.member_role_id,
CONCAT_WS(',',GROUP_CONCAT(DISTINCT sp.plugin_icon),GROUP_CONCAT(DISTINCT pppf.file_id)) AS fileIdList
FROM
t_pro_task_plugin AS ptp
LEFT JOIN t_sys_plugin AS sp ON ptp.plugin_id = sp.id AND sp.rec_status = 0
LEFT JOIN t_file AS tf ON sp.plugin_icon = tf.id AND tf.rec_status = 0
LEFT JOIN t_pro_plugin_preview_file AS pppf ON sp.id = pppf.plugin_id AND pppf.rec_status = 0
AND sp.rec_status = 0
WHERE
ptp.rec_status = 0
AND ptp.task_detail_id = #{taskId}
AND ptp.member_role_id = #{roleId}
<if test="pluginName!=null and pluginName!=''" >
AND sp.description LIKE concat('%',#{pluginName},'%')
</if>
<if test="pluginType!=null and pluginType!=''" >
AND sp.plugin_class = #{pluginType}
</if>
Group by ptp.plugin_id
</select>
<select id="findPluginOfNoAdded" resultType="com.ccsens.tall.bean.vo.PluginVo$PluginByTaskAdded">
SELECT
sp.id AS pluginId,
sp.`name` AS pluginName,
sp.plugin_icon AS pluginIcon,
tf.visit_location AS iconUrl,
sp.description AS description,
sp.plugin_author AS pluginAuthor,
CONCAT_WS(',',GROUP_CONCAT(DISTINCT sp.plugin_icon),GROUP_CONCAT(DISTINCT pppf.file_id)) AS fileIdList
FROM
t_sys_plugin AS sp
LEFT JOIN t_file AS tf ON sp.plugin_icon = tf.id
LEFT JOIN t_pro_plugin_preview_file AS pppf ON sp.id = pppf.plugin_id AND pppf.rec_status = 0
WHERE
sp.id NOT IN (
SELECT
ptp.plugin_id
FROM
t_pro_task_plugin AS ptp
WHERE
ptp.task_detail_id = #{taskId}
AND ptp.member_role_id = #{roleId}
AND ptp.rec_status = 0
)
<if test="pluginName!=null and pluginName!=''" >
AND sp.description LIKE concat('%',#{pluginName},'%')
</if>
<if test="pluginType!=null and pluginType!=''" >
AND sp.plugin_class = #{pluginType}
</if>
Group By sp.id
</select>
</mapper>

243
tall/src/main/resources/mapper_raw/ProPluginPreviewFileMapper.xml

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.mapper.ProPluginPreviewFileMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProPluginPreviewFile">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="plugin_id" jdbcType="BIGINT" property="pluginId" />
<result column="file_id" jdbcType="BIGINT" property="fileId" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="preview_description" jdbcType="VARCHAR" property="previewDescription" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, plugin_id, file_id, created_at, updated_at, rec_status, preview_description
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFileExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_pro_plugin_preview_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_pro_plugin_preview_file
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_pro_plugin_preview_file
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFileExample">
delete from t_pro_plugin_preview_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFile">
insert into t_pro_plugin_preview_file (id, plugin_id, file_id,
created_at, updated_at, rec_status,
preview_description)
values (#{id,jdbcType=BIGINT}, #{pluginId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{previewDescription,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFile">
insert into t_pro_plugin_preview_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="pluginId != null">
plugin_id,
</if>
<if test="fileId != null">
file_id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
<if test="previewDescription != null">
preview_description,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="pluginId != null">
#{pluginId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
#{fileId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="previewDescription != null">
#{previewDescription,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFileExample" resultType="java.lang.Long">
select count(*) from t_pro_plugin_preview_file
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_pro_plugin_preview_file
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.pluginId != null">
plugin_id = #{record.pluginId,jdbcType=BIGINT},
</if>
<if test="record.fileId != null">
file_id = #{record.fileId,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.previewDescription != null">
preview_description = #{record.previewDescription,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_pro_plugin_preview_file
set id = #{record.id,jdbcType=BIGINT},
plugin_id = #{record.pluginId,jdbcType=BIGINT},
file_id = #{record.fileId,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
preview_description = #{record.previewDescription,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFile">
update t_pro_plugin_preview_file
<set>
<if test="pluginId != null">
plugin_id = #{pluginId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
file_id = #{fileId,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="previewDescription != null">
preview_description = #{previewDescription,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProPluginPreviewFile">
update t_pro_plugin_preview_file
set plugin_id = #{pluginId,jdbcType=BIGINT},
file_id = #{fileId,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
preview_description = #{previewDescription,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

14
tall/src/main/resources/mapper_raw/ProTaskDetailMapper.xml

@ -29,7 +29,7 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="priority" jdbcType="TINYINT" property="priority" />
<result column="milestone" jdbcType="TINYINT" property="milestone" />
<result column="milestone" jdbcType="VARCHAR" property="milestone" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -145,7 +145,7 @@
#{virtual,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{hasGroup,jdbcType=TINYINT},
#{finishNeedAll,jdbcType=TINYINT}, #{allMember,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{priority,jdbcType=TINYINT},
#{milestone,jdbcType=TINYINT})
#{milestone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProTaskDetail">
insert into t_pro_task_detail
@ -318,7 +318,7 @@
#{priority,jdbcType=TINYINT},
</if>
<if test="milestone != null">
#{milestone,jdbcType=TINYINT},
#{milestone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@ -413,7 +413,7 @@
priority = #{record.priority,jdbcType=TINYINT},
</if>
<if test="record.milestone != null">
milestone = #{record.milestone,jdbcType=TINYINT},
milestone = #{record.milestone,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@ -449,7 +449,7 @@
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
priority = #{record.priority,jdbcType=TINYINT},
milestone = #{record.milestone,jdbcType=TINYINT}
milestone = #{record.milestone,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -536,7 +536,7 @@
priority = #{priority,jdbcType=TINYINT},
</if>
<if test="milestone != null">
milestone = #{milestone,jdbcType=TINYINT},
milestone = #{milestone,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -569,7 +569,7 @@
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
priority = #{priority,jdbcType=TINYINT},
milestone = #{milestone,jdbcType=TINYINT}
milestone = #{milestone,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

575
tall/src/main/resources/mapper_raw/ProTasketailMapper.xml

@ -0,0 +1,575 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tall.persist.mapper.ProTasketailMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tall.bean.po.ProTasketail">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="begin_time" jdbcType="BIGINT" property="beginTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="cycle" jdbcType="VARCHAR" property="cycle" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="sub_task" jdbcType="VARCHAR" property="subTask" />
<result column="sub_project_id" jdbcType="BIGINT" property="subProjectId" />
<result column="sub_project" jdbcType="VARCHAR" property="subProject" />
<result column="executor_role" jdbcType="BIGINT" property="executorRole" />
<result column="checker_role" jdbcType="BIGINT" property="checkerRole" />
<result column="money" jdbcType="BIGINT" property="money" />
<result column="delay" jdbcType="TINYINT" property="delay" />
<result column="delay_time" jdbcType="BIGINT" property="delayTime" />
<result column="loop_to" jdbcType="BIGINT" property="loopTo" />
<result column="loop_times" jdbcType="INTEGER" property="loopTimes" />
<result column="virtual" jdbcType="TINYINT" property="virtual" />
<result column="level" jdbcType="TINYINT" property="level" />
<result column="has_group" jdbcType="TINYINT" property="hasGroup" />
<result column="finish_need_all" jdbcType="TINYINT" property="finishNeedAll" />
<result column="all_member" jdbcType="TINYINT" property="allMember" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="priority" jdbcType="TINYINT" property="priority" />
<result column="milestone" jdbcType="VARCHAR" property="milestone" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, project_id, name, description, begin_time, end_time, cycle, parent_id, sub_task,
sub_project_id, sub_project, executor_role, checker_role, money, delay, delay_time,
loop_to, loop_times, virtual, level, has_group, finish_need_all, all_member, created_at,
updated_at, rec_status, priority, milestone
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.ProTasketailExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_pro_task_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_pro_task_detail
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_pro_task_detail
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tall.bean.po.ProTasketailExample">
delete from t_pro_task_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.ProTasketail">
insert into t_pro_task_detail (id, project_id, name,
description, begin_time, end_time,
cycle, parent_id, sub_task,
sub_project_id, sub_project, executor_role,
checker_role, money, delay,
delay_time, loop_to, loop_times,
virtual, level, has_group,
finish_need_all, all_member, created_at,
updated_at, rec_status, priority,
milestone)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{beginTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
#{cycle,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, #{subTask,jdbcType=VARCHAR},
#{subProjectId,jdbcType=BIGINT}, #{subProject,jdbcType=VARCHAR}, #{executorRole,jdbcType=BIGINT},
#{checkerRole,jdbcType=BIGINT}, #{money,jdbcType=BIGINT}, #{delay,jdbcType=TINYINT},
#{delayTime,jdbcType=BIGINT}, #{loopTo,jdbcType=BIGINT}, #{loopTimes,jdbcType=INTEGER},
#{virtual,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{hasGroup,jdbcType=TINYINT},
#{finishNeedAll,jdbcType=TINYINT}, #{allMember,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{priority,jdbcType=TINYINT},
#{milestone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.ProTasketail">
insert into t_pro_task_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="projectId != null">
project_id,
</if>
<if test="name != null">
name,
</if>
<if test="description != null">
description,
</if>
<if test="beginTime != null">
begin_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="cycle != null">
cycle,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="subTask != null">
sub_task,
</if>
<if test="subProjectId != null">
sub_project_id,
</if>
<if test="subProject != null">
sub_project,
</if>
<if test="executorRole != null">
executor_role,
</if>
<if test="checkerRole != null">
checker_role,
</if>
<if test="money != null">
money,
</if>
<if test="delay != null">
delay,
</if>
<if test="delayTime != null">
delay_time,
</if>
<if test="loopTo != null">
loop_to,
</if>
<if test="loopTimes != null">
loop_times,
</if>
<if test="virtual != null">
virtual,
</if>
<if test="level != null">
level,
</if>
<if test="hasGroup != null">
has_group,
</if>
<if test="finishNeedAll != null">
finish_need_all,
</if>
<if test="allMember != null">
all_member,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
<if test="priority != null">
priority,
</if>
<if test="milestone != null">
milestone,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="beginTime != null">
#{beginTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
#{endTime,jdbcType=BIGINT},
</if>
<if test="cycle != null">
#{cycle,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
<if test="subTask != null">
#{subTask,jdbcType=VARCHAR},
</if>
<if test="subProjectId != null">
#{subProjectId,jdbcType=BIGINT},
</if>
<if test="subProject != null">
#{subProject,jdbcType=VARCHAR},
</if>
<if test="executorRole != null">
#{executorRole,jdbcType=BIGINT},
</if>
<if test="checkerRole != null">
#{checkerRole,jdbcType=BIGINT},
</if>
<if test="money != null">
#{money,jdbcType=BIGINT},
</if>
<if test="delay != null">
#{delay,jdbcType=TINYINT},
</if>
<if test="delayTime != null">
#{delayTime,jdbcType=BIGINT},
</if>
<if test="loopTo != null">
#{loopTo,jdbcType=BIGINT},
</if>
<if test="loopTimes != null">
#{loopTimes,jdbcType=INTEGER},
</if>
<if test="virtual != null">
#{virtual,jdbcType=TINYINT},
</if>
<if test="level != null">
#{level,jdbcType=TINYINT},
</if>
<if test="hasGroup != null">
#{hasGroup,jdbcType=TINYINT},
</if>
<if test="finishNeedAll != null">
#{finishNeedAll,jdbcType=TINYINT},
</if>
<if test="allMember != null">
#{allMember,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="priority != null">
#{priority,jdbcType=TINYINT},
</if>
<if test="milestone != null">
#{milestone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tall.bean.po.ProTasketailExample" resultType="java.lang.Long">
select count(*) from t_pro_task_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_pro_task_detail
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.projectId != null">
project_id = #{record.projectId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.beginTime != null">
begin_time = #{record.beginTime,jdbcType=BIGINT},
</if>
<if test="record.endTime != null">
end_time = #{record.endTime,jdbcType=BIGINT},
</if>
<if test="record.cycle != null">
cycle = #{record.cycle,jdbcType=VARCHAR},
</if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=BIGINT},
</if>
<if test="record.subTask != null">
sub_task = #{record.subTask,jdbcType=VARCHAR},
</if>
<if test="record.subProjectId != null">
sub_project_id = #{record.subProjectId,jdbcType=BIGINT},
</if>
<if test="record.subProject != null">
sub_project = #{record.subProject,jdbcType=VARCHAR},
</if>
<if test="record.executorRole != null">
executor_role = #{record.executorRole,jdbcType=BIGINT},
</if>
<if test="record.checkerRole != null">
checker_role = #{record.checkerRole,jdbcType=BIGINT},
</if>
<if test="record.money != null">
money = #{record.money,jdbcType=BIGINT},
</if>
<if test="record.delay != null">
delay = #{record.delay,jdbcType=TINYINT},
</if>
<if test="record.delayTime != null">
delay_time = #{record.delayTime,jdbcType=BIGINT},
</if>
<if test="record.loopTo != null">
loop_to = #{record.loopTo,jdbcType=BIGINT},
</if>
<if test="record.loopTimes != null">
loop_times = #{record.loopTimes,jdbcType=INTEGER},
</if>
<if test="record.virtual != null">
virtual = #{record.virtual,jdbcType=TINYINT},
</if>
<if test="record.level != null">
level = #{record.level,jdbcType=TINYINT},
</if>
<if test="record.hasGroup != null">
has_group = #{record.hasGroup,jdbcType=TINYINT},
</if>
<if test="record.finishNeedAll != null">
finish_need_all = #{record.finishNeedAll,jdbcType=TINYINT},
</if>
<if test="record.allMember != null">
all_member = #{record.allMember,jdbcType=TINYINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.priority != null">
priority = #{record.priority,jdbcType=TINYINT},
</if>
<if test="record.milestone != null">
milestone = #{record.milestone,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_pro_task_detail
set id = #{record.id,jdbcType=BIGINT},
project_id = #{record.projectId,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
begin_time = #{record.beginTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
cycle = #{record.cycle,jdbcType=VARCHAR},
parent_id = #{record.parentId,jdbcType=BIGINT},
sub_task = #{record.subTask,jdbcType=VARCHAR},
sub_project_id = #{record.subProjectId,jdbcType=BIGINT},
sub_project = #{record.subProject,jdbcType=VARCHAR},
executor_role = #{record.executorRole,jdbcType=BIGINT},
checker_role = #{record.checkerRole,jdbcType=BIGINT},
money = #{record.money,jdbcType=BIGINT},
delay = #{record.delay,jdbcType=TINYINT},
delay_time = #{record.delayTime,jdbcType=BIGINT},
loop_to = #{record.loopTo,jdbcType=BIGINT},
loop_times = #{record.loopTimes,jdbcType=INTEGER},
virtual = #{record.virtual,jdbcType=TINYINT},
level = #{record.level,jdbcType=TINYINT},
has_group = #{record.hasGroup,jdbcType=TINYINT},
finish_need_all = #{record.finishNeedAll,jdbcType=TINYINT},
all_member = #{record.allMember,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
priority = #{record.priority,jdbcType=TINYINT},
milestone = #{record.milestone,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tall.bean.po.ProTasketail">
update t_pro_task_detail
<set>
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="beginTime != null">
begin_time = #{beginTime,jdbcType=BIGINT},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=BIGINT},
</if>
<if test="cycle != null">
cycle = #{cycle,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
<if test="subTask != null">
sub_task = #{subTask,jdbcType=VARCHAR},
</if>
<if test="subProjectId != null">
sub_project_id = #{subProjectId,jdbcType=BIGINT},
</if>
<if test="subProject != null">
sub_project = #{subProject,jdbcType=VARCHAR},
</if>
<if test="executorRole != null">
executor_role = #{executorRole,jdbcType=BIGINT},
</if>
<if test="checkerRole != null">
checker_role = #{checkerRole,jdbcType=BIGINT},
</if>
<if test="money != null">
money = #{money,jdbcType=BIGINT},
</if>
<if test="delay != null">
delay = #{delay,jdbcType=TINYINT},
</if>
<if test="delayTime != null">
delay_time = #{delayTime,jdbcType=BIGINT},
</if>
<if test="loopTo != null">
loop_to = #{loopTo,jdbcType=BIGINT},
</if>
<if test="loopTimes != null">
loop_times = #{loopTimes,jdbcType=INTEGER},
</if>
<if test="virtual != null">
virtual = #{virtual,jdbcType=TINYINT},
</if>
<if test="level != null">
level = #{level,jdbcType=TINYINT},
</if>
<if test="hasGroup != null">
has_group = #{hasGroup,jdbcType=TINYINT},
</if>
<if test="finishNeedAll != null">
finish_need_all = #{finishNeedAll,jdbcType=TINYINT},
</if>
<if test="allMember != null">
all_member = #{allMember,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="priority != null">
priority = #{priority,jdbcType=TINYINT},
</if>
<if test="milestone != null">
milestone = #{milestone,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tall.bean.po.ProTasketail">
update t_pro_task_detail
set project_id = #{projectId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
begin_time = #{beginTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
cycle = #{cycle,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=BIGINT},
sub_task = #{subTask,jdbcType=VARCHAR},
sub_project_id = #{subProjectId,jdbcType=BIGINT},
sub_project = #{subProject,jdbcType=VARCHAR},
executor_role = #{executorRole,jdbcType=BIGINT},
checker_role = #{checkerRole,jdbcType=BIGINT},
money = #{money,jdbcType=BIGINT},
delay = #{delay,jdbcType=TINYINT},
delay_time = #{delayTime,jdbcType=BIGINT},
loop_to = #{loopTo,jdbcType=BIGINT},
loop_times = #{loopTimes,jdbcType=INTEGER},
virtual = #{virtual,jdbcType=TINYINT},
level = #{level,jdbcType=TINYINT},
has_group = #{hasGroup,jdbcType=TINYINT},
finish_need_all = #{finishNeedAll,jdbcType=TINYINT},
all_member = #{allMember,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
priority = #{priority,jdbcType=TINYINT},
milestone = #{milestone,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

80
tall/src/main/resources/mapper_raw/SysPluginMapper.xml

@ -6,10 +6,13 @@
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="scene" jdbcType="TINYINT" property="scene" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="show_type" jdbcType="TINYINT" property="showType" />
<result column="plugin_icon" jdbcType="BIGINT" property="pluginIcon" />
<result column="plugin_author" jdbcType="BIGINT" property="pluginAuthor" />
<result column="plugin_class" jdbcType="TINYINT" property="pluginClass" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -70,7 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, description, scene, created_at, updated_at, rec_status, show_type
id, name, description, scene, show_type, created_at, updated_at, rec_status, plugin_icon,
plugin_author, plugin_class
</sql>
<select id="selectByExample" parameterType="com.ccsens.tall.bean.po.SysPluginExample" resultMap="BaseResultMap">
select
@ -104,11 +108,13 @@
</delete>
<insert id="insert" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin (id, name, description,
scene, created_at, updated_at,
rec_status, show_type)
scene, show_type, created_at,
updated_at, rec_status, plugin_icon,
plugin_author, plugin_class)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{scene,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT}, #{showType,jdbcType=TINYINT})
#{scene,jdbcType=TINYINT}, #{showType,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{pluginIcon,jdbcType=BIGINT},
#{pluginAuthor,jdbcType=BIGINT}, #{pluginClass,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tall.bean.po.SysPlugin">
insert into t_sys_plugin
@ -125,6 +131,9 @@
<if test="scene != null">
scene,
</if>
<if test="showType != null">
show_type,
</if>
<if test="createdAt != null">
created_at,
</if>
@ -134,8 +143,14 @@
<if test="recStatus != null">
rec_status,
</if>
<if test="showType != null">
show_type,
<if test="pluginIcon != null">
plugin_icon,
</if>
<if test="pluginAuthor != null">
plugin_author,
</if>
<if test="pluginClass != null">
plugin_class,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -151,6 +166,9 @@
<if test="scene != null">
#{scene,jdbcType=TINYINT},
</if>
<if test="showType != null">
#{showType,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
@ -160,8 +178,14 @@
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="showType != null">
#{showType,jdbcType=TINYINT},
<if test="pluginIcon != null">
#{pluginIcon,jdbcType=BIGINT},
</if>
<if test="pluginAuthor != null">
#{pluginAuthor,jdbcType=BIGINT},
</if>
<if test="pluginClass != null">
#{pluginClass,jdbcType=TINYINT},
</if>
</trim>
</insert>
@ -186,6 +210,9 @@
<if test="record.scene != null">
scene = #{record.scene,jdbcType=TINYINT},
</if>
<if test="record.showType != null">
show_type = #{record.showType,jdbcType=TINYINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
@ -195,8 +222,14 @@
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.showType != null">
show_type = #{record.showType,jdbcType=TINYINT},
<if test="record.pluginIcon != null">
plugin_icon = #{record.pluginIcon,jdbcType=BIGINT},
</if>
<if test="record.pluginAuthor != null">
plugin_author = #{record.pluginAuthor,jdbcType=BIGINT},
</if>
<if test="record.pluginClass != null">
plugin_class = #{record.pluginClass,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
@ -209,10 +242,13 @@
name = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
scene = #{record.scene,jdbcType=TINYINT},
show_type = #{record.showType,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
show_type = #{record.showType,jdbcType=TINYINT}
plugin_icon = #{record.pluginIcon,jdbcType=BIGINT},
plugin_author = #{record.pluginAuthor,jdbcType=BIGINT},
plugin_class = #{record.pluginClass,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -229,6 +265,9 @@
<if test="scene != null">
scene = #{scene,jdbcType=TINYINT},
</if>
<if test="showType != null">
show_type = #{showType,jdbcType=TINYINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
@ -238,8 +277,14 @@
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="showType != null">
show_type = #{showType,jdbcType=TINYINT},
<if test="pluginIcon != null">
plugin_icon = #{pluginIcon,jdbcType=BIGINT},
</if>
<if test="pluginAuthor != null">
plugin_author = #{pluginAuthor,jdbcType=BIGINT},
</if>
<if test="pluginClass != null">
plugin_class = #{pluginClass,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -249,10 +294,13 @@
set name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
scene = #{scene,jdbcType=TINYINT},
show_type = #{showType,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
show_type = #{showType,jdbcType=TINYINT}
plugin_icon = #{pluginIcon,jdbcType=BIGINT},
plugin_author = #{pluginAuthor,jdbcType=BIGINT},
plugin_class = #{pluginClass,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

52
tcm/src/main/java/com/ccsens/tcm/api/OcrController.java

@ -0,0 +1,52 @@
package com.ccsens.tcm.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.tcm.bean.dto.QuestionOcrDto;
import com.ccsens.tcm.bean.vo.InpatientVo;
import com.ccsens.tcm.bean.vo.QuestionOcrVo;
import com.ccsens.tcm.service.IOcrService;
import com.ccsens.tcm.uitl.Constant;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.baidu.BaiDuDto;
import com.ccsens.util.baidu.BaiDuUtil;
import com.ccsens.util.baidu.BaiDuVo;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @description: 图片识别文字
* @author: whj
* @time: 2021/3/31 18:03
*/
@Slf4j
@Api(tags = "图片识别文字")
@RestController
@RequestMapping("/ocr")
public class OcrController {
@Resource
private IOcrService ocrService;
@MustLogin
@ApiOperation(value = "图片文字识别",notes = "")
@RequestMapping(value="/general/basic",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<QuestionOcrVo.GeneralBasic>> queryInpatient(@ApiParam @Validated @RequestBody QueryDto<QuestionOcrDto.GeneralBasic> params) throws Exception {
//
log.info("图片文字识别请求:{}", params);
List<QuestionOcrVo.GeneralBasic> words = ocrService.identifyWords(params.getParam(), params.getUserId());
log.info("图片文字识别结束:{}", words);
return JsonResponse.newInstance().ok(words);
}
}

27
tcm/src/main/java/com/ccsens/tcm/bean/dto/QuestionOcrDto.java

@ -0,0 +1,27 @@
package com.ccsens.tcm.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @description: 通用文字识别
* @author: whj
* @time: 2021/4/1 10:31
*/
public class QuestionOcrDto {
@ApiModel("报告单图片文字通用识别-请求")
@Data
public static class GeneralBasic{
@ApiModelProperty("医院ID")
private Long hospitalId;
@ApiModelProperty("报告单类型")
@NotBlank
private String code;
@ApiModelProperty("图片路径")
private String url;
}
}

139
tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionOcr.java

@ -0,0 +1,139 @@
package com.ccsens.tcm.bean.po;
import java.io.Serializable;
import java.util.Date;
public class QuestionOcr implements Serializable {
private Long id;
private String code;
private Integer sort;
private Long hospital;
private String start;
private String end;
private String remark;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Long getHospital() {
return hospital;
}
public void setHospital(Long hospital) {
this.hospital = hospital;
}
public String getStart() {
return start;
}
public void setStart(String start) {
this.start = start == null ? null : start.trim();
}
public String getEnd() {
return end;
}
public void setEnd(String end) {
this.end = end == null ? null : end.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", code=").append(code);
sb.append(", sort=").append(sort);
sb.append(", hospital=").append(hospital);
sb.append(", start=").append(start);
sb.append(", end=").append(end);
sb.append(", remark=").append(remark);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

901
tcm/src/main/java/com/ccsens/tcm/bean/po/QuestionOcrExample.java

@ -0,0 +1,901 @@
package com.ccsens.tcm.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class QuestionOcrExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public QuestionOcrExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andSortIsNull() {
addCriterion("sort is null");
return (Criteria) this;
}
public Criteria andSortIsNotNull() {
addCriterion("sort is not null");
return (Criteria) this;
}
public Criteria andSortEqualTo(Integer value) {
addCriterion("sort =", value, "sort");
return (Criteria) this;
}
public Criteria andSortNotEqualTo(Integer value) {
addCriterion("sort <>", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThan(Integer value) {
addCriterion("sort >", value, "sort");
return (Criteria) this;
}
public Criteria andSortGreaterThanOrEqualTo(Integer value) {
addCriterion("sort >=", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThan(Integer value) {
addCriterion("sort <", value, "sort");
return (Criteria) this;
}
public Criteria andSortLessThanOrEqualTo(Integer value) {
addCriterion("sort <=", value, "sort");
return (Criteria) this;
}
public Criteria andSortIn(List<Integer> values) {
addCriterion("sort in", values, "sort");
return (Criteria) this;
}
public Criteria andSortNotIn(List<Integer> values) {
addCriterion("sort not in", values, "sort");
return (Criteria) this;
}
public Criteria andSortBetween(Integer value1, Integer value2) {
addCriterion("sort between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andSortNotBetween(Integer value1, Integer value2) {
addCriterion("sort not between", value1, value2, "sort");
return (Criteria) this;
}
public Criteria andHospitalIsNull() {
addCriterion("hospital is null");
return (Criteria) this;
}
public Criteria andHospitalIsNotNull() {
addCriterion("hospital is not null");
return (Criteria) this;
}
public Criteria andHospitalEqualTo(Long value) {
addCriterion("hospital =", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotEqualTo(Long value) {
addCriterion("hospital <>", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalGreaterThan(Long value) {
addCriterion("hospital >", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalGreaterThanOrEqualTo(Long value) {
addCriterion("hospital >=", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalLessThan(Long value) {
addCriterion("hospital <", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalLessThanOrEqualTo(Long value) {
addCriterion("hospital <=", value, "hospital");
return (Criteria) this;
}
public Criteria andHospitalIn(List<Long> values) {
addCriterion("hospital in", values, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotIn(List<Long> values) {
addCriterion("hospital not in", values, "hospital");
return (Criteria) this;
}
public Criteria andHospitalBetween(Long value1, Long value2) {
addCriterion("hospital between", value1, value2, "hospital");
return (Criteria) this;
}
public Criteria andHospitalNotBetween(Long value1, Long value2) {
addCriterion("hospital not between", value1, value2, "hospital");
return (Criteria) this;
}
public Criteria andStartIsNull() {
addCriterion("start is null");
return (Criteria) this;
}
public Criteria andStartIsNotNull() {
addCriterion("start is not null");
return (Criteria) this;
}
public Criteria andStartEqualTo(String value) {
addCriterion("start =", value, "start");
return (Criteria) this;
}
public Criteria andStartNotEqualTo(String value) {
addCriterion("start <>", value, "start");
return (Criteria) this;
}
public Criteria andStartGreaterThan(String value) {
addCriterion("start >", value, "start");
return (Criteria) this;
}
public Criteria andStartGreaterThanOrEqualTo(String value) {
addCriterion("start >=", value, "start");
return (Criteria) this;
}
public Criteria andStartLessThan(String value) {
addCriterion("start <", value, "start");
return (Criteria) this;
}
public Criteria andStartLessThanOrEqualTo(String value) {
addCriterion("start <=", value, "start");
return (Criteria) this;
}
public Criteria andStartLike(String value) {
addCriterion("start like", value, "start");
return (Criteria) this;
}
public Criteria andStartNotLike(String value) {
addCriterion("start not like", value, "start");
return (Criteria) this;
}
public Criteria andStartIn(List<String> values) {
addCriterion("start in", values, "start");
return (Criteria) this;
}
public Criteria andStartNotIn(List<String> values) {
addCriterion("start not in", values, "start");
return (Criteria) this;
}
public Criteria andStartBetween(String value1, String value2) {
addCriterion("start between", value1, value2, "start");
return (Criteria) this;
}
public Criteria andStartNotBetween(String value1, String value2) {
addCriterion("start not between", value1, value2, "start");
return (Criteria) this;
}
public Criteria andEndIsNull() {
addCriterion("end is null");
return (Criteria) this;
}
public Criteria andEndIsNotNull() {
addCriterion("end is not null");
return (Criteria) this;
}
public Criteria andEndEqualTo(String value) {
addCriterion("end =", value, "end");
return (Criteria) this;
}
public Criteria andEndNotEqualTo(String value) {
addCriterion("end <>", value, "end");
return (Criteria) this;
}
public Criteria andEndGreaterThan(String value) {
addCriterion("end >", value, "end");
return (Criteria) this;
}
public Criteria andEndGreaterThanOrEqualTo(String value) {
addCriterion("end >=", value, "end");
return (Criteria) this;
}
public Criteria andEndLessThan(String value) {
addCriterion("end <", value, "end");
return (Criteria) this;
}
public Criteria andEndLessThanOrEqualTo(String value) {
addCriterion("end <=", value, "end");
return (Criteria) this;
}
public Criteria andEndLike(String value) {
addCriterion("end like", value, "end");
return (Criteria) this;
}
public Criteria andEndNotLike(String value) {
addCriterion("end not like", value, "end");
return (Criteria) this;
}
public Criteria andEndIn(List<String> values) {
addCriterion("end in", values, "end");
return (Criteria) this;
}
public Criteria andEndNotIn(List<String> values) {
addCriterion("end not in", values, "end");
return (Criteria) this;
}
public Criteria andEndBetween(String value1, String value2) {
addCriterion("end between", value1, value2, "end");
return (Criteria) this;
}
public Criteria andEndNotBetween(String value1, String value2) {
addCriterion("end not between", value1, value2, "end");
return (Criteria) this;
}
public Criteria andRemarkIsNull() {
addCriterion("remark is null");
return (Criteria) this;
}
public Criteria andRemarkIsNotNull() {
addCriterion("remark is not null");
return (Criteria) this;
}
public Criteria andRemarkEqualTo(String value) {
addCriterion("remark =", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotEqualTo(String value) {
addCriterion("remark <>", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThan(String value) {
addCriterion("remark >", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkGreaterThanOrEqualTo(String value) {
addCriterion("remark >=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThan(String value) {
addCriterion("remark <", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLessThanOrEqualTo(String value) {
addCriterion("remark <=", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkLike(String value) {
addCriterion("remark like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotLike(String value) {
addCriterion("remark not like", value, "remark");
return (Criteria) this;
}
public Criteria andRemarkIn(List<String> values) {
addCriterion("remark in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotIn(List<String> values) {
addCriterion("remark not in", values, "remark");
return (Criteria) this;
}
public Criteria andRemarkBetween(String value1, String value2) {
addCriterion("remark between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andRemarkNotBetween(String value1, String value2) {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

45
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionOcrVo.java

@ -0,0 +1,45 @@
package com.ccsens.tcm.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: whj
* @time: 2021/4/1 10:34
*/
public class QuestionOcrVo {
@ApiModel("报告单图片文字通用识别-返回")
@Data
public static class GeneralBasic{
@ApiModelProperty("报告单类型")
private String code;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("试题ID")
private Long questionId;
@ApiModelProperty("答案")
private String content;
}
@ApiModel("orc规则")
@Data
public static class OcrRule{
@ApiModelProperty("规则ID")
private Long id;
@ApiModelProperty("code")
private String code;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty("医院ID")
private Long hospital;
@ApiModelProperty("试题ID")
private Long questionId;
@ApiModelProperty("开始标识")
private String start;
@ApiModelProperty("结束标识")
private String end;
}
}

2
tcm/src/main/java/com/ccsens/tcm/bean/vo/QuestionVo.java

@ -101,6 +101,8 @@ public class QuestionVo {
private String code;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("记录类型 0:仅手动输入1:手动输入+图片识别")
private Byte recordType;
@ApiModelProperty("是否为必做 0否 1是")
private byte must;
@ApiModelProperty("排序")

20
tcm/src/main/java/com/ccsens/tcm/persist/dao/QuestionOcrDao.java

@ -0,0 +1,20 @@
package com.ccsens.tcm.persist.dao;
import com.ccsens.tcm.bean.vo.QuestionOcrVo;
import com.ccsens.tcm.persist.mapper.QuestionOcrMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author whj
*/
public interface QuestionOcrDao extends QuestionOcrMapper {
/**
* 查询识别规则
* @param hospitalId 医院ID
* @param code 类型
* @return 规则
*/
List<QuestionOcrVo.OcrRule> queryRules(@Param("hospitalId") Long hospitalId, @Param("code") String code);
}

30
tcm/src/main/java/com/ccsens/tcm/persist/mapper/QuestionOcrMapper.java

@ -0,0 +1,30 @@
package com.ccsens.tcm.persist.mapper;
import com.ccsens.tcm.bean.po.QuestionOcr;
import com.ccsens.tcm.bean.po.QuestionOcrExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface QuestionOcrMapper {
long countByExample(QuestionOcrExample example);
int deleteByExample(QuestionOcrExample example);
int deleteByPrimaryKey(Long id);
int insert(QuestionOcr record);
int insertSelective(QuestionOcr record);
List<QuestionOcr> selectByExample(QuestionOcrExample example);
QuestionOcr selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") QuestionOcr record, @Param("example") QuestionOcrExample example);
int updateByExample(@Param("record") QuestionOcr record, @Param("example") QuestionOcrExample example);
int updateByPrimaryKeySelective(QuestionOcr record);
int updateByPrimaryKey(QuestionOcr record);
}

20
tcm/src/main/java/com/ccsens/tcm/service/IOcrService.java

@ -0,0 +1,20 @@
package com.ccsens.tcm.service;
import com.ccsens.tcm.bean.dto.QuestionOcrDto;
import com.ccsens.tcm.bean.vo.QuestionOcrVo;
import java.util.List;
/**
* @author whj
*/
public interface IOcrService {
/**
* 文字识别
* @param param 参数
* @param userId 用户ID
* @return words
*/
List<QuestionOcrVo.GeneralBasic> identifyWords(QuestionOcrDto.GeneralBasic param, Long userId);
}

118
tcm/src/main/java/com/ccsens/tcm/service/OcrService.java

@ -0,0 +1,118 @@
package com.ccsens.tcm.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.tcm.bean.dto.QuestionOcrDto;
import com.ccsens.tcm.bean.po.QuestionOcr;
import com.ccsens.tcm.bean.po.QuestionOcrExample;
import com.ccsens.tcm.bean.vo.QuestionOcrVo;
import com.ccsens.tcm.persist.dao.QuestionOcrDao;
import com.ccsens.tcm.uitl.Constant;
import com.ccsens.util.baidu.BaiDuDto;
import com.ccsens.util.baidu.BaiDuUtil;
import com.ccsens.util.baidu.BaiDuVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description: 图像识别
* @author: whj
* @time: 2021/4/1 10:14
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class OcrService implements IOcrService {
@Resource
private QuestionOcrDao questionOcrDao;
@Override
public List<QuestionOcrVo.GeneralBasic> identifyWords(QuestionOcrDto.GeneralBasic generalBasic, Long userId) {
List<QuestionOcrVo.GeneralBasic> vos = new ArrayList<>();
BaiDuDto.GeneralBasic basic = new BaiDuDto.GeneralBasic();
basic.setUrl(generalBasic.getUrl());
BaiDuVo.GeneralBasic words = BaiDuUtil.generalBasic(Constant.BaiDu.APP_KEY, Constant.BaiDu.SECRET_KEY, basic);
log.info("文字识别:{}", words);
if (words == null || words.getWordsResultNum() <= 0) {
return vos;
}
List<QuestionOcrVo.OcrRule> rules = questionOcrDao.queryRules(generalBasic.getHospitalId(), generalBasic.getCode());
log.info("规则:{}", rules);
if (CollectionUtil.isEmpty(rules)) {
return vos;
}
Map<String, Integer> keyMap = new HashMap<>();
rules.forEach(rule -> {
JSONObject start = StrUtil.isEmpty(rule.getStart()) ? null : JSONObject.parseObject(rule.getStart());
JSONObject end = StrUtil.isEmpty(rule.getEnd()) ? null : JSONObject.parseObject(rule.getEnd());
StringBuilder builder = new StringBuilder();
if (start == null) {
// 不知道这种场景
} else if (start.containsKey(Constant.BaiDu.NUM)) {
// 包含读取第几个
builder = getContent(words, keyMap, start);
} else {
builder = getContent(words, start, end);
}
QuestionOcrVo.GeneralBasic vo = new QuestionOcrVo.GeneralBasic();
vo.setQuestionId(rule.getQuestionId());
vo.setCode(rule.getCode());
vo.setSort(rule.getSort());
vo.setContent(builder == null ? "" : builder.toString());
vos.add(vo);
});
return vos;
}
private StringBuilder getContent(BaiDuVo.GeneralBasic words, Map<String, Integer> keyMap, JSONObject start) {
StringBuilder builder = new StringBuilder();
String key = start.getString(Constant.BaiDu.KEY);
int index = start.getIntValue(Constant.BaiDu.NUM);
if (keyMap.containsKey(key) ) {
if (keyMap.get(key) >= 0) {
builder.append( words.getWordsResult().get(keyMap.get(key) + index).getWords());
}
} else {
for (int i = 0; i < words.getWordsResultNum(); i++) {
BaiDuVo.GeneralWord word = words.getWordsResult().get(i);
if (word.getWords().contains(key)) {
keyMap.put(key, i);
builder.append(words.getWordsResult().get(i + index).getWords());
return builder;
}
}
}
return builder;
}
private StringBuilder getContent(BaiDuVo.GeneralBasic words, JSONObject start, JSONObject end) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < words.getWordsResult().size(); i++) {
BaiDuVo.GeneralWord word = words.getWordsResult().get(i);
String wordStr = word.getWords();
if (start != null && wordStr.startsWith(start.getString(Constant.BaiDu.KEY))) {
builder.delete(0, builder.length());
builder.append(wordStr);
} else if (end != null && wordStr.startsWith(end.getString(Constant.BaiDu.KEY))) {
break;
} else {
builder.append(wordStr);
}
}
return builder;
}
}

7
tcm/src/main/java/com/ccsens/tcm/uitl/Constant.java

@ -69,4 +69,11 @@ public class Constant {
public static final String UPLOAD_URL = "upload";
}
public static class BaiDu{
public static final String APP_KEY = "F43SLi3hDra3EgWiSi8bIH8c";
public static final String SECRET_KEY = "wGhbTXGsrbxfuCQT7WyLDndYRxrSYqbD";
public static final String KEY = "key";
public static final String NUM = "num";
}
}

4
tcm/src/main/resources/application-green.yml

@ -36,8 +36,8 @@ eureka:
ip-address: 49.232.6.143
file:
path: /home/cloud/tcm/uploads/
domain: https://www.sxwikionline.com/gateway/tcm/
imgDomain: https://www.sxwikionline.com/gateway/tcm/uploads/
domain: http://sxzxyzzlm.tall.wiki/gateway/tcm/
imgDomain: http://sxzxyzzlm.tall.wiki/gateway/tcm/uploads/
day:
one: 9
two: 30

25
tcm/src/main/resources/mapper_dao/QuestionOcrDao.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tcm.persist.dao.QuestionOcrDao">
<select id="queryRules" resultType="com.ccsens.tcm.bean.vo.QuestionOcrVo$OcrRule">
SELECT
q.id AS questionId,
o.id,
o.CODE,
o.sort,
o.hospital,
o.START,
o.END
FROM
t_question_ocr o,
t_question q
WHERE
o.CODE = q.CODE
AND o.sort = q.sort
AND o.CODE = #{code}
AND o.hospital = #{hospitalId}
AND o.rec_status = 0
AND q.rec_status = 0
</select>
</mapper>

6
tcm/src/main/resources/mapper_dao/ReportCodeDao.xml

@ -96,12 +96,14 @@
<result column="fSort" jdbcType="INTEGER" property="sort" />
<result column="fRemark" jdbcType="VARCHAR" property="remark" />
<result column="fReportType" jdbcType="TINYINT" property="reportType" />
<result column="fRecordType" jdbcType="TINYINT" property="recordType" />
<collection property="subReportCodes" ofType="com.ccsens.tcm.bean.vo.QuestionVo$PatientCode">
<id column="sId" jdbcType="BIGINT" property="id" />
<result column="sCode" jdbcType="VARCHAR" property="code" />
<result column="sName" jdbcType="VARCHAR" property="name" />
<result column="sMust" jdbcType="TINYINT" property="must" />
<result column="sSort" jdbcType="INTEGER" property="sort" />
<result column="sRecordType" jdbcType="TINYINT" property="recordType" />
<result column="sRemark" jdbcType="VARCHAR" property="remark" />
<result column="sReportType" jdbcType="TINYINT" property="reportType" />
</collection>
@ -116,13 +118,15 @@
c1.sort as fSort,
c1.remark as fRemark,
c1.report_type as fReportType,
c1.record_type as fRecordType,
c2.id as sId,
c2.code as sCode,
c2.`name` as sName,
c2.must as sMust,
c2.sort as sSort,
c2.remark as sRemark,
c2.report_type as sReportType
c2.report_type as sReportType,
c2.record_type as sRecordType
FROM
t_report_code c1
LEFT JOIN (

305
tcm/src/main/resources/mapper_raw/QuestionOcrMapper.xml

@ -0,0 +1,305 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.tcm.persist.mapper.QuestionOcrMapper">
<resultMap id="BaseResultMap" type="com.ccsens.tcm.bean.po.QuestionOcr">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="hospital" jdbcType="BIGINT" property="hospital" />
<result column="start" jdbcType="VARCHAR" property="start" />
<result column="end" jdbcType="VARCHAR" property="end" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, code, sort, hospital, start, end, remark, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.tcm.bean.po.QuestionOcrExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_question_ocr
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_question_ocr
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_question_ocr
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.tcm.bean.po.QuestionOcrExample">
delete from t_question_ocr
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.tcm.bean.po.QuestionOcr">
insert into t_question_ocr (id, code, sort,
hospital, start, end,
remark, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{code,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{hospital,jdbcType=BIGINT}, #{start,jdbcType=VARCHAR}, #{end,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.tcm.bean.po.QuestionOcr">
insert into t_question_ocr
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="sort != null">
sort,
</if>
<if test="hospital != null">
hospital,
</if>
<if test="start != null">
start,
</if>
<if test="end != null">
end,
</if>
<if test="remark != null">
remark,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="hospital != null">
#{hospital,jdbcType=BIGINT},
</if>
<if test="start != null">
#{start,jdbcType=VARCHAR},
</if>
<if test="end != null">
#{end,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.tcm.bean.po.QuestionOcrExample" resultType="java.lang.Long">
select count(*) from t_question_ocr
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_question_ocr
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.hospital != null">
hospital = #{record.hospital,jdbcType=BIGINT},
</if>
<if test="record.start != null">
start = #{record.start,jdbcType=VARCHAR},
</if>
<if test="record.end != null">
end = #{record.end,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_question_ocr
set id = #{record.id,jdbcType=BIGINT},
code = #{record.code,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
hospital = #{record.hospital,jdbcType=BIGINT},
start = #{record.start,jdbcType=VARCHAR},
end = #{record.end,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.tcm.bean.po.QuestionOcr">
update t_question_ocr
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="hospital != null">
hospital = #{hospital,jdbcType=BIGINT},
</if>
<if test="start != null">
start = #{start,jdbcType=VARCHAR},
</if>
<if test="end != null">
end = #{end,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.tcm.bean.po.QuestionOcr">
update t_question_ocr
set code = #{code,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
hospital = #{hospital,jdbcType=BIGINT},
start = #{start,jdbcType=VARCHAR},
end = #{end,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

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

@ -9,6 +9,8 @@ public enum CodeEnum {
*/
SUCCESS(200, "ok", true),
SYS_ERROR(500, "网络繁忙,请您稍后重试", false),
THIRD_ERROR(-1, "调用第三方刚接口异常", false),
FILE_FORMAT_ERROR(1, "文件格式错误", true),
AUDITED(2, "已经审核通过,不重复提交。", true),
POSITION_NO_FOUND(3, "未找到对应职务,请重新选择职务。", true),
@ -187,8 +189,13 @@ public enum CodeEnum {
MEIYOUGAIYISHENG(156,"该医生信息查询不正确",true),
QINGTIJIAOSHITI(157,"未做出修改答案,修改后再提交",true),
DOC_REPEAT(158,"输入文档已存在",true),
DOC_NONE(161,"输入文档不存在",true),
NOTNAME(159,"未找到该列",true),
CHONGFU(160,"该成员在项目下有多个成员角色",true),
CHAOGUOSHI(161,"角色展示不能超过10个",true),
BAOHANJINLI(162,"不能删除包含经理得角色",true),
CHONGFUTIJIAO(163,"不要重复提交",true),
ZUISHAOCHUANLIANGE(164,"排序最少需要传入两个",true),
;
@ -241,5 +248,9 @@ public enum CodeEnum {
private Integer code;
private String msg;
private boolean success;
public void setMsg(String msg) {
this.msg = msg;
}
}

10
util/src/main/java/com/ccsens/util/RestTemplateUtil.java

@ -106,8 +106,14 @@ public class RestTemplateUtil {
}
public static String postUrlEncode(String url, Object params) {
log.info("请求路径:{},请求参数:{}", url, params);
JSONObject json = JSON.parseObject(JSON.toJSONString(params));
MultiValueMap<String, Object> paramMap = transMultiValueMap(json);
MultiValueMap<String, Object> paramMap;
if (params == null) {
paramMap = new LinkedMultiValueMap<>();
} else {
JSONObject json = JSON.parseObject(JSON.toJSONString(params));
paramMap = transMultiValueMap(json);
}
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
HttpEntity<MultiValueMap> formEntity = new HttpEntity<>(paramMap, headers);

19
util/src/main/java/com/ccsens/util/baidu/BaiDuDto.java

@ -0,0 +1,19 @@
package com.ccsens.util.baidu;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @description:
* @author: whj
* @time: 2021/3/31 16:39
*/
public class BaiDuDto {
@ApiModel("通用文字识别(标准版)-请求参数")
@Data
public static class GeneralBasic{
private String image;
private String url;
}
}

95
util/src/main/java/com/ccsens/util/baidu/BaiDuUtil.java

@ -0,0 +1,95 @@
package com.ccsens.util.baidu;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
/**
* @description: 百度API
* @author: whj
* @time: 2021/3/31 15:30
*/
@Component
@Slf4j
public class BaiDuUtil {
@Resource
private RedisUtil redisUtil;
private static BaiDuUtil util;
/**token_appKey*/
private static final String tokenKey = "baidu_token_";
private static final String authUrl = "https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={}&client_secret={}";
private static final String generalBasicUrl = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token={}";
@PostConstruct
public void init(){
util = this;
util.redisUtil = this.redisUtil;
}
/**
* 获取token
* @param appKey appKey
* @param secretKey secretKey
* @return token
*/
public static String getToken(String appKey, String secretKey){
log.info("获取百度认证:{},{}", appKey, secretKey);
String key = tokenKey + appKey;
String token = (String) util.redisUtil.get(key);
log.info("缓存token:{}", token);
if (StrUtil.isNotEmpty(token)) {
return token;
}
String url = StrUtil.format(authUrl, appKey, secretKey);
String result = RestTemplateUtil.postUrlEncode(url, null);
log.info("获取百度认证:{}", result);
JSONObject json = JSONObject.parseObject(result);
if (json.containsKey(Code.ERROR)) {
log.info("获取token失败");
CodeEnum thirdError = CodeEnum.THIRD_ERROR;
thirdError.setMsg(result);
throw new BaseException(thirdError);
}
token = json.getString(Code.ACCESS_TOKEN);
// 有效期,减10分钟
int expiresTime = json.getIntValue(Code.EXPIRES_TIME) - 10*60;
util.redisUtil.set(key, token, expiresTime);
return token;
}
public static BaiDuVo.GeneralBasic generalBasic(String appKey, String secretKey, BaiDuDto.GeneralBasic basic) {
String token = getToken(appKey, secretKey);
String url = StrUtil.format(generalBasicUrl, token);
// String result = RestTemplateUtil.postBody(url, basic);
String result = RestTemplateUtil.postUrlEncode(url, basic);
log.info("调用通用文字识别(标准版)结果:{}", result);
if (result.contains(Code.GENERAL_BASIC_ERROR)) {
CodeEnum thirdError = CodeEnum.THIRD_ERROR;
thirdError.setMsg(result);
throw new BaseException(thirdError);
}
BaiDuVo.GeneralBasic basicVo = JSONObject.parseObject(result, BaiDuVo.GeneralBasic.class);
return basicVo;
}
private static class Code{
private final static String ERROR = "error";
private final static String GENERAL_BASIC_ERROR = "error_code";
private final static String ERROR_DESC = "error_description";
private final static String ACCESS_TOKEN = "access_token";
private final static String EXPIRES_TIME = "expires_in";
}
}

33
util/src/main/java/com/ccsens/util/baidu/BaiDuVo.java

@ -0,0 +1,33 @@
package com.ccsens.util.baidu;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.util.List;
/**
* @description:
* @author: whj
* @time: 2021/3/31 16:11
*/
public class BaiDuVo {
@ApiModel("通用文字识别(标准版)")
@Data
public static class GeneralBasic{
@JSONField(name="log_id")
private String logId;
@JSONField(name="words_result")
private List<GeneralWord> wordsResult;
@JSONField(name="words_result_num")
private int wordsResultNum;
}
@Data
@ApiModel("文字识别-文字")
public static class GeneralWord{
private String words;
}
}
Loading…
Cancel
Save