ソースを参照

任务相关日报接口

seyason 2 年 前
コミット
e69a0e76e3

+ 6 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuditWorkflowSettingController.java

@@ -12,6 +12,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.AuditWorkflowSettingService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RequestParam;
@@ -114,8 +115,12 @@ public class AuditWorkflowSettingController {
     }
 
     @RequestMapping("/get")
-    public HttpRespMsg get(Integer deptId, @RequestParam Integer type) {
+    public HttpRespMsg get(String userId, Integer deptId, @RequestParam Integer type) {
         HttpRespMsg msg = new HttpRespMsg();
+        //按照传入的用户取他的部门
+        if (!StringUtils.isEmpty(userId)) {
+            deptId = userMapper.selectById(userId).getDepartmentId();
+        }
         msg.data = auditWorkflowSettingService.get(deptId, type);
         return msg;
     }

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

@@ -82,6 +82,14 @@ public class ReportController {
     private UserCorpwxTimeMapper userCorpwxTimeMapper;
 
 
+    //获取任务相关的日报列表
+    @RequestMapping("/getTaskReportList")
+    public HttpRespMsg getTaskReportList(Integer taskId) {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = reportService.getTaskReportList(taskId);
+        return msg;
+    }
+
 
     /**
      * 根据时间 按照人分类 获取报告信息

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -67,6 +67,8 @@ public interface ReportMapper extends BaseMapper<Report> {
 
     List<Map<String, Object>> getUserReportByDate(@Param("date") String date, @Param("userIds") List<String> userIds);
 
+    List<Map<String, Object>> getReportByTask(@Param("taskId") Integer taskId);
+
     List<Map<String, Object>> getReportNameByDate(@Param("date") String date, @Param("companyId") Integer companyId, @Param("leaderId") String leaderId);
 
     List<Map<String, Object>> getReportNameByDateAndDept(@Param("date") String date,

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ReportService.java

@@ -11,6 +11,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -96,4 +97,6 @@ public interface ReportService extends IService<Report> {
     HttpRespMsg uploadThirdReportData(String yearMonth,HttpServletRequest request);
 
     HttpRespMsg pushReportDataToThird(String yearMonth,HttpServletRequest request);
+
+    List<Map<String, Object>> getTaskReportList(Integer taskId);
 }

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

@@ -3,6 +3,7 @@ package com.management.platform.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.AuditWorkflowSetting;
 import com.management.platform.entity.Department;
+import com.management.platform.entity.User;
 import com.management.platform.mapper.AuditWorkflowSettingMapper;
 import com.management.platform.mapper.DepartmentMapper;
 import com.management.platform.mapper.ReportMapper;
@@ -10,6 +11,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.AuditWorkflowSettingService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -32,8 +34,6 @@ public class AuditWorkflowSettingServiceImpl extends ServiceImpl<AuditWorkflowSe
     @Resource
     AuditWorkflowSettingMapper auditWorkflowSettingMapper;
     @Resource
-    UserMapper userMapper;
-    @Resource
     DepartmentMapper departmentMapper;
 
     @Override

+ 14 - 14
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -104,20 +104,20 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             }
             List<Contract> contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate);
             List<Contract> total = contractMapper.selectContract(user.getCompanyId(), null, null, number, name, typeName, status, startDate, endDate);
-            for (Contract contract : contracts) {
-                List<ContractDocument> fileUrl = contractDocumentMapper.selectList(new QueryWrapper<ContractDocument>().eq("contract_id", id).eq("is_deleted",0));
-                List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
-                WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-                for (ContractDocument contractDocument : fileUrl) {
-                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                        for (User item : users) {
-                            if (item.getId().equals(contractDocument.getCreatorId())){
-                                contractDocument.setCreatorName(item.getCorpwxUserid());
-                            }
-                        }
-                    }
-                }
-            }
+//            for (Contract contract : contracts) {
+//                List<ContractDocument> fileUrl = contractDocumentMapper.selectList(new QueryWrapper<ContractDocument>().eq("contract_id", id).eq("is_deleted",0));
+//                List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", user.getCompanyId()));
+//                WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
+//                for (ContractDocument contractDocument : fileUrl) {
+//                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+//                        for (User item : users) {
+//                            if (item.getId().equals(contractDocument.getCreatorId())){
+//                                contractDocument.setCreatorName(item.getCorpwxUserid());
+//                            }
+//                        }
+//                    }
+//                }
+//            }
             HashMap<String, Object> map = new HashMap<>();
             map.put("data",contracts);
             map.put("total",total.size());

+ 6 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -861,14 +861,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 reportAuditorSettingService.saveOrUpdateBatch(collect);
             }
         }
-        //插入所有动态和任务进展
-        ArrayList<TaskComment> taskComments = new ArrayList<>();
-        ArrayList<TaskProgress> taskProgresses = new ArrayList<>();
-        for (Report report : reportList) {
-            TaskComment taskComment = new TaskComment();
-            taskComment.setCreateTime(LocalDateTime.now());
-//            taskComment.setUserName(report.get);
-        }
 
         return httpRespMsg;
     }
@@ -5171,6 +5163,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         return msg;
     }
 
+    @Override
+    public List<Map<String, Object>> getTaskReportList(Integer taskId) {
+        List<Map<String, Object>> reportList = reportMapper.getReportByTask(taskId);
+        return reportList;
+    }
+
     private void selfUpdateToNextWorkFlow(Integer companyId, User auditTargetUser, List<Integer> targetRids, List<Department> allDepts) {
         List<AuditWorkflowTimeSetting> settings = auditWorkflowTimeSettingMapper.selectList(
                 new QueryWrapper<AuditWorkflowTimeSetting>().eq("company_id", companyId)

+ 14 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -261,17 +261,30 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             String jumpUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
 
             if (StringUtils.isEmpty(pageRouter)) {
-                title = "通知";
+                title = "消息通知";
                 jumpUrl = jumpUrl.replace("STATE", "0");
+                if (msgType.equals(TEXT_CARD_MSG_REPORT_DENY)) {
+                    title = "日报驳回";
+                } else if (msgType.equals(TEXT_CARD_MSG_REPORT_AGREE)) {
+                    title = "日报审核通过";
+                }
             } else {
                 jumpUrl = jumpUrl.replace("STATE", pageRouter);
                 if ("awayOffice".equals(pageRouter)) {
                     //出差
                     title = "出差通知";
+                    if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_WAITING_AUDIT)) {
+                        title = "出差待审核";
+                    } else if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_AGREE)) {
+                        title = "出差审核通过";
+                    } else if (msgType.equals(TEXT_CARD_MSG_BUSTRIP_DENY)) {
+                        title = "出差审核驳回";
+                    }
                 }
             }
             cardJson.put("title", title);
             cardJson.put("description", msg);
+            cardJson.put("url", jumpUrl);
             reqParam.put("textcard", cardJson);
 
             HttpEntity<String> requestEntity = new HttpEntity<String>(reqParam.toJSONString(), headers);

+ 22 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ReportMapper.xml

@@ -284,6 +284,28 @@
         ORDER BY a.creator_id ASC
     </select>
 
+    <!--根据任务id,全部报告信息-->
+    <select id="getReportByTask" resultType="java.util.Map">
+        SELECT a.id,my.id as userId,  my.name as userName, a.project_id as projectId,b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType, a.cost, a.report_time_type as reportTimeType, a.start_time as startTime,
+        a.end_time as endTime, b.incharger_id as inchargerId,b.project_code as projectCode,
+        a.creator_id as creatorId, d.name as subProjectName,a.task_id as taskId, task.name as taskName, a.is_overtime as isOvertime,a.progress as progress,
+        a.department_audit_state as departmentAuditState, a.stage, a.pic_str as picStr, multi_worktime as multiWorktime
+        , reject_reason as rejectReason, reject_username as rejectUsername, reject_userid as rejectUserid, degree_id as degree_id,report_extra_degree.name as degreeName,
+        department.department_name as auditDeptName, a.is_dept_audit as isDeptAudit, a.project_audit_state as projectAuditState,task_group.name as groupName,a.group_id as groupId, a.custom_data as customData
+        ,u.name as projectAuditorName, a.project_auditor_id as projectAuditorId, a.overtime_hours as overtimeHours, a.custom_text as customText,a.evaluate as evaluate,a.report_auto_approve as reportAutoApprove
+        FROM report AS a
+        JOIN project AS b ON a.project_id=b.id
+        left join sub_project as d on d.id = a.sub_project_id
+        left join task on task.id = a.task_id
+        left join report_extra_degree on report_extra_degree.id = a.degree_id
+        left join department on department.department_id = a.audit_deptid
+        left join task_group on task_group.id = a.group_id
+        left join user u on u.id = a.project_auditor_id
+        left join user my on my.id = a.creator_id
+        WHERE a.task_id=#{taskId}
+        ORDER BY a.id desc
+    </select>
+
     <!--根据项目经理id,日期获取相关项目的全部报告信息-->
     <select id="getInchargeReportByDate" resultType="java.util.Map">
         SELECT a.id, a.project_id as projectId, b.project_name AS project, a.working_time AS time, a.content, a.state, a.time_type as timeType,