瀏覽代碼

未填报人员统计导出 填报及时率接口修改 人员可提前填报状态设置

yurk 2 年之前
父節點
當前提交
c2127178da

+ 8 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -496,5 +496,13 @@ public class ProjectController {
     public HttpRespMsg exportReportTimelinessRate(HttpServletRequest request,String startDate,String endDate){
         return projectService.exportReportTimelinessRate(request,startDate,endDate);
     }
+    @RequestMapping("/getWaitingReviewList")
+    public HttpRespMsg getWaitingReviewList(HttpServletRequest request,Integer stateKey,String userId,Integer departmentId,Integer projectId,Integer pageIndex,Integer pageSize,String startDate,String endDate){
+        return projectService.getWaitingReviewList(request,stateKey,userId,departmentId,projectId,pageIndex,pageSize,startDate,endDate);
+    }
+    @RequestMapping("/exportWaitingReviewList")
+    public HttpRespMsg exportWaitingReviewList(HttpServletRequest request,Integer stateKey,String userId,Integer departmentId,Integer projectId,String startDate,String endDate){
+        return projectService.exportWaitingReviewList(request,stateKey,userId,departmentId,projectId,startDate,endDate);
+    }
 }
 

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import java.util.List;
  * </p>
  *
  * @author Seyason
- * @since 2022-06-23
+ * @since 2022-06-24
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -254,6 +254,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("work_content_state")
     private Integer workContentState;
 
+    /**
+     * 0-不可提前填报 1-可提前填报
+     */
+    @TableField("fill_ahead")
+    private Integer fillAhead;
+
     @TableField(exist = false)
     private List<User> userList;
 

+ 8 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ProjectMapper.java

@@ -96,4 +96,12 @@ public interface ProjectMapper extends BaseMapper<Project> {
     List<Map<String, Object>> getUserWorkingTimeList(String userId, Integer companyId, String startDate, String endDate, Integer projectId, Integer start, Integer size);
 
     long findCountWithUser(String userId, Integer companyId, String startDate, String endDate, Integer projectId, Integer start,Integer size);
+
+    List<Map<String, Object>> getWaitingReviewListByDepartment(Integer companyId, String userId, Integer departmentId,Integer start,Integer size,String startDate,String endDate);
+
+    List<Map<String, Object>> getWaitingReviewListByProject(Integer companyId, String userId, Integer projectId,Integer start,Integer size,String startDate,String endDate);
+
+    long findCountWithDepartment(Integer companyId, String userId, Integer departmentId, Integer start, Integer size,String startDate,String endDate);
+
+    long findCountWithProject(Integer companyId, String userId, Integer projectId, Integer start, Integer size,String startDate,String endDate);
 }

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectService.java

@@ -139,4 +139,8 @@ public interface ProjectService extends IService<Project> {
     HttpRespMsg getUserReportTimelinessRate(HttpServletRequest request, String startDate, String endDate, Integer departmentId, String userId,Integer pageIndex,Integer pageSize);
 
     HttpRespMsg exportReportTimelinessRate(HttpServletRequest request, String startDate, String endDate);
+
+    HttpRespMsg getWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId, Integer departmentId,Integer projectId,Integer pageIndex,Integer pageSize,String startDate,String endDate);
+
+    HttpRespMsg exportWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId, Integer departmentId, Integer projectId,String startDate,String endDate);
 }

+ 5 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -333,10 +333,6 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                     if(codeCell==null){
                         continue;
                     }
-                    if(happenDateCell.toString().trim().equals("")||happenDateCell==null){
-                        msg.setError("费用日期不能为空");
-                        return msg;
-                    }
                     ExpenseItem expenseItem = new ExpenseItem();
                     System.out.println(codeCell.getStringCellValue());
                     Optional<Project> project = projectList.stream().filter(pro ->(StringUtils.isEmpty(pro.getProjectCode())?"":pro.getProjectCode()).equals(codeCell.getStringCellValue())
@@ -347,9 +343,11 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                         throw new Exception("项目编号/项目名称为[" + codeCell.getStringCellValue() + "]的项目不存在");
                     }
                     expenseItem.setExpenseId(expenseSheet.getId());
