懒羊羊
2023-11-14 8286c62256f23bc2367a6729c0f46f84215e380b
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
57
58
59
60
61
62
63
64
65
66
67
68
69
package cn.stylefeng.guns.modular.frame;
 
import cn.stylefeng.guns.modular.cm.passingStationCollection.service.PassingStationCollectionService;
import cn.stylefeng.guns.modular.om.productionOrdeInfo.entity.ProductionOrdeInfo;
import cn.stylefeng.guns.modular.om.productionOrdeInfo.service.ProductionOrdeInfoService;
import cn.stylefeng.guns.modular.sc.kanbanConf.model.params.KanbanConfParam;
import cn.stylefeng.guns.modular.sm.scrapCategoryRecord.entity.ScrapCategoryRecord;
import cn.stylefeng.guns.modular.sm.scrapCategoryRecord.service.ScrapCategoryRecordService;
import cn.stylefeng.roses.kernel.model.response.ResponseData;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import java.util.HashMap;
import java.util.Map;
 
@Controller
@RequestMapping("/home")
public class homeController {
    private String PREFIX = "modular/frame";
    @Autowired
    ProductionOrdeInfoService productionOrdeInfoService;
 
    @Autowired
    ScrapCategoryRecordService scrapCategoryRecordService;
 
    @Autowired
    PassingStationCollectionService passingStationCollectionService;
 
    @RequestMapping("")
    public String index() {
        return PREFIX + "/console.html";
    }
 
    @RequestMapping("/getOrder")
    @ResponseBody
    public ResponseData getOrder() {
        ProductionOrdeInfo orderStatus = productionOrdeInfoService.getOne(new QueryWrapper<ProductionOrdeInfo>().eq("order_status", "3"));
        Integer str = scrapCategoryRecordService.getScrapQuantity();
        Integer strWeek = scrapCategoryRecordService.getScrapQuantityWeek();
 
        Integer repairQty = passingStationCollectionService.getRepairQty();
        Integer repairQtyWeek = passingStationCollectionService.getRepairQtyWeek();
 
        HashMap map = productionOrdeInfoService.getOrderWeek();
        try{
 
        if(str==null){
            orderStatus.setScrapQty(0);
        }else {
            orderStatus.setScrapQty(str);
        }
        orderStatus.setRepairQty(repairQty);
 
            orderStatus.setPlanQtyWeek((Integer) map.get("planQty"));
            orderStatus.setActualQtyWeek((Integer) map.get("actualQty"));
            orderStatus.setScrapQtyWeek(strWeek);
            orderStatus.setRepairQtyWeek(repairQtyWeek);
        }catch (Exception e){
 
        }
 
 
        return ResponseData.success(orderStatus);
    }
 
}