大屏:装备租赁互联
This commit is contained in:
parent
b517031534
commit
16efe3dbac
|
|
@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -64,6 +66,16 @@ public class LargeScreenController {
|
|||
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("订单数据")
|
||||
@GetMapping("/orderData")
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ public class OrderData {
|
|||
@ApiModelProperty(value = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@ApiModelProperty(value = "承租方公司名称")
|
||||
private String buyerCompany;
|
||||
|
||||
@ApiModelProperty(value = "出租方公司名称")
|
||||
private String sellerCompany;
|
||||
|
||||
@ApiModelProperty(value = "今日订单总数")
|
||||
private Integer todayOrderNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,4 +64,6 @@ public interface OrderMapper {
|
|||
OrderDto getTodayOrderCount();
|
||||
|
||||
OrderDto getOrderCount();
|
||||
|
||||
List<OrderData> getBuyerAndSellerCouples();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -464,4 +464,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</foreach>
|
||||
</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>
|
||||
Loading…
Reference in New Issue