瀏覽代碼

仅已审核的才计入统计

Reiskuchen 5 年之前
父節點
當前提交
d5a9839f56

+ 15 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/Report.java

@@ -2,30 +2,31 @@ package com.management.platform.entity;
 
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import java.time.LocalDate;
-import com.baomidou.mybatisplus.annotation.TableId;
-import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author 吴涛涛
- * @since 2020-01-08
+ * @since 2020-02-17
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 public class Report extends Model<Report> {
 
-    private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
     /**
      * 主键
@@ -63,6 +64,12 @@ public class Report extends Model<Report> {
     @TableField(value = "content", updateStrategy = FieldStrategy.IGNORED)
     private String content;
 
+    /**
+     * 审查状态 0-未审核 1-已通过 2-未通过
+     */
+    @TableField("state")
+    private Integer state;
+
     /**
      * 创建时间
      */

+ 2 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -63,10 +63,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         } else if (userList.size() > 1) {
             //检索到两个及以上账号时
             httpRespMsg.setError("账号重名");
-        } /*else if (userList.get(0).getRole() == 0) {
-            //检索的账号role是0 即是普通员工时
-            httpRespMsg.setError("无登录权限");
-        }*/ else if (MD5Util.getPassword(password).equals(userList.get(0).getPassword())) {
+        } else if (MD5Util.getPassword(password).equals(userList.get(0).getPassword())) {
             //查看该公司非会员公司,只能允许试用三天,超时不可登录
             Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", userList.get(0).getCompanyId()));
             //公司未办理会员
@@ -99,7 +96,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return httpRespMsg;
     }
 
-    //登录网页
+    //登录PC
     @Override
     public HttpRespMsg loginEmployee(String username, String password) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/CodeGenerator.java

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

+ 4 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/DepartmentMapper.xml

@@ -20,7 +20,8 @@
         SELECT SUM(b.working_time) AS time, SUM(b.working_time * a.cost) AS money
         FROM user AS a
         LEFT JOIN report AS b ON a.id = b.creator_id
-        WHERE a.department_id IN
+        WHERE b.state = 1
+        AND a.department_id IN
         <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
             #{departmentId}
         </foreach>
@@ -33,7 +34,8 @@
         FROM user AS a
         LEFT JOIN report AS b ON a.id = b.creator_id
         LEFT JOIN project AS c ON b.project_id = c.id
-        WHERE a.department_id IN
+        WHERE b.state = 1
+        AND a.department_id IN
         <foreach collection="departmentIds" item="departmentId" index="index" open="(" close=")" separator=",">
             #{departmentId}
         </foreach>

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -17,7 +17,7 @@
     <!--获取查询者所在公司每个项目的工时成本-->
     <select id="getParticipatedProject" resultType="java.util.Map">
         SELECT id, project_name AS projectName
-        FROM project AS a
+        FROM project
         WHERE id IN (
             SELECT project_id
             FROM participation
@@ -33,6 +33,7 @@
         LEFT JOIN report AS b ON b.project_id = a.id
         JOIN user AS c ON b.creator_id = c.id
         WHERE a.company_id = #{companyId}
+        AND b.state = 1
         GROUP BY a.id
         ORDER BY a.id ASC
     </select>
@@ -43,6 +44,7 @@
         FROM report AS a
         JOIN user AS b ON a.creator_id = b.id
         WHERE a.project_id = #{projectId}
+        AND a.state = 1
         GROUP BY b.id
         ORDER BY b.id ASC
     </select>

+ 4 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -10,12 +10,13 @@
         <result column="create_date" property="createDate"/>
         <result column="working_time" property="workingTime"/>
         <result column="content" property="content"/>
+        <result column="state" property="state"/>
         <result column="create_time" property="createTime"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, creator_id, project_id, create_date, working_time, content, create_time
+        id, creator_id, project_id, create_date, working_time, content, state, create_time
     </sql>
 
     <!--根据日期获取全部报告信息-->
@@ -24,9 +25,9 @@
         FROM report AS a
         JOIN project AS b ON a.project_id=b.id
         LEFT JOIN user AS c ON a.creator_id=c.id
-        WHERE 1=1
+        WHERE a.state = 1
         <if test="date != null and date != ''">
-            AND a.create_date=#{date}
+            AND a.create_date = #{date}
         </if>
         ORDER BY a.creator_id ASC
     </select>