更新0711

This commit is contained in:
xyc 2025-07-11 17:20:30 +08:00
parent 215b1a9a04
commit a73630b2b0
5 changed files with 56 additions and 8 deletions

View File

@ -106,8 +106,8 @@ public class PartnerOwnController extends BaseController {
* 检测线图
*/
@GetMapping("/chartInfoAmount")
public CommonResult chartInfoAmount(Long partnerId, String unit) {
return success(partnerList.chartInfoAmount(partnerId, unit));
public CommonResult chartInfoAmount(String startTime, String endTime) {
return success(partnerList.chartInfoAmount(startTime, endTime));
}
/**

View File

@ -47,6 +47,7 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
StatisticsInfo statisticsInfo(Long partnerId);
JSONObject chartInfoAmount(Long partnerId, String unit);
JSONObject chartInfoAmount(String startTime, String endTime);
JSONObject newChartInfoAmount(String unit);

View File

@ -375,6 +375,48 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series", series);
return res;
}
@Override
public JSONObject chartInfoAmount(String startTime, String endTime) {
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
// ShopMallPartners partners = baseMapper.selectById(partnerId);
// if (!partners.getUserId().equals(user.getId())){
// return null;
// }
JSONObject res = new JSONObject();
List<String> categories = new ArrayList<>();
List<JSONObject> series = new ArrayList<>();
JSONObject seriesObject = new JSONObject();
seriesObject.put("name", "金额");
List<Double> seriesObjectData = new ArrayList<>();
//按照单位日期查询数据
//横坐标获取当前商品上架的商品
//获取商家现有商品
List<ShopInspectionGoods> list1 = goodsService.list();
List<OrderInfo> list = baseMapper.chartInfoAmount(startTime, endTime, null);
//统计各个车型的价格 从高到低
for (OrderInfo orderInfo : list) {
categories.add(orderInfo.getGoodsTitle().indexOf("(") > 0 ? orderInfo.getGoodsTitle().substring(0, orderInfo.getGoodsTitle().indexOf("(")) : orderInfo.getGoodsTitle());
list1.removeIf(it -> {
return it.getTitle().equals(orderInfo.getGoodsTitle());
});
if (orderInfo.getRealPayMoney() != null) {
seriesObjectData.add(Double.valueOf(orderInfo.getRealPayMoney()) / 100);
}
}
categories.addAll(list1.stream().map(it -> {
return it.getTitle().indexOf("(") > 0 ? it.getTitle().substring(0, it.getTitle().indexOf("(")) : it.getTitle();
}).collect(Collectors.toList()));
seriesObjectData.addAll(list1.stream().map(it -> {
return 0d;
}).collect(Collectors.toList()));
seriesObject.put("data", seriesObjectData);
series.add(seriesObject);
res.put("categories", categories);
res.put("series", series);
return res;
}
@Override
public JSONObject newChartInfoAmount(String unit) {

View File

@ -170,7 +170,7 @@ public class OrderController extends BaseController {
// return success(new ArrayList<>());
// }
Page<commentVo> page = new Page<>(pageNum, pageSize);
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,tenantId);
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,null);
return success(commentOrderList);
}

View File

@ -378,8 +378,7 @@ FROM
<select id="chartInfoAmount" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
select sum(pay_money) as realPayMoney,goods_title as goodsTitle from
order_info
where validation_time is not null and validation_time between #{startTime} and #{endTime}
and partner_id = #{partnerId}
where validation_time is not null and validation_time between #{startTime} and #{endTime} and deleted = 0
group by goods_id
order by realPayMoney desc
</select>
@ -587,14 +586,14 @@ FROM
</select>
<select id="staticsTable5" resultType="java.util.Map">
SELECT
-- ROUND(IFNULL(SUM(CASE WHEN pay_type = 'sz' OR cashier_confirm != '1' OR pay_money IS NULL THEN goods_price ELSE 0 END),0)/ 100) AS theAmount
ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount,su.nickname theName
FROM
order_info oi
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
inner join system_users su on su.id = oi.user_id
WHERE oi.partner_id ='19'
and ii.create_time BETWEEN #{startTime} and #{endTime}
and oi.validation_time is null and ii.`status`='1' and ii.is_pass = '1'
WHERE ii.create_time BETWEEN #{startTime} and #{endTime}
and ( pay_type = 'sz' OR cashier_confirm != '1' OR pay_money IS NULL)
GROUP BY su.id
order by theAmount desc
</select>
@ -753,6 +752,12 @@ FROM
AND ii.start_time IS NOT NULL AND ii.end_time IS NOT NULL
AND TIMESTAMPDIFF(MINUTE, ii.start_time, ii.end_time) >= #{query.inspectionTime[0]}
</if>
<if test="query.payStatus == 0">
and (oi.pay_money is null OR oi.pay_type = 'sz')
</if>
<if test="query.payStatus == 1">
and oi.pay_time is not null AND oi.pay_type != 'sz'
</if>
</where>
AND oi.deleted = '0'
) t