admin
2024-01-08 22f70cc8b2ba603e82bba058db320dced48f9470
提交 | 用户 | 时间
71e81e 1 package cn.stylefeng.guns.modular.frame;
2
3 import cn.stylefeng.guns.modular.cm.passingStationCollection.service.PassingStationCollectionService;
4 import cn.stylefeng.guns.modular.om.productionOrdeInfo.entity.ProductionOrdeInfo;
5 import cn.stylefeng.guns.modular.om.productionOrdeInfo.service.ProductionOrdeInfoService;
6 import cn.stylefeng.guns.modular.sc.kanbanConf.model.params.KanbanConfParam;
7 import cn.stylefeng.guns.modular.sm.scrapCategoryRecord.entity.ScrapCategoryRecord;
8 import cn.stylefeng.guns.modular.sm.scrapCategoryRecord.service.ScrapCategoryRecordService;
9 import cn.stylefeng.roses.kernel.model.response.ResponseData;
10 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Controller;
13 import org.springframework.web.bind.annotation.RequestMapping;
14 import org.springframework.web.bind.annotation.ResponseBody;
15
16 import java.util.HashMap;
17 import java.util.Map;
18
19 @Controller
20 @RequestMapping("/home")
21 public class homeController {
22     private String PREFIX = "modular/frame";
23     @Autowired
24     ProductionOrdeInfoService productionOrdeInfoService;
25
26     @Autowired
27     ScrapCategoryRecordService scrapCategoryRecordService;
28
29     @Autowired
30     PassingStationCollectionService passingStationCollectionService;
31
32     @RequestMapping("")
33     public String index() {
34         return PREFIX + "/console.html";
35     }
36
37     @RequestMapping("/getOrder")
38     @ResponseBody
39     public ResponseData getOrder() {
40         ProductionOrdeInfo orderStatus = productionOrdeInfoService.getOne(new QueryWrapper<ProductionOrdeInfo>().eq("order_status", "3"));
41         Integer str = scrapCategoryRecordService.getScrapQuantity();
42         Integer strWeek = scrapCategoryRecordService.getScrapQuantityWeek();
43
44         Integer repairQty = passingStationCollectionService.getRepairQty();
45         Integer repairQtyWeek = passingStationCollectionService.getRepairQtyWeek();
46
47         HashMap map = productionOrdeInfoService.getOrderWeek();
48         try{
49
50         if(str==null){
51             orderStatus.setScrapQty(0);
52         }else {
53             orderStatus.setScrapQty(str);
54         }
55         orderStatus.setRepairQty(repairQty);
56
57             orderStatus.setPlanQtyWeek((Integer) map.get("planQty"));
58             orderStatus.setActualQtyWeek((Integer) map.get("actualQty"));
59             orderStatus.setScrapQtyWeek(strWeek);
60             orderStatus.setRepairQtyWeek(repairQtyWeek);
61         }catch (Exception e){
62
63         }
64
65
66         return ResponseData.success(orderStatus);
67     }
68
69 }