Compare commits

...

6 Commits

Author SHA1 Message Date
xuyuncong
517fce52fe 更新 2025-10-10 18:05:01 +08:00
xuyuncong
a6c3fde9e1 Merge branch 'master' into insp 2025-10-10 09:35:39 +08:00
xuyuncong
900cdf2af0 更新 2025-10-09 17:55:12 +08:00
xuyuncong
8bc8314073 员工统计-员工详情 2025-10-09 17:01:03 +08:00
xyc
7c2f6c2737 更新1009 2025-10-09 09:51:37 +08:00
xyc
1982dde0d3 更新0926 2025-10-01 14:42:59 +08:00
14 changed files with 200 additions and 9 deletions

View File

@ -826,6 +826,19 @@ public class PartnerOwnController extends BaseController {
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
}
/**
* @description :待收款
* @author xyc
* @date 09:46 2025/10/10
* @param startTime {@link String}
* @param endTime {@link String}
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
**/
@GetMapping("/channelMoneyStaticsByBusi")
public CommonResult<?> channelMoneyStaticsByBusi(String busi, String startTime, String endTime) throws Exception {
return success(partnerList.channelMoneyStaticsByBusi(busi,startTime, endTime));
}
/**
* 查询检测类型统计
*

View File

@ -757,13 +757,33 @@ public class UserClientPartnerOwnController extends BaseController {
return success(partnerList.staticsTable4(partners.getPartnerId(), startTime, endTime));
}
//统计表格5
/**
* @description :待收款
* @author xyc
* @date 09:46 2025/10/10
* @param startTime {@link String}
* @param endTime {@link String}
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
**/
@GetMapping("/staticsTable5")
public CommonResult staticsTable5(String startTime, String endTime) throws Exception {
ShopMallPartners partners = partnerList.shopInfo();
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
}
/**
* @description :待收款
* @author xyc
* @date 09:46 2025/10/10
* @param startTime {@link String}
* @param endTime {@link String}
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult
**/
@GetMapping("/channelMoneyStaticsByBusi")
public CommonResult<?> channelMoneyStaticsByBusi(String busi, String startTime, String endTime) throws Exception {
return success(partnerList.channelMoneyStaticsByBusi(busi,startTime, endTime));
}
/**
* 查询检测类型统计
*

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.inspection.controller.admin;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.SystemEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
@ -27,6 +28,7 @@ public class InspectionBusinessChannelController {
return CommonResult.success(inspectionBusinessChannelService.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
.eq(ObjectUtil.isNotEmpty(channel.getType()), InspectionBusinessChannel::getType, channel.getType())
.like(ObjectUtil.isNotEmpty(channel.getName()), InspectionBusinessChannel::getName, channel.getName())
.eq(InspectionBusinessChannel::getSystemCode, SystemEnum.INSPECTION.getCode())
.orderByAsc(InspectionBusinessChannel::getSort)));
}

View File

@ -101,6 +101,8 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
List<Map<String, Object>> staticsTable4(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> staticsTable5(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> busiMoneyStatics( @Param("startTime") String startTime, @Param("endTime") String endTime);
List<Map<String, Object>> channelMoneyStaticsByBusi(@Param("busi")String busi, @Param("startTime") String startTime, @Param("endTime") String endTime);
Long dhjNum(@Param("partnerId") Long partnerId, @Param("dateStr") String dateStr);

View File

@ -72,4 +72,13 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
* @return: java.util.Map<java.lang.String,java.lang.Object>
**/
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);
}

View File

@ -36,4 +36,9 @@ public class InspectionListQuery {
* 项目id
*/
private String projectId;
/**
* 类型 1=待收款
*/
private String type;
}

View File

@ -169,6 +169,15 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
List<Map<String, Object>> staticsTable4(Long partnerId, String startTime, String endTime);
List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime);
/**
* @description : 来源待收款金额统计通过渠道
* @author xyc
* @date 10:53 2025/10/10
* @param startTime {@link String}
* @param endTime {@link String}
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
**/
List<Map<String, Object>> channelMoneyStaticsByBusi(String busi,String startTime, String endTime);
//新检测金额折线图

View File

@ -94,16 +94,17 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
/**
* 完成异常节点
*
* @param idList
*/
void updateException(Long inspectionInfoId,List<String> idList);
void updateException(Long inspectionInfoId, List<String> idList);
/**
* @description: 员工统计根据车型
* @author:
* @date: 2025/8/5 11:41
* @param: [dlInspectionProject]
* @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
* @return: java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
**/
List<Map<String, Object>> queryStaffCountGroupByGoods(DlInspectionProject dlInspectionProject);
@ -112,7 +113,16 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
* @author:
* @date: 2025/8/5 14:04
* @param: [dlInspectionProject]
* @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);
/**
* @param dlInspectionProject {@link DlInspectionProject}
* @return java.util.Map<java.lang.String, java.lang.Object>
* @description : 获取员工统计信息
* @author xyc
* @date 17:23 2025/10/9
**/
Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject);
}

View File

