diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/Rework.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/Rework.java new file mode 100644 index 00000000..642ab887 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/Rework.java @@ -0,0 +1,174 @@ +package com.ruoyi.web.controller.nanjing; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.nanjing.domain.BaseRepairinfoRecord; +import com.ruoyi.nanjing.domain.ProRpList; +import com.ruoyi.nanjing.domain.TBdProductinfo; +import com.ruoyi.nanjing.service.ITBdProductinfoService; +import com.ruoyi.nanjing.service.ITBdProducttypeService; +import com.ruoyi.nanjing.service.ReworkService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 时段统计 + * + * @author limy + * @date 2021-02-2 + */ +@Controller +@RequestMapping("/nanjing/Rework") +public class Rework extends BaseController +{ + private String prefix = "nanjing/Rework"; + + @Autowired + private ITBdProductinfoService tBdProductinfoService; + @Autowired + private ITBdProducttypeService itBdProducttypeService; + @Autowired + private ReworkService reworkService; + + @RequiresPermissions("nanjing:ProRpList:view") + @GetMapping() + public String ProRpList(ModelMap map) + { + List tBdProductinfoList = tBdProductinfoService.selectTBdProductinfoList(new TBdProductinfo()); + map.addAttribute("list",tBdProductinfoList); + return prefix + "/Rework"; + } + + /** + * 查询时段统计 + */ + @RequiresPermissions("nanjing:ProRpList:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ProRpList proRpList) + { + startPage(); + Map map = new HashMap(); + map.put("beginTime",proRpList.getBeginTime()); + map.put("endTime",proRpList.getEndTime()); + map.put("productId",proRpList.getProductID()); + map.put("productType",proRpList.getProductType()); + map.put("state",proRpList.getState()); + map.put("semiBarcode",proRpList.getSemiBarcode()); + List list = null; + return getDataTable(list); + } + +// @PostMapping("/getData") +// @ResponseBody +// public TableDataInfo getData(ProRpList proRpList) +// { +//// startPage(); +// List list = new ArrayList(); +// List list2 = new ArrayList(); +// List list3 = new ArrayList(); +// if(proRpList.getBeginTime()==null||proRpList.getEndTime()==null) +// { +// return getDataTable(list); +// } +// Map map = new HashMap(); +// map.put("beginTime",proRpList.getBeginTime()); +// map.put("endTime",proRpList.getEndTime()); +// map.put("productId",proRpList.getProductID()); +// map.put("productType",proRpList.getProductType()); +// map.put("state",""); +// map.put("semiBarcode",proRpList.getSemiBarcode()); +// list = itBdProducttypeService.selectProLists(map); +// if (proRpList.getState().equals("0")){ +// list2 = list; +// } +// else if (proRpList.getState().equals("1")){ +// System.out.println("state===1"); +// int j = 0; +//// System.out.println(list.size()); +// for (int i=0;i(); + map.put("beginTime",proRpList.getBeginTime()); + map.put("endTime",proRpList.getEndTime()); + map.put("productId",proRpList.getProductID()); + map.put("productType",proRpList.getProductType()); + map.put("state",proRpList.getState()); + map.put("semiBarcode",proRpList.getSemiBarcode()); + List list = itBdProducttypeService.selectProLists(map); + ExcelUtil util = new ExcelUtil(ProRpList.class); + return util.exportExcel(list, "ProRpList"); + } + + /** + * 返修信息查询 + * */ + @PostMapping("/selectRework") + @ResponseBody + public TableDataInfo selectRework(ProRpList proRpList){ + startPage(); + List list = new ArrayList<>(); + list = reworkService.selectRework(proRpList.getBeginTime(),proRpList.getEndTime()); + return getDataTable(list); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StatisticAnalysisProductController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StatisticAnalysisProductController.java new file mode 100644 index 00000000..39815d4e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/StatisticAnalysisProductController.java @@ -0,0 +1,117 @@ +package com.ruoyi.web.controller.nanjing; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.nanjing.domain.QSAnalysis; +import com.ruoyi.nanjing.domain.QsStation; +import com.ruoyi.nanjing.domain.TBdProductinfo; +import com.ruoyi.nanjing.service.ITBdProductinfoService; +import com.ruoyi.nanjing.service.ITBdProducttypeService; +import com.ruoyi.nanjing.service.ITBdSubstationService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.time.LocalDate; +import java.time.temporal.ChronoUnit; +import java.util.*; +import java.util.stream.Stream; + +@Controller +@RequestMapping("/nanjing/StatisticAnalysis") +public class StatisticAnalysisProductController extends BaseController { + + private String prefix = "nanjing/Statistic"; + @Autowired + private ITBdSubstationService substationService; + @Autowired + private ITBdProducttypeService producttypeService; + + + @Autowired + private ITBdProductinfoService productinfoService; + @RequiresPermissions("nanjing:StatisticAnalysis:view") + @GetMapping() + public String stationProduct(ModelMap map) + { + List tBdProductinfoList = productinfoService.selectTBdProductinfoList(new TBdProductinfo()); + map.addAttribute("list",tBdProductinfoList); + return prefix + "/StatisticAnalysis"; + } + + @RequiresPermissions("nanjing:StatisticAnalysis:list") + @PostMapping("/list") + @ResponseBody + public List list(QsStation qsStation) + { + List qsProducts = producttypeService.selectStationQs(qsStation); + return qsProducts; + } + + @PostMapping("/listAll") + @ResponseBody + public List listAll(String begin,String end) + { + Map map = new HashMap(); + map.put("begin",begin); + map.put("end",end); + map.put("productId",""); + map.put("productType",""); + List qsStations = producttypeService.selectAllQs(map); + return qsStations; + } + /** + * 获取一段时间的每一天日期 + * + * @param start + * @param end + * @return + * @throws Exception + */ + + public static List getBetweenDate(String start, String end) { + List list = new ArrayList<>(); + LocalDate startDate = LocalDate.parse(start); + LocalDate endDate = LocalDate.parse(end); + long distance = ChronoUnit.DAYS.between(startDate, endDate); + if (distance < 1) { + return list; + } + Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString())); + return list; + } + @PostMapping("/nodeClick") + @ResponseBody + public AjaxResult nodeClick(String begin, String end, String node, String productid) + { + Map map = new HashMap(); + List days = getBetweenDate(begin,end); + List QSAnalysisList = new ArrayList<>(); + for (int i = 0; i < days.size(); i++) { + map.put("begin", days.get(i) +" 00:00:00"); + map.put("end",days.get(i)+" 23:59:59"); + map.put("stationId",node); + map.put("stationType",1); + List qsStations = producttypeService.selectNodeQs(map); + QSAnalysis QSAnalysis = new QSAnalysis(); + QSAnalysis.setDate(days.get(i)); + QSAnalysis.setAllRate(Float.parseFloat(qsStations.get(0).getAllRate().replace("%",""))); + QSAnalysisList.add(QSAnalysis); + } +// map.put("begin",begin); +// map.put("end",end); +// map.put("stationId",node); +// map.put("stationType",1); +// List qsStations = producttypeService.selectNodeQs(map); +// QsStation qsStation = qsStations.get(0); +// qsStation.setStationCode(substationService.selectSubNameCode(node)); +// qsStation.setStationName(substationService.selectSubName(node)); + return AjaxResult.success(QSAnalysisList); + } + +} diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/Rework/Rework.html b/ruoyi-admin/src/main/resources/templates/nanjing/Rework/Rework.html new file mode 100644 index 00000000..d47ac56b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/nanjing/Rework/Rework.html @@ -0,0 +1,188 @@ + + + + + + +
+
+
+
+
+
    +
  • + + + - + +
  • + +
  • +  搜索 + + +
  • +
+
+
+
+
+
+
+
+
+ + + + + diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/Statistic/StatisticAnalysis.html b/ruoyi-admin/src/main/resources/templates/nanjing/Statistic/StatisticAnalysis.html new file mode 100644 index 00000000..58a7be87 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/nanjing/Statistic/StatisticAnalysis.html @@ -0,0 +1,290 @@ + + + + + + + + + +
+
+
+
+ 工位名称 +
+
+ + + + +
+
+
+
+
+
+
+ +
+
+
+
+
+ + +
+
    +
  • + + + - + +
  • + + + + + + + + +
  • +  搜索 + + +
  • +
+
+
+
+ + + +
+
+ + +
+
+
+
+ + + + + + + diff --git a/ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/QSAnalysis.java b/ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/QSAnalysis.java new file mode 100644 index 00000000..957335f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/QSAnalysis.java @@ -0,0 +1,25 @@ +package com.ruoyi.nanjing.domain; + +import com.ruoyi.common.core.domain.BaseEntity; + +public class QSAnalysis extends BaseEntity { + private static final long serialVersionUID = 1L; + private String date; + private float allRate; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public float getAllRate() { + return allRate; + } + + public void setAllRate(float allRate) { + this.allRate = allRate; + } +} diff --git a/test b/test new file mode 100644 index 00000000..92519a24 Binary files /dev/null and b/test differ diff --git a/工位参数 b/工位参数 new file mode 100644 index 00000000..52c294fa Binary files /dev/null and b/工位参数 differ