guoyuji
2024-03-22 73be6b08f5a94e71550fe788c5d74705daa91be0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
package com.example.erp.service.pp;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
 
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.mapper.pp.ReportMapper;
import com.example.erp.mapper.sd.OrderProcessDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.sql.Date;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
@DS("pp")
public class ReportService {
    private final ReportMapper reportMapper;
 
    private final OrderProcessDetailMapper orderProcessDetailMapper;
 
    public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper) {
        this.reportMapper = reportMapper;
        this.orderProcessDetailMapper = orderProcessDetailMapper;
    }
 
 
    public Map<String, Object> processCardProgressSv(String orderId, List<Integer> columns) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.processCardProgressMp(orderId));
        map.put("title", orderProcessDetailMapper.filterOrderProcess(orderId));
        List<Map<String,Integer>> getRowCount =  orderProcessDetailMapper.getGlassLRow(orderId);
        List<Map<String,Integer>> rowCount = new ArrayList<>();
        columns.forEach(col ->{
            getRowCount.forEach(row ->{
                Map<String,Integer>  getRow = new HashMap<>();
                // { row: 0, col: 1, rowspan: 3, colspan: 0},
                getRow.put("row",row.get("RowNum"));
                getRow.put("col",col);
                getRow.put("rowspan",row.get("rowCount"));
                getRow.put("colspan",0);
                rowCount.add(getRow);
            });
        });
 
 
        map.put("mergeCells",rowCount);
 
        return map;
    }
}