员工统计-员工详情
This commit is contained in:
parent
7c2f6c2737
commit
8bc8314073
@ -72,4 +72,13 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
|||||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
**/
|
**/
|
||||||
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获取员工项目统计
|
||||||
|
* @author: 许
|
||||||
|
* @date: 2025/10/9 14:07
|
||||||
|
* @param: [dlInspectionProject]
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
**/
|
||||||
|
Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject);
|
||||||
}
|
}
|
||||||
|
@ -115,4 +115,11 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
|||||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
**/
|
**/
|
||||||
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
Map<String, Object> queryStaffInspectionCount(DlInspectionProject dlInspectionProject);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获取员工产值统计信息
|
||||||
|
* @param dlInspectionProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject);
|
||||||
}
|
}
|
||||||
|
@ -614,6 +614,11 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
return baseMapper.queryStaffInspectionCount(dlInspectionProject);
|
return baseMapper.queryStaffInspectionCount(dlInspectionProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject) {
|
||||||
|
return baseMapper.queryOutputMoneyStatistics(dlInspectionProject);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
|
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
|
||||||
*
|
*
|
||||||
|
@ -56,6 +56,10 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|||||||
/*获取员工信息*/
|
/*获取员工信息*/
|
||||||
AdminUserRespDTO user = adminUserApi.getUser(dlInspectionProject.getUserId());
|
AdminUserRespDTO user = adminUserApi.getUser(dlInspectionProject.getUserId());
|
||||||
result.put("staffInfo", user);
|
result.put("staffInfo", user);
|
||||||
|
|
||||||
|
/*产值相关统计*/
|
||||||
|
Map<String, Object> outputMoneyStatistics = inspectionWorkNodeService.queryOutputMoneyStatistics(dlInspectionProject);
|
||||||
|
result.put("outputMoneyStatistics", outputMoneyStatistics);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,4 +486,36 @@
|
|||||||
</where>
|
</where>
|
||||||
GROUP BY staff.user_id, ip.id;
|
GROUP BY staff.user_id, ip.id;
|
||||||
</select>
|
</select>
|
||||||
|
<select id="queryOutputMoneyStatistics" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
iw.deal_user_id,
|
||||||
|
|
||||||
|
-- 初检公示产值:流程次数为1的订单公示价格
|
||||||
|
COALESCE(SUM(CASE WHEN iw.node_count = 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionOutputValue,
|
||||||
|
|
||||||
|
-- 复检公示产值:流程次数大于1的订单公示价格总和
|
||||||
|
COALESCE(SUM(CASE WHEN iw.node_count > 1 THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionOutputValue,
|
||||||
|
|
||||||
|
-- 初检合格产值:流程次数为1且status=2且type='1'的订单公示价格
|
||||||
|
COALESCE(SUM(CASE WHEN iw.node_count = 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS initialInspectionPassOutputValue,
|
||||||
|
|
||||||
|
-- 复检合格产值:流程次数大于1且status=2且type='1'的订单公示价格总和
|
||||||
|
COALESCE(SUM(CASE WHEN iw.node_count > 1 AND iw.status = '2' AND iw.type = '1' THEN oi.goods_price ELSE 0 END) / 100, 0) AS recheckInspectionPassOutputValue
|
||||||
|
|
||||||
|
FROM
|
||||||
|
inspection_work_node iw
|
||||||
|
JOIN
|
||||||
|
inspection_info ii ON iw.inspection_info_id = ii.id
|
||||||
|
JOIN
|
||||||
|
order_info oi ON ii.inspection_order_id = oi.id
|
||||||
|
WHERE
|
||||||
|
iw.deal_user_id = #{userId} -- 替换为所需的处理人ID
|
||||||
|
AND iw.deleted = 0 -- 确保流程未被删除
|
||||||
|
AND ii.deleted = 0 -- 确保检测信息未被删除
|
||||||
|
<if test="datetimeRange != null and datetimeRange.size() == 2">
|
||||||
|
AND iw.create_time BETWEEN CONCAT(#{datetimeRange[0]}, ' 00:00:00') AND CONCAT(#{datetimeRange[1]}, ' 23:59:59')
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
iw.deal_user_id;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user