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().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); } }