-                    LocalDate happenDate = Instant.ofEpochMilli(happenDateCell.getDateCellValue().getTime())
-                            .atZone(ZoneId.systemDefault()).toLocalDate();
-                    expenseItem.setHappenDate(String.valueOf(happenDate));
+                    if(!happenDateCell.toString().trim().equals("")&&happenDateCell!=null){
+                        LocalDate happenDate = Instant.ofEpochMilli(happenDateCell.getDateCellValue().getTime())
+                                .atZone(ZoneId.systemDefault()).toLocalDate();
+                        expenseItem.setHappenDate(String.valueOf(happenDate));
+                    }
                     if(invoiceTypeCell!=null){
                         switch (invoiceTypeCell.getStringCellValue()) {
                             case "增值税专用发票":

+ 62 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -3191,6 +3191,68 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         return httpRespMsg;
     }
 
+    @Override
+    public HttpRespMsg getWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId, Integer departmentId,Integer projectId,Integer pageIndex,Integer pageSize,String startDate,String endDate) {
+        HttpRespMsg msg=new HttpRespMsg();
+        User user = userMapper.selectById(request.getHeader("token"));
+        List<Map<String,Object>> list;
+        Integer size;
+        Integer start;
+        if(pageIndex!=null&&pageSize!=null){
+            size=pageSize;
+            start=(pageIndex-1)*size;
+        }else {
+            size=null;
+            start=null;
+        }
+        long total;
+        if(stateKey==0){
+            list=projectMapper.getWaitingReviewListByDepartment(user.getCompanyId(),userId,departmentId,start,size,startDate,endDate);
+            total=projectMapper.findCountWithDepartment(user.getCompanyId(),userId,departmentId,null,null,startDate,endDate);
+        }else {
+            list=projectMapper.getWaitingReviewListByProject(user.getCompanyId(),userId,projectId,start,size,startDate,endDate);
+            total=projectMapper.findCountWithProject(user.getCompanyId(),userId,projectId,null,null,startDate,endDate);
+        }
+        HashMap map=new HashMap();
+        map.put("total",total);
+        map.put("result",list);
+        msg.data=map;
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg exportWaitingReviewList(HttpServletRequest request, Integer stateKey, String userId, Integer departmentId, Integer projectId,String startDate,String endDate) {
+        HttpRespMsg msg = getWaitingReviewList(request, stateKey, userId, departmentId, projectId, null, null,startDate,endDate);
+        HashMap resultmap= (HashMap) msg.data;
+        List<Map<String,Object>> list= (List<Map<String, Object>>) resultmap.get("result");
+        List<List<String>> dataList=new ArrayList<>();
+        String[] s;
+        String fileName;
+        if(stateKey==0){
+            s= new String[]{"人员", "部门", "待审核数量"};
+            fileName = "人员部门待审核统计_"+System.currentTimeMillis();
+        }else {
+            s= new String[]{"人员", "项目", "待审核数量"};
+            fileName = "人员项目待审核统计_"+System.currentTimeMillis();
+        }
+        dataList.add(Arrays.asList(s));
+        for (Map<String, Object> map : list) {
+            List<String> item=new ArrayList<>();
+            item.add(String.valueOf(map.get("userName")));
+            if(stateKey==0){
+                item.add(String.valueOf(map.get("departmentName")));
+            }else {
+                item.add(String.valueOf(map.get("projectName")));
+            }
+            item.add(String.valueOf(map.get("num")));
+            dataList.add(item);
+        }
+        //生成excel文件导出
+        String resp = ExcelUtil.exportGeneralExcelByTitleAndList(fileName , dataList, path);
+        msg.data = resp;
+        return msg;
+    }
+
 
     private List<Department> getSubDepts(Department dp, List<Department> list) {
         List<Department> collect = list.stream().filter(l -> dp.getDepartmentId().equals(l.getSuperiorId())).collect(Collectors.toList());

+ 72 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -639,5 +639,77 @@
         </if>
     </select>
 
+    <select id="getWaitingReviewListByDepartment" resultType="java.util.Map">
+        select us.name as userName,dp.department_name as departmentName,COUNT((rp.state=0 or null) and ( rp.is_dept_audit =1 or null)) as num
+        from user us
+        left join department dp on us.manage_dept_id =dp.department_id
+        left join report rp on rp.audit_deptid=dp.department_id
+        where us.company_id=#{companyId} and  us.manage_dept_id !=0 and rp.create_date between #{startDate} and #{endDate} and us.is_active=1
+        <if test="departmentId!=null">
+            and dp.department_id=#{departmentId}
+        </if>
+        <if test="userId!=null">
+            and us.id=#{userId}
+        </if>
+        group by dp.department_id,us.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>
+    </select>
+
+    <select id="getWaitingReviewListByProject" resultType="java.util.Map">
+        select us.name as userName,project.project_name as projectName,COUNT((rp.state=0 or null) and ( rp.is_dept_audit =0 or null)) as num
+        from user us
+        left join report rp on rp.project_auditor_id=us.id
+        left join project on project.id=rp.project_id
+        where us.company_id=#{companyId} and rp.project_id is not null and rp.create_date between #{startDate} and #{endDate}  and us.is_active=1
+        <if test="projectId!=null">
+            and project.id=#{projectId}
+        </if>
+        <if test="userId!=null">
+            and us.id=#{userId}
+        </if>
+        group by project.id,us.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>
+    </select>
+
+    <select id="findCountWithDepartment" resultType="java.lang.Long">
+        select  count(1)
+        from (select us.name as userName,dp.department_name as departmentName,COUNT((rp.state=0 or null) and ( rp.is_dept_audit =1 or null)) as num
+        from user us
+        left join department dp on us.manage_dept_id =dp.department_id
+        left join report rp on rp.audit_deptid=dp.department_id
+        where us.company_id=#{companyId} and  us.manage_dept_id !=0 and rp.create_date between #{startDate} and #{endDate}  and us.is_active=1
+        <if test="departmentId!=null">
+            and dp.department_id=#{departmentId}
+        </if>
+        <if test="userId!=null">
+            and us.id=#{userId}
+        </if>
+        group by dp.department_id,us.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>) total
+    </select>
 
+    <select id="findCountWithProject" resultType="java.lang.Long">
+        select  count(1)
+        from (select us.name as userName,project.project_name as projectName,COUNT((rp.state=0 or null) and ( rp.is_dept_audit =0 or null)) as num
+        from user us
+        left join report rp on rp.project_auditor_id=us.id
+        left join project on project.id=rp.project_id
+        where us.company_id=#{companyId} and rp.project_id is not null and rp.create_date between #{startDate} and #{endDate}  and us.is_active=1
+        <if test="projectId!=null">
+            and project.id=#{projectId}
+        </if>
+        <if test="userId!=null">
+            and us.id=#{userId}
+        </if>
+        group by project.id,us.id
+        <if test="start!=null and size!=null">
+            limit #{start},#{size}
+        </if>) total
+    </select>
 </mapper>

文件差異過大導致無法顯示
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml