浏览代码

定时任务处理维护资产(0)

6 年之前
父节点
当前提交
641ddc56ed

+ 21 - 0
pcbms/src/main/java/com/hssx/pcbms/controller/ScoringOperateRecordController.java

@@ -0,0 +1,21 @@
+package com.hssx.pcbms.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-07
+ */
+@RestController
+@RequestMapping("/scoring-operate-record")
+public class ScoringOperateRecordController {
+
+}
+

+ 1 - 4
pcbms/src/main/java/com/hssx/pcbms/entity/Idea.java

@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
 import java.io.Serializable;
 
 /**
@@ -15,7 +13,7 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-11-02
+ * @since 2019-11-07
  */
 public class Idea extends Model<Idea> {
 
@@ -37,7 +35,6 @@ public class Idea extends Model<Idea> {
      * 发表时间
      */
     @TableField("indate")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime indate;
 
     /**

+ 16 - 1
pcbms/src/main/java/com/hssx/pcbms/entity/Score.java

@@ -12,7 +12,7 @@ import java.io.Serializable;
  * </p>
  *
  * @author 吴涛涛
- * @since 2019-11-04
+ * @since 2019-11-07
  */
 public class Score extends Model<Score> {
 
@@ -72,6 +72,12 @@ public class Score extends Model<Score> {
     @TableField("scoring_year_month")
     private String scoringYearMonth;
 
+    /**
+     * 部门id
+     */
+    @TableField("dept_id")
+    private String deptId;
+
 
     public Integer getScoreId() {
         return scoreId;
@@ -145,6 +151,14 @@ public class Score extends Model<Score> {
         this.scoringYearMonth = scoringYearMonth;
     }
 
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
     @Override
     protected Serializable pkVal() {
         return this.scoreId;
@@ -162,6 +176,7 @@ public class Score extends Model<Score> {
         ", rater=" + rater +
         ", uid=" + uid +
         ", scoringYearMonth=" + scoringYearMonth +
+        ", deptId=" + deptId +
         "}";
     }
 }

+ 168 - 0
pcbms/src/main/java/com/hssx/pcbms/entity/ScoringOperateRecord.java

@@ -0,0 +1,168 @@
+package com.hssx.pcbms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-07
+ */
+public class ScoringOperateRecord extends Model<ScoringOperateRecord> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 打分操作记录表
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 打分者姓名
+     */
+    @TableField("operator")
+    private String operator;
+
+    /**
+     * 打分人id
+     */
+    @TableField("operator_id")
+    private Integer operatorId;
+
+    /**
+     * 操作内容
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 打分表的关联外键
+     */
+    @TableField("score_id")
+    private Integer scoreId;
+
+    /**
+     * 操作时间
+     */
+    @TableField("indate")
+    private LocalDateTime indate;
+
+    /**
+     * 对象id
+     */
+    @TableField("uid")
+    private Integer uid;
+
+    /**
+     * 对象名
+     */
+    @TableField("uname")
+    private String uname;
+
+    /**
+     * 部门id
+     */
+    @TableField("dept_id")
+    private String deptId;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public Integer getOperatorId() {
+        return operatorId;
+    }
+
+    public void setOperatorId(Integer operatorId) {
+        this.operatorId = operatorId;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getScoreId() {
+        return scoreId;
+    }
+
+    public void setScoreId(Integer scoreId) {
+        this.scoreId = scoreId;
+    }
+
+    public LocalDateTime getIndate() {
+        return indate;
+    }
+
+    public void setIndate(LocalDateTime indate) {
+        this.indate = indate;
+    }
+
+    public Integer getUid() {
+        return uid;
+    }
+
+    public void setUid(Integer uid) {
+        this.uid = uid;
+    }
+
+    public String getUname() {
+        return uname;
+    }
+
+    public void setUname(String uname) {
+        this.uname = uname;
+    }
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "ScoringOperateRecord{" +
+        "id=" + id +
+        ", operator=" + operator +
+        ", operatorId=" + operatorId +
+        ", content=" + content +
+        ", scoreId=" + scoreId +
+        ", indate=" + indate +
+        ", uid=" + uid +
+        ", uname=" + uname +
+        ", deptId=" + deptId +
+        "}";
+    }
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/mapper/ScoringOperateRecordMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.mapper;
+
+import com.hssx.pcbms.entity.ScoringOperateRecord;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-07
+ */
+public interface ScoringOperateRecordMapper extends BaseMapper<ScoringOperateRecord> {
+
+}

+ 16 - 0
pcbms/src/main/java/com/hssx/pcbms/service/ScoringOperateRecordService.java

@@ -0,0 +1,16 @@
+package com.hssx.pcbms.service;
+
+import com.hssx.pcbms.entity.ScoringOperateRecord;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-07
+ */
+public interface ScoringOperateRecordService extends IService<ScoringOperateRecord> {
+
+}

+ 20 - 0
pcbms/src/main/java/com/hssx/pcbms/service/impl/ScoringOperateRecordServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.pcbms.service.impl;
+
+import com.hssx.pcbms.entity.ScoringOperateRecord;
+import com.hssx.pcbms.mapper.ScoringOperateRecordMapper;
+import com.hssx.pcbms.service.ScoringOperateRecordService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-11-07
+ */
+@Service
+public class ScoringOperateRecordServiceImpl extends ServiceImpl<ScoringOperateRecordMapper, ScoringOperateRecord> implements ScoringOperateRecordService {
+
+}

+ 1 - 1
pcbms/src/main/java/com/hssx/pcbms/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("news_notice","news_notice_user");
+        strategy.setInclude("idea");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 0 - 89
pcbms/src/main/resources/mapper/IdeaMapper.xml

@@ -1,89 +0,0 @@
-<?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.hssx.pcbms.mapper.IdeaMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.Idea">
-        <id column="id" property="id" />
-        <result column="uid" property="uid" />
-        <result column="indate" property="indate" />
-        <result column="content" property="content" />
-        <result column="score" property="score" />
-        <result column="is_draft" property="isDraft" />
-        <result column="is_evaluated" property="isEvaluated" />
-        <result column="score_id" property="scoreId" />
-    </resultMap>
-    <resultMap id="BaseResultIdeaCommentMap" type="com.hssx.pcbms.entity.IdeaComment">
-        <id column="cid" property="id" />
-        <result column="idea_id" property="ideaId" />
-        <result column="content" property="content" />
-        <result column="responder_id" property="responderId" />
-        <result column="responder" property="responder" />
-        <result column="indate" property="indate" />
-    </resultMap>
-    <resultMap id="BaseResultMapVO" type="com.hssx.pcbms.entity.vo.IdeaVO">
-        <id column="id" property="id" />
-        <result column="uid" property="uid" />
-        <result column="idea_indate" property="indate" />
-        <result column="idea_content" property="content" />
-        <result column="score" property="score" />
-        <result column="is_draft" property="isDraft" />
-        <result column="is_evaluated" property="isEvaluated" />
-        <result column="score_id" property="scoreId" />
-        <association property="ideaComment" resultMap="BaseResultIdeaCommentMap" >
-        </association>
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, uid, indate, content, score, is_draft, is_evaluated, score_id
-    </sql>
-    
-    <select id="getIdeaListByUid" resultMap="BaseResultMapVO">
-        select
-            i.id, i.uid, i.indate idea_indate, i.content idea_content, i.score, i.is_draft, i.is_evaluated, i.score_id,
-            ic.id cid,ic.idea_id, ic.content, ic.responder_id, ic.responder, ic.indate
-        from
-            idea i
-        left join idea_comment ic
-        on i.id = ic.idea_id
-        <where>
-            <if test="idea.uid != null">
-                i.uid = #{idea.uid,jdbcType=INTEGER}
-            </if>
-            <if test="time != null">
-               and date_format(i.indate,'%Y-%m') = #{time}
-            </if>
-            <if test="idea.scoreId != null">
-                and score_id = #{idea.scoreId}
-            </if>
-        </where>
-        order by i.indate,i.id desc
-    </select>
-    <select id="getIdeaScoreLists" resultMap="BaseResultMap">
-        select
-        id, uid, indate, score, is_draft, is_evaluated, score_id
-        from
-            idea i
-        <where>
-            i.uid = #{ideaVO.uid,jdbcType=INTEGER}
-            and is_evaluated = 1
-            <if test="ideaVO.time != null">
-               and date_format(i.indate,'%Y-%m') = #{time}
-            </if>
-            <if test="ideaVO.scoreId != null">
-               and score_id = #{ideaVO.scoreId}
-            </if>
-        </where>
-        order by i.indate desc
-    </select>
-
-    <update id="updateListByTime">
-        update idea
-            set score_id = #{score.scoreId}
-        where
-          date_format(indate,'%Y-%m') = #{score.scoringYearMonth,jdbcType=VARCHAR}
-          and uid = #{score.uid,jdbcType=INTEGER}
-    </update>
-
-</mapper>

+ 2 - 1
pcbms/src/main/resources/mapper/ScoreMapper.xml

@@ -13,11 +13,12 @@
         <result column="rater" property="rater" />
         <result column="uid" property="uid" />
         <result column="scoring_year_month" property="scoringYearMonth" />
+        <result column="dept_id" property="deptId" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        score_id, personal_score, idea_score, total, reason, rater_id, rater, uid, scoring_year_month
+        score_id, personal_score, idea_score, total, reason, rater_id, rater, uid, scoring_year_month, dept_id
     </sql>
 
 </mapper>

+ 23 - 0
pcbms/src/main/resources/mapper/ScoringOperateRecordMapper.xml

@@ -0,0 +1,23 @@
+<?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.hssx.pcbms.mapper.ScoringOperateRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.pcbms.entity.ScoringOperateRecord">
+        <id column="id" property="id" />
+        <result column="operator" property="operator" />
+        <result column="operator_id" property="operatorId" />
+        <result column="content" property="content" />
+        <result column="score_id" property="scoreId" />
+        <result column="indate" property="indate" />
+        <result column="uid" property="uid" />
+        <result column="uname" property="uname" />
+        <result column="dept_id" property="deptId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, operator, operator_id, content, score_id, indate, uid, uname, dept_id
+    </sql>
+
+</mapper>