From ba8285c918589357e7232254e2c39cc85968cd16 Mon Sep 17 00:00:00 2001 From: Chujinwang <17638147107@163.com> Date: Wed, 31 Jul 2024 15:16:29 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/project/vo/EmployeeVO.java | 10 + .../inspection/work/po/WrkAuditRule.java | 6 + .../inspection/work/vo/WrkAuditRuleDTO.java | 4 + .../controller/WrkProjectController.java | 34 ++ .../service/WrkProjectPaymentService.java | 4 +- .../project/service/WrkProjectService.java | 38 +- .../inspection/work/mapper/WrkInfoMapper.java | 3 + .../work/service/WrkInfoService.java | 7 +- .../service/impl/WrkAuditRuleServiceImpl.java | 20 + .../work/service/impl/WrkInfoServiceImpl.java | 36 +- .../main/resources/mapper/WrkInfoMapper.xml | 382 +++++++++--------- .../mapper/WrkProjectPaymentMapper.xml | 1 - .../system/remote/RemoteUserController.java | 9 + 13 files changed, 351 insertions(+), 203 deletions(-) diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/vo/EmployeeVO.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/vo/EmployeeVO.java index d6d2630..91aea15 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/vo/EmployeeVO.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/vo/EmployeeVO.java @@ -11,6 +11,11 @@ import java.time.LocalDateTime; @Data public class EmployeeVO { + + private String projectName; + + private String taskName; + private Long userId; private Long projectId; @@ -56,5 +61,10 @@ public class EmployeeVO { */ private Integer terminalNum; + /** + * 新增商户数 + */ + private Integer storeNum; + } diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/po/WrkAuditRule.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/po/WrkAuditRule.java index 1c57750..4e3eb36 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/po/WrkAuditRule.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/po/WrkAuditRule.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import com.chushang.common.dict.annotation.DictFormat; import com.chushang.common.mybatis.base.BaseEntity; import lombok.AllArgsConstructor; import lombok.Data; @@ -11,6 +12,7 @@ import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import java.time.LocalDateTime; +import java.util.List; /** * @auther: zhao @@ -81,6 +83,7 @@ public class WrkAuditRule extends BaseEntity { * 单位 */ @TableField(value = "number_type") + @DictFormat(dictType = "sys_auditTime_type") private Integer numberType; /** @@ -89,4 +92,7 @@ public class WrkAuditRule extends BaseEntity { @TableField(value = "number_wrk") private Integer numberWrk; + + @TableField(exist = false) + private List ruleTimeList; } diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/vo/WrkAuditRuleDTO.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/vo/WrkAuditRuleDTO.java index 9f6ae05..e9fe478 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/vo/WrkAuditRuleDTO.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/work/vo/WrkAuditRuleDTO.java @@ -7,6 +7,7 @@ import com.chushang.common.mybatis.page.CommonParam; import lombok.*; import java.time.LocalDateTime; +import java.util.List; @Data @Builder @@ -78,4 +79,7 @@ public class WrkAuditRuleDTO { private Integer numberWrk; + @TableField(exist = false) + private List ruleTimeList; + } diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java index 8e21880..e4926fe 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java @@ -201,6 +201,40 @@ public class WrkProjectController { return AjaxResult.success(projectService.empData(projectQuery)); } + /** + * 人工数据详情 + */ + @GetMapping(value = "/detail/{userId}") +// @RequiresPermissions("inspection:project:info") + public AjaxResult detail(@PathVariable Long userId) + { + return AjaxResult.success(projectService.empDetail(userId)); + } + + /** + * 项目数据导出 + * @param projectQuery 查询条件 + */ + @SysLog(value = "项目数据", businessType = BusinessType.EXPORT) + @GetMapping(value = "/emp/data/export") +// @RequiresPermissions("inspection:project:export") + public AjaxResult empDataExport(ProjectQuery projectQuery) + { + return AjaxResult.success("人员数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]"); + } + + /** + * 财务数据导出 + * @param projectQuery 查询条件 + */ + @SysLog(value = "财务数据", businessType = BusinessType.EXPORT) + @GetMapping(value = "/payMentData/data/export") +// @RequiresPermissions("inspection:project:export") + public AjaxResult payMentDataExport(ProjectQuery projectQuery) + { + return AjaxResult.success("财务数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]"); + } +// } diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectPaymentService.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectPaymentService.java index 259f630..de3b444 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectPaymentService.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectPaymentService.java @@ -40,10 +40,10 @@ public class WrkProjectPaymentService extends ServiceImpl payMentData(WrkProjectPayment query, CommonParam commonParam) + public PageResult payMentData(WrkProjectPayment query, CommonParam commonParam) { Page page = new Page<>(commonParam.getPage(), commonParam.getLimit()); - return baseMapper.payMentData(query,page); + return new PageResult(baseMapper.payMentData(query,page),page.getTotal(),page.getSize(),page.getCurrent()); } /** diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectService.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectService.java index fb0150c..54f2397 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectService.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/service/WrkProjectService.java @@ -304,13 +304,13 @@ public class WrkProjectService extends ServiceImpl return remoteTaskService.createTask(CreateTaskDTO.builder() .params(JSON.toJSONString(projectQuery)) - .taskName("项目数据导出") + .taskName("人员数据导出") .applicationName(ServiceEnum.INSPECTION) .methodName("export") .className(this.getClass().getName()) .deptId(SecurityUtils.getDeptId()) .taskType(TaskTypeEnum.DOWN) - .remark("五统一商户明细导出") + .remark("人员数据明细导出") .createBy(SecurityUtils.getUsername()) .build(), SecurityConstants.INNER).getData(); } @@ -380,11 +380,33 @@ public class WrkProjectService extends ServiceImpl } public PageResult empData(ProjectQuery projectQuery) { - CommonParam commonParam = CommonParam.buildPageRequest(); - Page page = new Page<>(commonParam.getPage(), commonParam.getLimit()); - List employeeVOList1 = wrkInfoService.empData( - projectQuery - ); - return new PageResult(employeeVOList1,page.getTotal(),page.getSize(),page.getCurrent()); + return wrkInfoService.empData(projectQuery); } + + public PageResult empDetail(Long userId){ + return wrkInfoService.detailData(userId); + } + + @DataScope + public Long empDataExport(ProjectQuery projectQuery) { + + LambdaQueryWrapper sql = WrapperUtils.builder(projectQuery, CommonParam.buildAllRequest()); + long recordList = this.count( + sql + ); + AssertUtil.invalidate (recordList <= 0, "导出数据为空"); + + return remoteTaskService.createTask(CreateTaskDTO.builder() + .params(JSON.toJSONString(projectQuery)) + .taskName("项目数据导出") + .applicationName(ServiceEnum.INSPECTION) + .methodName("export") + .className(this.getClass().getName()) + .deptId(SecurityUtils.getDeptId()) + .taskType(TaskTypeEnum.DOWN) + .remark("五统一商户明细导出") + .createBy(SecurityUtils.getUsername()) + .build(), SecurityConstants.INNER).getData(); + } + } diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/mapper/WrkInfoMapper.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/mapper/WrkInfoMapper.java index a0120e2..0f37cd4 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/mapper/WrkInfoMapper.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/mapper/WrkInfoMapper.java @@ -41,4 +41,7 @@ public interface WrkInfoMapper extends BaseMapper { @Param("wrkTypes") Set wrkTypes); List empData(@Param("query") ProjectQuery projectQuery, Page page); + + + List empDetail(@Param("userId") Long userId, Page page); } diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/WrkInfoService.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/WrkInfoService.java index c788f84..f27f242 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/WrkInfoService.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/WrkInfoService.java @@ -1,7 +1,9 @@ package com.chushang.inspection.work.service; import cn.hutool.core.collection.CollectionUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.chushang.common.mybatis.utils.PageResult; +import com.chushang.common.mybatis.utils.WrapperUtils; import com.chushang.inspection.project.dto.AuditDTO; import com.chushang.inspection.project.query.ProjectQuery; import com.chushang.inspection.project.vo.CountVO; @@ -55,7 +57,10 @@ public interface WrkInfoService extends IService { List countByProjectIds(Set projectIds, Set wrkType); - List empData(ProjectQuery projectQuery); + PageResult empData(ProjectQuery projectQuery); + + PageResult detailData(Long userId); + default Map countByProjectIdsMap(Set projectIds, Set wrkType){ List countVOS = countByProjectIds(projectIds, wrkType); if (CollectionUtil.isNotEmpty(countVOS)){ diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/impl/WrkAuditRuleServiceImpl.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/impl/WrkAuditRuleServiceImpl.java index fc96d7b..ba2cc51 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/impl/WrkAuditRuleServiceImpl.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/impl/WrkAuditRuleServiceImpl.java @@ -86,12 +86,28 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl date = new HashMap<>(); + date.put("1","周一"); + date.put("2","周二"); + date.put("3","周三"); + date.put("4","周四"); + date.put("5","周五"); + date.put("6","周六"); + date.put("7","周日"); CommonParam commonParam = CommonParam.buildPageRequest(); LambdaQueryWrapper queryWrapper = WrapperUtils.builder(query, commonParam); IPage page = this.page( new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()), queryWrapper ); + for (WrkAuditRule record : page.getRecords()) { + List list = new ArrayList<>(); + for (String s : record.getRuleTime().split(",")) { + list.add(date.get(s)); + } + record.setRuleTimeList(Arrays.asList(String.join(",", list))); + } + return new PageResult(page); } @@ -101,6 +117,9 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl impl } @Override - public List empData(ProjectQuery projectQuery) { + public PageResult empData(ProjectQuery projectQuery) { CommonParam commonParam = CommonParam.buildPageRequest(); Page page = new Page<>(commonParam.getPage(), commonParam.getLimit()); List employeeVOList = baseMapper.empData(projectQuery, page); @@ -685,20 +685,44 @@ public class WrkInfoServiceImpl extends ServiceImpl impl = remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER); Map userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER); + System.out.println(JSON.toJSONString(userNameByIds)); // 被派单次数 - - LambdaQueryWrapper configSql = WrapperUtils.builder(); configSql.in(WrkInfo::getUserId, userIds); // 查询全部工单 for (EmployeeVO employeeVO:employeeVOList){ employeeVO.setDeptName(deptNameMap.get(employeeVO.getDeptId())); - employeeVO.setProjectConcat(userNameByIds.get(employeeVO.getUserId()).getNickName()); - employeeVO.setProjectPhone(userNameByIds.get(employeeVO.getUserId()).getPhone()); + employeeVO.setProjectConcat(userNameByIds.get(employeeVO.getUserId()) == null ?"admin":userNameByIds.get(employeeVO.getUserId()).getNickName()); + employeeVO.setProjectPhone(userNameByIds.get(employeeVO.getUserId())== null ? "17638147107":userNameByIds.get(employeeVO.getUserId()).getPhone()); } - return employeeVOList; + return new PageResult(employeeVOList,page.getTotal(),page.getSize(),page.getCurrent()); + } + + @Override + public PageResult detailData(Long userId) { + CommonParam commonParam = CommonParam.buildPageRequest(); + Page page = new Page<>(commonParam.getPage(), commonParam.getLimit()); + List employeeVOList = baseMapper.empDetail(userId,page); + Set deptIds = employeeVOList.stream().map(EmployeeVO::getDeptId).collect(Collectors.toSet()); + Set userIds = employeeVOList.stream().map(EmployeeVO::getUserId).collect(Collectors.toSet()); + // 查询全部部门 + Map deptNameMap + = remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER); + + Map userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER); + // 被派单次数 + LambdaQueryWrapper configSql = WrapperUtils.builder(); + configSql.in(WrkInfo::getUserId, userIds); + + // 查询全部工单 + for (EmployeeVO employeeVO:employeeVOList){ + employeeVO.setDeptName(deptNameMap.get(employeeVO.getDeptId())); + employeeVO.setProjectConcat(userNameByIds.get(employeeVO.getUserId()) == null ?"admin":userNameByIds.get(employeeVO.getUserId()).getNickName()); + employeeVO.setProjectPhone(userNameByIds.get(employeeVO.getUserId())== null ? "17638147107":userNameByIds.get(employeeVO.getUserId()).getPhone()); + } + return new PageResult(employeeVOList,page.getTotal(),page.getSize(),page.getCurrent()); } /** diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkInfoMapper.xml b/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkInfoMapper.xml index 156f92b..cb88245 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkInfoMapper.xml +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkInfoMapper.xml @@ -2,10 +2,10 @@ - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - SELECT - i.wrk_id, - i.`dept_id`, - i.`task_id`, - i.`lower_task_id`, - i.`user_id`, - i.`user_name`, - i.`work_no`, - i.`work_type`, - i.`work_method`, - i.`work_sort`, - i.`work_source`, - i.`dispose_time`, - i.`account_manager`, - i.`account_phone`, - i.`service_result`, - i.`remark`, - i.`end_time`, - i.`create_by`, - i.`create_time`, - i.`task_name`, - i.`lower_task_name`, - i.`dept_name`, - i.`wrk_status`, + SELECT i.wrk_id, + i.`dept_id`, + i.`task_id`, + i.`lower_task_id`, + i.`user_id`, + i.`user_name`, + i.`work_no`, + i.`work_type`, + i.`work_method`, + i.`work_sort`, + i.`work_source`, + i.`dispose_time`, + i.`account_manager`, + i.`account_phone`, + i.`service_result`, + i.`remark`, + i.`end_time`, + i.`create_by`, + i.`create_time`, + i.`task_name`, + i.`lower_task_name`, + i.`dept_name`, + i.`wrk_status`, - isr.`store_id`, - isr.`state`, - isr.`store_no`, - isr.`store_name`, - isr.`store_contact`, - isr.`store_phone`, - isr.`store_address`, - isr.`special_num`, - isr.`shop_name`, - isr.`store_type`, - isr.`products`, - isr.`tip_tool`, - isr.`ins_fre`, - isr.`register_address`, - isr.`legal_name`, + isr.`store_id`, + isr.`state`, + isr.`store_no`, + isr.`store_name`, + isr.`store_contact`, + isr.`store_phone`, + isr.`store_address`, + isr.`special_num`, + isr.`shop_name`, + isr.`store_type`, + isr.`products`, + isr.`tip_tool`, + isr.`ins_fre`, + isr.`register_address`, + isr.`legal_name`, - itir.`geographic_location`, - itir.`geographic_address`, - itir.`work_location`, - itir.`work_address`, - itir.`deviation`, - itir.`pre_code_encoding`, - itir.`service_result`, - itir.`deviation`, - itir.`storage_time`, - itir.`delivery_time`, - itir.`times_pass`, - itir.`inspection_status`, - itir.`inspection_time`, + itir.`geographic_location`, + itir.`geographic_address`, + itir.`work_location`, + itir.`work_address`, + itir.`deviation`, + itir.`pre_code_encoding`, + itir.`service_result`, + itir.`deviation`, + itir.`storage_time`, + itir.`delivery_time`, + itir.`times_pass`, + itir.`inspection_status`, + itir.`inspection_time`, - itr.`terminal_id`, - itr.`terminal_sn`, - itr.`terminal_type`, - itr.`terminal_model`, - itr.`terminal_no`, - itr.`terminal_source`, - itr.`terminal_address`, - itr.`terminal_version`, - itr.`terminal_property`, - itr.`terminal_status` - FROM - `wrk_info` i - LEFT JOIN wrk_info_store_record isr ON i.wrk_id = isr.wrk_id - LEFT JOIN wrk_info_terminal_record itr ON i.wrk_id = itr.wrk_id - LEFT JOIN wrk_info_terminal_ins_record itir ON i.wrk_id = itir.wrk_id + itr.`terminal_id`, + itr.`terminal_sn`, + itr.`terminal_type`, + itr.`terminal_model`, + itr.`terminal_no`, + itr.`terminal_source`, + itr.`terminal_address`, + itr.`terminal_version`, + itr.`terminal_property`, + itr.`terminal_status` + FROM `wrk_info` i + LEFT JOIN wrk_info_store_record isr ON i.wrk_id = isr.wrk_id + LEFT JOIN wrk_info_terminal_record itr ON i.wrk_id = itr.wrk_id + LEFT JOIN wrk_info_terminal_ins_record itir ON i.wrk_id = itir.wrk_id WHERE i.del_state = 0 @@ -270,12 +268,26 @@ + + diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkProjectPaymentMapper.xml b/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkProjectPaymentMapper.xml index edb65b3..926b3b9 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkProjectPaymentMapper.xml +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/resources/mapper/WrkProjectPaymentMapper.xml @@ -5,7 +5,6 @@