@ -2285,6 +2285,15 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
return res;
}
/**
* @description :待收款
* @author xyc
* @date 09:47 2025/10/10
* @param partnerId {@link Long}
* @param startTime {@link String}
* @param endTime {@link String}
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
**/
@Override
public List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime) {
if (StringUtils.isEmpty(startTime)) {
@ -2293,7 +2302,27 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
}
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
List<Map<String, Object>> res = baseMapper.staticsTable5(partnerId, startTime, endTime);
List<Map<String, Object>> res = baseMapper.busiMoneyStatics(startTime, endTime);
return res;
}
/**
* @description : 来源待收款金额统计通过渠道
* @author xyc
* @date 10:53 2025/10/10
* @param startTime {@link String}
* @param endTime {@link String}
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
**/
@Override
public List<Map<String, Object>> channelMoneyStaticsByBusi(String busi,String startTime, String endTime) {
if (StringUtils.isEmpty(startTime)) {
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
}
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
List<Map<String, Object>> res = baseMapper.channelMoneyStaticsByBusi(busi,startTime, endTime);
return res;
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.inspection.service.impl;
import cn.iocoder.yudao.common.SystemEnum;
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
import cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper;
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
@ -18,7 +19,8 @@ public class InspectionBusinessChannelServiceImpl extends ServiceImpl<Inspection
@Override
public List<InspectionBusinessChannel> getChannelTree() {
// 查询所有业务渠道父节点
return this.list();
return this.list(Wrappers.<InspectionBusinessChannel>lambdaQuery()
.eq(InspectionBusinessChannel::getSystemCode, SystemEnum.INSPECTION.getCode()));
}
/**

View File

@ -614,6 +614,18 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
return baseMapper.queryStaffInspectionCount(dlInspectionProject);
}
/**
* @description :产值统计
* @author xyc
* @date 17:51 2025/10/9
* @param dlInspectionProject {@link DlInspectionProject}
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
@Override
public Map<String, Object> queryOutputMoneyStatistics(DlInspectionProject dlInspectionProject) {
return baseMapper.queryOutputMoneyStatistics(dlInspectionProject);
}
/**
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
*

View File

@ -56,6 +56,10 @@ public class StatisticsServiceImpl implements StatisticsService {
/*获取员工信息*/
AdminUserRespDTO user = adminUserApi.getUser(dlInspectionProject.getUserId());
result.put("staffInfo", user);
/*产值相关统计*/
Map<String, Object> outputMoneyStatistics = inspectionWorkNodeService.queryOutputMoneyStatistics(dlInspectionProject);
result.put("outputMoneyStatistics", outputMoneyStatistics);
return result;
}

View File

@ -364,8 +364,8 @@
<if test="query.datetimeRange != null">
AND ii.create_time BETWEEN CONCAT(#{query.datetimeRange[0]}, ' 00:00:00') AND CONCAT(#{query.datetimeRange[1]}, ' 23:59:59')
</if>
<if test="query.customSource != null">
AND ii.customer_source = #{query.customSource}
<if test="query.type != null and query.type == 1">
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
</if>
<if test="query.bussiness != null">
AND ii.business_channel = #{query.bussiness}
@ -373,7 +373,10 @@
<if test="query.projectId != null">
AND ip.id = #{query.projectId}
</if>
AND iwn.status = '2'
<if test="query.type != 1">
AND iwn.status = '2'
</if>
AND iwn.deleted = b'0'
</where>
GROUP BY ii.id
@ -486,4 +489,36 @@
</where>
GROUP BY staff.user_id, ip.id;
</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>

View File

@ -888,6 +888,7 @@ FROM
ON oi.id = ii.inspection_order_id AND oi.deleted = '0'
WHERE
ibc.deleted = '0'
AND ibc.system_code = 'jiance'
AND ibc.type = '0'
GROUP BY
ibc.name
@ -918,5 +919,43 @@ FROM
GROUP BY
ibc.name
</select>
<select id="busiMoneyStatics" resultType="java.util.Map">
SELECT
ii.business_channel AS channel, -- 渠道
COUNT(oi.id) AS order_count, -- 台次(订单数量)
ROUND(IFNULL(SUM(oi.goods_price), 0) / 100) AS theAmount -- 金额(单位:元)
FROM
order_info oi
INNER JOIN
inspection_info ii ON oi.id = ii.inspection_order_id
WHERE
ii.create_time BETWEEN #{startTime} AND #{endTime}
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
GROUP BY
ii.business_channel -- 按渠道分组
ORDER BY
theAmount DESC;
</select>
<select id="channelMoneyStaticsByBusi" resultType="java.util.Map">
SELECT
cs.name AS sourceName,
COUNT(DISTINCT ii.id) AS pendingCount,
ROUND(SUM(COALESCE(oi.goods_price, 0)) / 100, 2) AS pendingAmountYuan
FROM inspection_business_channel bc
INNER JOIN inspection_business_channel cs ON cs.pid = bc.id AND cs.type = 1
INNER JOIN inspection_info ii ON ii.customer_source = cs.name AND ii.deleted = 0
INNER JOIN order_info oi ON oi.id = ii.inspection_order_id AND oi.deleted = 0
WHERE bc.type = 0
<if test="startTime != null">
AND ii.create_time BETWEEN #{startTime} AND #{endTime}
</if>
AND bc.name = #{busi}
AND (oi.pay_type = 'sz' OR oi.cashier_confirm != '1' OR oi.pay_money IS NULL)
AND bc.deleted = 0
AND cs.deleted = 0
GROUP BY cs.id, cs.name
ORDER BY pendingAmountYuan DESC;
</select>
</mapper>