大屏:装备租赁互联

This commit is contained in:
sxu 2025-01-06 17:59:37 +08:00
parent b517031534
commit 16efe3dbac
4 changed files with 30 additions and 0 deletions

View File

@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Authorliang.chao * @Authorliang.chao
@ -64,6 +66,16 @@ public class LargeScreenController {
return AjaxResult.success(list); return AjaxResult.success(list);
} }
@ApiOperation("装备租赁互联")
@GetMapping("/getLeaseCouples")
public AjaxResult getLeaseCouples() {
List<OrderData> list = orderMapper.getBuyerAndSellerCouples();
Map<String, List<OrderData>> groupedMap = list.stream()
.collect(Collectors.groupingBy(OrderData::getBuyerCompany));
List<List<OrderData>> groupedList = new ArrayList<>(groupedMap.values());
int randomValue = (int) (Math.random() * groupedList.size());
return AjaxResult.success(groupedList.get(randomValue));
}
@ApiOperation("订单数据") @ApiOperation("订单数据")
@GetMapping("/orderData") @GetMapping("/orderData")

View File

@ -22,6 +22,12 @@ public class OrderData {
@ApiModelProperty(value = "公司名称") @ApiModelProperty(value = "公司名称")
private String companyName; private String companyName;
@ApiModelProperty(value = "承租方公司名称")
private String buyerCompany;
@ApiModelProperty(value = "出租方公司名称")
private String sellerCompany;
@ApiModelProperty(value = "今日订单总数") @ApiModelProperty(value = "今日订单总数")
private Integer todayOrderNum; private Integer todayOrderNum;

View File

@ -64,4 +64,6 @@ public interface OrderMapper {
OrderDto getTodayOrderCount(); OrderDto getTodayOrderCount();
OrderDto getOrderCount(); OrderDto getOrderCount();
List<OrderData> getBuyerAndSellerCouples();
} }

View File

@ -464,4 +464,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) )
</foreach> </foreach>
</insert> </insert>
<select id="getBuyerAndSellerCouples" resultType="com.bonus.material.largeScreen.entity.OrderData">
SELECT sd1.dept_name as buyer_company, sd2.dept_name as seller_company
FROM ma_order_details modd
LEFT JOIN ma_order_info moi on moi.order_id=modd.order_id
LEFT JOIN ma_dev_info mdi on mdi.ma_id=modd.ma_id
LEFT JOIN sys_dept sd1 on sd1.dept_id=moi.buyer_company
LEFT JOIN sys_dept sd2 on sd2.dept_id=mdi.own_co
order by moi.buyer_company
</select>
</mapper> </mapper>