cy
2023-11-14 40682b5d4c072a4ab2e51b15b36827ba213d9900
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
package com.consum.base.controller;
 
import com.consum.base.BaseController;
import com.consum.base.pojo.LWarehouseFlowParam;
import com.consum.base.pojo.response.WarehouseFlowVO;
import com.consum.base.service.LWarehouseFlowService;
import com.consum.base.core.utils.MapUtils;
import com.iplatform.model.po.S_user_core;
import com.walker.db.page.GenericPager;
import com.walker.web.ResponseValue;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.compress.utils.Lists;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @ClassName lWarehouseFlowController
 * @Date 2023/10/27
 * @Description
 * @Version 1.0
 **/
@RestController
@RequestMapping("/pc/warehouse/flow")
public class LWarehouseFlowController extends BaseController {
 
    @Resource
    private LWarehouseFlowService lWarehouseFlowService;
 
    @GetMapping("/list")
    public ResponseValue queryFormProcureList(LWarehouseFlowParam param) {
        S_user_core currentUser = this.getCurrentUser();
        if (currentUser == null) {
            return ResponseValue.error("登录用户信息不存在");
        }
        GenericPager<Map<String, Object>> genericPager = lWarehouseFlowService.queryBusinessFlow(param);
        ArrayList<WarehouseFlowVO> result = Lists.newArrayList();
        genericPager.getDatas().forEach(map -> {
            WarehouseFlowVO warehouseFlowVO = MapUtils.convertMapToObj(MapUtils.toReplaceKeyLow(map), WarehouseFlowVO.class);
            result.add(warehouseFlowVO);
        });
        try {
            Field fieldDatas = GenericPager.class.getDeclaredField("datas");
            fieldDatas.setAccessible(true);
            fieldDatas.set(genericPager, result);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
 
        return ResponseValue.success(genericPager);
    }
}