Merge remote-tracking branch 'origin/master'

# Conflicts:
#	chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/work/service/impl/WrkInfoServiceImpl.java
This commit is contained in:
ant 2024-07-31 15:20:00 +08:00
commit 39873804a3
13 changed files with 352 additions and 203 deletions

View File

@ -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;
}

View File

@ -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<String> ruleTimeList;
}

View File

@ -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<String> ruleTimeList;
}

View File

@ -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) +"]");
}
//
}

View File

@ -40,10 +40,10 @@ public class WrkProjectPaymentService extends ServiceImpl<WrkProjectPaymentMappe
@Resource
WrkProjectContractService contractService;
public List<WrkProjectPaymentVO> payMentData(WrkProjectPayment query, CommonParam commonParam)
public PageResult payMentData(WrkProjectPayment query, CommonParam commonParam)
{
Page<Store> 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());
}
/**

View File

@ -305,13 +305,13 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
AssertUtil.invalidate (recordList <= 0, "导出数据为空");
CreateTaskDTO 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())
.userId(SecurityUtils.getUserId())
.build();
@ -396,11 +396,33 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
}
public PageResult empData(ProjectQuery projectQuery) {
CommonParam commonParam = CommonParam.buildPageRequest();
Page<WrkInfoDetailsVO> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
List<EmployeeVO> 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<WrkProject> 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();
}
}

View File

@ -50,4 +50,7 @@ public interface WrkInfoMapper extends BaseMapper<WrkInfo> {
List<WrkDataVO> wrkData(@Param("query") WrkDataQuery wrkDataQuery, Page<WrkDataVO> page);
List<EmployeeVO> empData(@Param("query") ProjectQuery projectQuery, Page<WrkInfo> page);
List<EmployeeVO> empDetail(@Param("userId") Long userId, Page<WrkInfo> page);
}

View File

@ -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;
@ -52,7 +54,10 @@ public interface WrkInfoService extends IService<WrkInfo> {
List<CountVO> countByProjectIds(Set<Long> projectIds, Set<Integer> wrkType);
List<EmployeeVO> empData(ProjectQuery projectQuery);
PageResult empData(ProjectQuery projectQuery);
PageResult detailData(Long userId);
default Map<Long, Integer> countByProjectIdsMap(Set<Long> projectIds, Set<Integer> wrkType){
List<CountVO> countVOS = countByProjectIds(projectIds, wrkType);
if (CollectionUtil.isNotEmpty(countVOS)){

View File

@ -86,12 +86,28 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl<WrkAuditRuleMapper, Wrk
@Override
public PageResult queryRulePage(WrkAuditRuleQuery query) {
Map<String,String> 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<WrkAuditRule> queryWrapper = WrapperUtils.builder(query, commonParam);
IPage<WrkAuditRule> page = this.page(
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()),
queryWrapper
);
for (WrkAuditRule record : page.getRecords()) {
List<String> 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<WrkAuditRuleMapper, Wrk
WrkAuditRule wrkAuditRule = this.getById(dto.getId());
Assert.notNull(wrkAuditRule, "修改失败,数据不存在");
BeanUtil.copyProperties(dto, wrkAuditRule);
if(!dto.getRuleTimeList().isEmpty()){
wrkAuditRule.setRuleTime(String.join(",", dto.getRuleTime()));
}
return this.updateById(wrkAuditRule) ? 1 : 0;
} else {
WrkAuditRule wrkAuditRule = new WrkAuditRule();
@ -108,6 +127,7 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl<WrkAuditRuleMapper, Wrk
wrkAuditRule.setId(IdUtil.getSnowflakeNextId());
wrkAuditRule.setDeptId(SecurityUtils.getDeptId());
wrkAuditRule.setUserId(SecurityUtils.getUserId());
wrkAuditRule.setRuleTime(String.join(",", dto.getRuleTime()));
return this.save(wrkAuditRule) ? 1 : 0;
}
}

View File

@ -16,6 +16,7 @@ import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chushang.common.core.constant.SecurityConstants;
import com.chushang.common.core.exception.ResultException;
import com.chushang.common.core.exception.utils.AssertUtil;
import com.chushang.common.core.util.DateUtils;
import com.chushang.common.core.util.IPUtils;
@ -792,7 +793,7 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
}
@Override
public List<EmployeeVO> empData(ProjectQuery projectQuery) {
public PageResult empData(ProjectQuery projectQuery) {
CommonParam commonParam = CommonParam.buildPageRequest();
Page<WrkInfo> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
List<EmployeeVO> employeeVOList = baseMapper.empData(projectQuery, page);
@ -803,20 +804,44 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
= remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
Map<Long, SysUser> userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER);
System.out.println(JSON.toJSONString(userNameByIds));
// 被派单次数
LambdaQueryWrapper<WrkInfo> 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<WrkInfo> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
List<EmployeeVO> employeeVOList = baseMapper.empDetail(userId,page);
Set<Long> deptIds = employeeVOList.stream().map(EmployeeVO::getDeptId).collect(Collectors.toSet());
Set<Long> userIds = employeeVOList.stream().map(EmployeeVO::getUserId).collect(Collectors.toSet());
// 查询全部部门
Map<Long, String> deptNameMap
= remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
Map<Long, SysUser> userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER);
// 被派单次数
LambdaQueryWrapper<WrkInfo> 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());
}
/**

View File

@ -2,10 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chushang.inspection.work.mapper.WrkInfoMapper">
<select id="queryDispatchPage" resultMap="wrkInfoDetailsVOResult">
<include refid="wrkInfoDetailSql" />
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<include refid="wrkInfoDetailSql"/>
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<if test="1 == 1">
${query.sqlParam.get('dataScope')}
</if>
@ -13,7 +13,7 @@
</select>
<select id="exportDispatchPage" resultType="com.chushang.inspection.work.vo.WrkInfoExportVO">
<include refid="wrkInfoDetailSql" />
<include refid="wrkInfoDetailSql"/>
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
@ -23,22 +23,22 @@
ORDER BY i.create_time desc
</select>
<resultMap id="resultWrkInfoExportVO" type="com.chushang.inspection.work.vo.WrkInfoExportVO">
<id column="terminal_id" property="terminalId" />
<result column="user_name" property="userName" />
<result column="create_time" property="createTime" />
<result column="legal_name" property="legalName" />
<result column="terminal_address" property="terminalAddress" />
<result column="terminal_no" property="terminalNo" />
<result column="terminal_sn" property="terminalSn" />
<result column="terminal_source" property="terminalSource" />
<result column="work_no" property="workNo" />
<id column="terminal_id" property="terminalId"/>
<result column="user_name" property="userName"/>
<result column="create_time" property="createTime"/>
<result column="legal_name" property="legalName"/>
<result column="terminal_address" property="terminalAddress"/>
<result column="terminal_no" property="terminalNo"/>
<result column="terminal_sn" property="terminalSn"/>
<result column="terminal_source" property="terminalSource"/>
<result column="work_no" property="workNo"/>
</resultMap>
<select id="queryArchivePage" resultMap="wrkInfoDetailsVOResult">
<include refid="wrkInfoDetailSql" />
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<include refid="wrkInfoDetailSql"/>
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<if test="1 == 1">
${query.sqlParam.get('dataScope')}
</if>
@ -46,44 +46,44 @@
</select>
<select id="queryAppPage" resultType="com.chushang.inspection.work.vo.WrkListAppVO">
SELECT i.wrk_id AS wrkId,
i.work_type AS workType,
i.task_name AS taskName,
isr.store_name AS storeName,
isr.store_contact AS storeContact,
isr.store_phone AS storePhone,
isr.ins_fre AS insFre,
itr.terminal_id AS terminalId,
itr.terminal_address AS terminalAddress,
(SELECT count(w1.wrk_id)
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}) AS numberOfPickups,
(SELECT w1.dispose_time
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}
order by w1.dispose_time desc
limit 1) AS lastDisposeTime,
(SELECT w1.service_result
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}
order by w1.dispose_time desc
limit 1) AS lastServiceResult
SELECT i.wrk_id AS wrkId,
i.work_type AS workType,
i.task_name AS taskName,
isr.store_name AS storeName,
isr.store_contact AS storeContact,
isr.store_phone AS storePhone,
isr.ins_fre AS insFre,
itr.terminal_id AS terminalId,
itr.terminal_address AS terminalAddress,
(SELECT count(w1.wrk_id)
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}) AS numberOfPickups,
(SELECT w1.dispose_time
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}
order by w1.dispose_time desc
limit 1) AS lastDisposeTime,
(SELECT w1.service_result
FROM wrk_info w1
INNER JOIN
wrk_info_terminal_record w2 ON w1.wrk_id = w2.wrk_id
WHERE w2.terminal_id = itr.terminal_id
AND w1.wrk_status = #{query.wrkStatus}
order by w1.dispose_time desc
limit 1) AS lastServiceResult
FROM wrk_info i
INNER JOIN wrk_info_store_record isr ON i.wrk_id = isr.wrk_id
INNER JOIN wrk_info_terminal_record itr ON i.wrk_id = itr.wrk_id
INNER JOIN wrk_info_store_record isr ON i.wrk_id = isr.wrk_id
INNER JOIN wrk_info_terminal_record itr ON i.wrk_id = itr.wrk_id
where i.del_state = 0
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
<if test="1 == 1">
${query.sqlParam.get('dataScope')}
</if>
@ -91,78 +91,78 @@
</select>
<resultMap id="wrkInfoDetailsVOResult" type="com.chushang.inspection.work.vo.WrkInfoDetailsVO">
<association property="wrkInfo" javaType="com.chushang.inspection.work.vo.WrkInfoVO">
<id column="wrk_id" property="wrkId" />
<result column="remark" property="remark" />
<result column="account_manager" property="accountManager" />
<result column="account_phone" property="accountPhone" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="dept_id" property="deptId" />
<result column="dept_name" property="deptName" />
<result column="dispose_time" property="disposeTime" />
<result column="end_time" property="endTime" />
<result column="lower_task_id" property="lowerTaskId" />
<result column="lower_task_name" property="lowerTaskName" />
<result column="service_result" property="serviceResult" />
<result column="task_id" property="taskId" />
<result column="task_name" property="taskName" />
<result column="user_id" property="userId" />
<result column="user_name" property="userName" />
<result column="work_method" property="workMethod" />
<result column="work_no" property="workNo" />
<result column="work_sort" property="workSort" />
<result column="work_source" property="workSource" />
<result column="work_type" property="workType" />
<id column="wrk_id" property="wrkId"/>
<result column="remark" property="remark"/>
<result column="account_manager" property="accountManager"/>
<result column="account_phone" property="accountPhone"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="dept_id" property="deptId"/>
<result column="dept_name" property="deptName"/>
<result column="dispose_time" property="disposeTime"/>
<result column="end_time" property="endTime"/>
<result column="lower_task_id" property="lowerTaskId"/>
<result column="lower_task_name" property="lowerTaskName"/>
<result column="service_result" property="serviceResult"/>
<result column="task_id" property="taskId"/>
<result column="task_name" property="taskName"/>
<result column="user_id" property="userId"/>
<result column="user_name" property="userName"/>
<result column="work_method" property="workMethod"/>
<result column="work_no" property="workNo"/>
<result column="work_sort" property="workSort"/>
<result column="work_source" property="workSource"/>
<result column="work_type" property="workType"/>
<result column="wrk_status" property="wrkStatus"/>
</association>
<association property="infoStore" javaType="com.chushang.inspection.work.vo.WrkInfoStoreVO">
<id column="store_id" property="storeId" />
<id column="store_id" property="storeId"/>
<result column="ins_fre" property="insFre" />
<result column="legal_name" property="legalName" />
<result column="products" property="products" />
<result column="register_address" property="registerAddress" />
<result column="shop_name" property="shopName" />
<result column="special_num" property="specialNum" />
<result column="store_address" property="storeAddress" />
<result column="store_contact" property="storeContact" />
<result column="store_name" property="storeName" />
<result column="store_no" property="storeNo" />
<result column="store_phone" property="storePhone" />
<result column="state" property="storeStatus" />
<result column="store_type" property="storeType" />
<result column="tip_tool" property="tipTool" />
<result column="ins_fre" property="insFre"/>
<result column="legal_name" property="legalName"/>
<result column="products" property="products"/>
<result column="register_address" property="registerAddress"/>
<result column="shop_name" property="shopName"/>
<result column="special_num" property="specialNum"/>
<result column="store_address" property="storeAddress"/>
<result column="store_contact" property="storeContact"/>
<result column="store_name" property="storeName"/>
<result column="store_no" property="storeNo"/>
<result column="store_phone" property="storePhone"/>
<result column="state" property="storeStatus"/>
<result column="store_type" property="storeType"/>
<result column="tip_tool" property="tipTool"/>
</association>
<association property="infoTerminal" javaType="com.chushang.inspection.work.vo.WrkInfoTerminalVO">
<id column="terminal_id" property="terminalId" />
<result column="terminal_address" property="terminalAddress" />
<result column="terminal_model" property="terminalModel" />
<result column="terminal_no" property="terminalNo" />
<result column="terminal_property" property="terminalProperty" />
<result column="terminal_sn" property="terminalSn" />
<result column="terminal_source" property="terminalSource" />
<result column="terminal_status" property="terminalStatus" />
<result column="terminal_type" property="terminalType" />
<result column="terminal_version" property="terminalVersion" />
<id column="terminal_id" property="terminalId"/>
<result column="terminal_address" property="terminalAddress"/>
<result column="terminal_model" property="terminalModel"/>
<result column="terminal_no" property="terminalNo"/>
<result column="terminal_property" property="terminalProperty"/>
<result column="terminal_sn" property="terminalSn"/>
<result column="terminal_source" property="terminalSource"/>
<result column="terminal_status" property="terminalStatus"/>
<result column="terminal_type" property="terminalType"/>
<result column="terminal_version" property="terminalVersion"/>
</association>
<association property="infoTerminalIns" javaType="com.chushang.inspection.work.vo.WrkInfoTerminalInsVO">
<id column="terminal_id" property="terminalId" />
<result column="deviation" property="deviation" />
<result column="geographic_location" property="geographicLocation" />
<result column="work_address" property="workAddress" />
<result column="work_location" property="workLocation" />
<result column="geographic_address" property="locationAddress" />
<result column="pre_code_encoding" property="preCodeEncoding" />
<result column="service_result" property="serviceResult" />
<result column="storage_time" property="storageTime" />
<result column="times_pass" property="timesPass" />
<result column="delivery_time" property="deliveryTime" />
<result column="inspection_status" property="inspectionStatus" />
<result column="inspection_time" property="inspectionTime" />
<id column="terminal_id" property="terminalId"/>
<result column="deviation" property="deviation"/>
<result column="geographic_location" property="geographicLocation"/>
<result column="work_address" property="workAddress"/>
<result column="work_location" property="workLocation"/>
<result column="geographic_address" property="locationAddress"/>
<result column="pre_code_encoding" property="preCodeEncoding"/>
<result column="service_result" property="serviceResult"/>
<result column="storage_time" property="storageTime"/>
<result column="times_pass" property="timesPass"/>
<result column="delivery_time" property="deliveryTime"/>
<result column="inspection_status" property="inspectionStatus"/>
<result column="inspection_time" property="inspectionTime"/>
</association>
</resultMap>
<select id="listInsTemplate" resultMap="wrkInfoDetailsVOResult">
<include refid="wrkInfoDetailSql" />
<include refid="wrkInfoDetailSql"/>
<if test="1 == 1">
${query.sqlParam.get('sqlWhere')}
</if>
@ -172,81 +172,79 @@
ORDER BY i.create_time desc
</select>
<select id="getWrkInfoDetails" resultMap="wrkInfoDetailsVOResult">
<include refid="wrkInfoDetailSql" />
<include refid="wrkInfoDetailSql"/>
AND i.wrk_id = #{wrkId}
ORDER BY i.create_time desc
</select>
<sql id="wrkInfoDetailSql">
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
</sql>
@ -302,12 +300,26 @@
</select>
<select id="empData" resultType="com.chushang.inspection.project.vo.EmployeeVO">
SELECT user_id as userId,dept_id as deptId,count(user_id) as dispatchNum,count(CASE WHEN state = 4 OR state = 7 THEN 1 ELSE 0 END) as aduitNum
SELECT user_id as userId,dept_id as deptId,count(user_id) as dispatchNum,count(CASE WHEN wrk_status = 4 OR wrk_status = 7
THEN 1 ELSE 0 END) as aduitNum
FROM wrk_info
where del_state = 0
<if test="query.projectConcat != null and query.projectConcat != ''">
AND project_concat = #{projectConcat}
AND project_concat = #{query.projectConcat}
</if>
GROUP BY user_id
</select>
<select id="empDetail" resultType="com.chushang.inspection.project.vo.EmployeeVO">
SELECT t1.user_id as userId,
t1.dept_id as deptId,
t1.lower_task_name as taskName,
t2.project_name as projectName,
count(1) as dispatchNum,count(CASE WHEN t1.wrk_status = 4 OR t1.wrk_status = 7
THEN 1 ELSE 0 END) as aduitNum
FROM wrk_info t1 inner join wrk_project t2 on t1.project_id = t2.project_id
where t1.del_state = 0
and t1.user_id = #{userId}
GROUP BY t1.project_id,t1.lower_task_id
</select>
</mapper>

View File

@ -5,7 +5,6 @@
<select id="payMentData" resultType="com.chushang.inspection.project.vo.WrkProjectPaymentVO">
select
t2.project_name as projectName,
t2.user_id as userId,
t2.project_id as projectId,
t2.project_concat as projectConcat,
t2.project_phone as projectPhone,

View File

@ -2,12 +2,15 @@ package com.chushang.system.remote;
import cn.hutool.core.collection.CollectionUtil;
import com.chushang.common.core.util.StringUtils;
import com.chushang.common.core.web.AjaxResult;
import com.chushang.common.core.web.Result;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.security.entity.po.DataScopeEntity;
import com.chushang.security.annotation.InnerAuth;
import com.chushang.security.entity.po.SysDept;
import com.chushang.security.entity.vo.LoginUser;
import com.chushang.security.entity.po.SysUser;
import com.chushang.system.entity.dto.ListUserDTO;
import com.chushang.system.feign.RemoteUserService;
import com.chushang.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -95,4 +98,10 @@ public class RemoteUserController implements RemoteUserService {
}
@GetMapping(value = "/empData")
@InnerAuth
public AjaxResult empData(ListUserDTO listUser) {
return sysUserService.listUser(listUser);
}
}