Commit ced9e66f by 崔彦峰

修改导出、列表代码

1 parent 0aad04ea
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class OrganizationListResponseDTO implements Serializable {
......@@ -20,5 +21,191 @@ public class OrganizationListResponseDTO implements Serializable {
@ApiModelProperty(notes = "部门机构名称")
private String name;
/**
* 组织单元编码
*/
@ApiModelProperty(notes = "组织单元编码")
private String code;
/**
* 组织层级实体对象GUID
*/
@ApiModelProperty(notes = "组织层级实体对象GUID")
private String level;
/**
* 状态:0停用、1启用
*/
@ApiModelProperty(notes = "状态:0停用、1启用")
private Boolean status;
/**
* 设立日期
*/
@ApiModelProperty(notes = "设立日期")
private Date establishDate;
/**
* 生效日期
*/
@ApiModelProperty(notes = "生效日期")
private Date startDate;
/**
* 失效日期
*/
@ApiModelProperty(notes = "失效日期")
private Date stopDate;
/**
* 变更日期
*/
@ApiModelProperty(notes = "变更日期")
private Date changeDate;
/**
* 行政维度上级组织OId
*/
@ApiModelProperty(notes = "行政维度上级组织OId")
private Integer pOidOrgAdmin;
/**
* 业务维度上级组织OId
*/
@ApiModelProperty(notes = "业务维度上级组织OId")
private Integer pOidOrgReserve2;
/**
* 产品维度组织OId
*/
@ApiModelProperty(notes = "产品维度组织OId")
private Integer pOidOrgReserve3;
/**
* 是否当前生效
*/
@ApiModelProperty(notes = "是否当前生效")
private Boolean isCurrentRecord;
/**
* 部门负责人员工UserID
*/
@ApiModelProperty(notes = "部门负责人员工UserID")
private Integer personInCharge;
/**
* 业务修改人
*/
@ApiModelProperty(notes = "业务修改人")
private Integer businessModifiedBy;
/**
* 业务修改时间
*/
@ApiModelProperty(notes = "业务修改时间")
private Date businessModifiedTime;
/**
* 组织类型实体对象GUID
*/
@ApiModelProperty(notes = "组织类型实体对象GUID")
private String oIdOrganizationType;
/**
* 行政维度_层级
*/
@ApiModelProperty(notes = "行政维度_层级")
private Integer pOidOrgAdminTreeLevel;
/**
* 业务维度_层级
*/
@ApiModelProperty(notes = "业务维度_层级")
private Integer pOidOrgReserve2TreeLevel;
/**
* 一级组织OId
*/
@ApiModelProperty(notes = "一级组织OId")
private Integer firstLevelOrganization;
/**
* 二级组织OId
*/
@ApiModelProperty(notes = "二级组织OId")
private Integer secondLevelOrganization;
/**
* 三级组织OId
*/
@ApiModelProperty(notes = "三级组织OId")
private Integer thirdLevelOrganization;
/**
* 四级组织OId
*/
@ApiModelProperty(notes = "四级组织OId")
private Integer fourthLevelOrganization;
/**
* 五级组织OId
*/
@ApiModelProperty(notes = "五级组织OId")
private Integer fifthLevelOrganization;
/**
* 六级组织OId
*/
@ApiModelProperty(notes = "六级组织OId")
private Integer sixthLevelOrganization;
/**
* 排序编码
*/
@ApiModelProperty(notes = "排序编码")
private Integer orderCode;
/**
* 是否虚拟组织
*/
@ApiModelProperty(notes = "是否虚拟组织")
private Boolean isVirtualOrg;
/**
* 业务对象实体主键GUID
*/
@ApiModelProperty(notes = "业务对象实体主键GUID")
private String objectId;
/**
* 创建人员工UserID
*/
@ApiModelProperty(notes = "创建人员工UserID")
private Integer createdBy;
/**
* 创建时间
*/
@ApiModelProperty(notes = "创建时间")
private Date createdTime;
/**
* 修改人员工UserID
*/
@ApiModelProperty(notes = "修改人员工UserID")
private Integer modifiedBy;
/**
* 修改时间
*/
@ApiModelProperty(notes = "修改时间")
private Date modifiedTime;
/**
* 是否删除
*/
@ApiModelProperty(notes = "是否删除")
private Boolean stdIsDeleted;
}
......@@ -42,10 +42,10 @@ public class LevelExamPageListRequestDTO implements Serializable {
/**
* 创建人
* 创建人-登录账号名称
*/
@ApiModelProperty(notes = "创建人")
private String createdBy;
@ApiModelProperty(notes = "创建人-登录账号名称")
private String creator;
/**
......
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;
......@@ -19,11 +20,23 @@ public class LevelExamPageListResponseDTO implements Serializable {
private Integer id;
/**
* 北森考试标识
*/
@ApiModelProperty(notes = "北森考试id标识")
private String beisenExamId;
/**
* 北森考试名称
*/
@ApiModelProperty(notes = "北森考试名称")
private String beisenExamName;
/**
* 所属部门Id
*/
@ApiModelProperty(notes = "所属部门Id")
private Integer departmentId;
/**
* 所属部门名称
......@@ -33,6 +46,13 @@ public class LevelExamPageListResponseDTO implements Serializable {
/**
* 职务编码
*/
@ApiModelProperty(notes = "职务编码")
private String positionCode;
/**
* 职务名称
*/
@ApiModelProperty(notes = "职务名称")
......@@ -45,6 +65,18 @@ public class LevelExamPageListResponseDTO implements Serializable {
@ApiModelProperty(notes = "考试时间")
private Integer examTime;
/**
* 学习中心权限 (1:提交后开放)
*/
@ApiModelProperty(notes = "学习中心权限 (1:提交后开放)")
private Byte learningCenterPermission;
/**
* 生效方式 (1:立即生效, 2:定时生效)
*/
@ApiModelProperty(notes = "生效方式 (1:立即生效, 2:定时生效)")
private Byte effectiveType;
/**
......@@ -68,6 +100,14 @@ public class LevelExamPageListResponseDTO implements Serializable {
/**
* 创建人-登录账号名称
*/
@ApiModelProperty(notes = "创建人-登录账号名称")
private String creator;
/**
* 创建人
*/
@ApiModelProperty(notes = "创建人")
......@@ -89,5 +129,24 @@ public class LevelExamPageListResponseDTO implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date effectiveTime;
/**
* 修改人
*/
@ApiModelProperty(notes = "修改人")
private String updatedBy;
/**
* 修改时间
*/
@ApiModelProperty(notes = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updatedDate;
/**
* 删除标识(D:已删除;N:未删除)
*/
@ApiModelProperty(notes = "删除标识(D:已删除;N:未删除)")
private String deletedFlag;
}
......@@ -64,7 +64,7 @@
<select id="simpleListByCondition" resultMap="DTOBaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM organization
FROM dj_beisen_organization
WHERE `std_is_deleted` = 0
<if test="oId != null">
AND o_id = #{oId}
......
......@@ -52,8 +52,8 @@
<if test="status != null">
AND status = #{status}
</if>
<if test="createdBy != null and createdBy != ''">
AND created_by LIKE CONCAT('%', #{createdBy}, '%')
<if test="creator != null and creator != ''">
AND creator LIKE CONCAT('%', #{creator}, '%')
</if>
<if test="createdStartDate != null and createdEndDate != null">
AND created_date BETWEEN #{createdStartDate} AND #{createdEndDate}
......@@ -70,24 +70,29 @@
#{item}
</foreach>
</if>
<if test="createdDateSort != null and createdDateSort == 0">
ORDER BY created_date ASC
</if>
<if test="createdDateSort != null and createdDateSort == 1">
ORDER BY created_date DESC
</if>
<if test="submittedCountSort != null and submittedCountSort == 0">
ORDER BY submitted_count ASC
</if>
<if test="submittedCountSort != null and submittedCountSort == 1">
ORDER BY submitted_count DESC
</if>
<if test="effectiveDateSort != null and effectiveDateSort == 0">
ORDER BY effective_time ASC
</if>
<if test="effectiveDateSort != null and effectiveDateSort == 1">
ORDER BY effective_time DESC
</if>
ORDER BY id DESC
ORDER BY
<choose>
<when test="createdDateSort != null and createdDateSort == 0">
created_date ASC
</when>
<when test="createdDateSort != null and createdDateSort == 1">
created_date DESC
</when>
<when test="submittedCountSort != null and submittedCountSort == 0">
submitted_count ASC
</when>
<when test="submittedCountSort != null and submittedCountSort == 1">
submitted_count DESC
</when>
<when test="effectiveDateSort != null and effectiveDateSort == 0">
effective_time ASC
</when>
<when test="effectiveDateSort != null and effectiveDateSort == 1">
effective_time DESC
</when>
<otherwise>
id DESC
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
  • @wangxw1
    commented
    Master

    Auto Review Result:

    代码审查报告

    问题描述和优化建议

    1. OrganizationListResponseDTO 类

    问题描述:

    • 字段命名: 字段 level 应该是一个字符串而不是布尔值,因为它被描述为“组织层级实体对象GUID”。这可能会导致混淆。
    • 字段类型: 字段 status 和 isCurrentRecord 是布尔值,但在实际应用中,这些字段可能更适合用枚举类型来表示状态,这样可以提高代码的可读性和可维护性。
    • 冗余字段: 从 firstLevelOrganization 到 sixthLevelOrganization 这些字段可能存在冗余,如果层级结构可以通过其他方式表示(例如,通过一个数组或集合),则可以减少代码复杂性。
    • 缺少注释: 某些字段缺少详细的注释,例如 oIdOrganizationType 和 stdIsDeleted,这可能会使其他开发者难以理解字段的具体用途。

    优化建议:

    • 更改 level 字段的数据类型为 String。
    • 使用枚举类型替换 status 和 isCurrentRecord 字段。
    • 如果可能,简化层级结构的表示方式。
    • 为所有字段添加详细的注释,解释其用途和预期值。

    2. LevelExamPageListRequestDTO 类

    问题描述:

    • 字段命名: 字段 createdBy 更改为 creator,但注释仍然使用了“创建人”,这可能导致混淆。

    优化建议:

    • 更新注释以匹配字段名 creator。

    3. LevelExamPageListResponseDTO 类

    问题描述:

    • 字段命名: 字段 updatedBy 和 updatedDate 增加了新的字段,但旧的 createdBy 和 createTime 仍然存在,这可能导致数据冗余和不一致性。
    • 字段类型: 字段 learningCenterPermission 和 effectiveType 使用了 Byte 类型,这可能不是最佳选择,因为这些字段通常用于表示状态或选项,使用 Enum 或 Integer 可能更合适。

    优化建议:

    • 移除或弃用旧的 createdBy 和 createTime 字段,以避免数据冗余。
    • 使用 Enum 或 Integer 替换 Byte 类型的字段。

    评分明细

    1. 功能实现的正确性与健壮性(40分):

      • 代码实现了所需的功能,但存在字段命名和类型选择上的问题,这些问题可能会影响代码的健壮性和可维护性。
      • 分数: 28分
    2. 安全性与潜在风险(30分):

      • 代码没有明显的安全漏洞,但字段命名和类型选择上的问题可能会导致潜在的风险,特别是在处理用户输入时。
      • 分数: 25分
    3. 是否符合最佳实践(20分):

      • 代码整体上遵循了Java的最佳实践,但存在一些不符合最佳实践的地方,例如字段命名和类型选择。
      • 分数: 15分
    4. 性能与资源利用效率(5分):

      • 代码没有明显的性能问题,但冗余字段可能会增加内存使用。
      • 分数: 3分
    5. Commits信息的清晰性与准确性(5分):

      • 提交信息“修改导出、列表代码”不够具体,无法清楚地了解具体的修改内容。
      • 分数: 2分

    总分: 73分


    通过以上审查,可以发现代码在多个方面存在改进空间。建议开发者根据上述建议对代码进行相应的调整,以提高代码的质量和可维护性。

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!