瀏覽代碼

Merge branch 'master' of http://121.36.46.135:3000/mes-x13/mescloud

chefz 1 周之前
父節點
當前提交
98db715391
共有 33 個文件被更改,包括 1593 次插入223 次删除
  1. 3 3
      api.http
  2. 203 206
      src/main/java/com/jeesite/modules/mes/web/MesProductController.java
  3. 4 4
      src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java
  4. 11 10
      src/main/resources/config/application.yml
  5. 二進制
      src/main/resources/static/screen/imgs/bg3.png
  6. 二進制
      src/main/resources/static/screen/imgs/scr4Row1.png
  7. 二進制
      src/main/resources/static/screen/imgs/small1.png
  8. 二進制
      src/main/resources/static/screen/imgs/small2.png
  9. 二進制
      src/main/resources/static/screen/imgs/small3.png
  10. 二進制
      src/main/resources/static/screen/imgs/small4.png
  11. 二進制
      src/main/resources/static/screen/imgs/small5.png
  12. 二進制
      src/main/resources/static/screen/imgs/small6.png
  13. 二進制
      src/main/resources/static/screen/imgs/small7.png
  14. 二進制
      src/main/resources/static/screen/imgs/small8.png
  15. 二進制
      src/main/resources/static/screen/imgs/smallTop.png
  16. 二進制
      src/main/resources/static/screen/imgs/smallbg.png
  17. 二進制
      src/main/resources/static/screen/imgs/srcrow-bg.png
  18. 二進制
      src/main/resources/static/screen/imgs/srcrow11.png
  19. 二進制
      src/main/resources/static/screen/imgs/srcrow12.png
  20. 二進制
      src/main/resources/static/screen/imgs/srcrow13.png
  21. 二進制
      src/main/resources/static/screen/imgs/srcrow14.png
  22. 二進制
      src/main/resources/static/screen/imgs/srcrow15.png
  23. 二進制
      src/main/resources/static/screen/imgs/srcrow16.png
  24. 二進制
      src/main/resources/static/screen/imgs/srcrow21.png
  25. 二進制
      src/main/resources/static/screen/imgs/srcrow22.png
  26. 二進制
      src/main/resources/static/screen/imgs/srcrow22n.png
  27. 二進制
      src/main/resources/static/screen/imgs/srcrow2table1.png
  28. 二進制
      src/main/resources/static/screen/imgs/srcrow2table2.png
  29. 二進制
      src/main/resources/static/screen/imgs/srcrow3.png
  30. 二進制
      src/main/resources/static/screen/imgs/srcrowNO1.png
  31. 二進制
      src/main/resources/static/screen/imgs/srcrowNO2.png
  32. 二進制
      src/main/resources/static/screen/imgs/srcrowNO3.png
  33. 1372 0
      src/main/resources/views/modules/mes/mesScreen4.html

+ 3 - 3
api.http

@@ -111,7 +111,7 @@ __ajax=json&__sid=34157dcaeba34e71a617792b0d2e9589&id=1684766376594120704
 POST http://127.0.0.1:8980/js/a/mes/mesIcons/icons
 Content-Type: application/x-www-form-urlencoded
 
-__ajax=json&__sid=b998858e224b469c84ca6d0711565f6a
+__ajax=json&__sid=a6cff7df05434ebebb3c11818586a4d0
 
 ###
 
@@ -480,10 +480,10 @@ Content-Type: application/x-www-form-urlencoded
 __login=true&__ajax=json&__sid=627253ab6b524123afe1f54246869c26&id=1992062686483652608&lineSn=XT
 ###
 
-POST http://192.168.1.53:8980/js/a/mes/mesIcons/icons
+POST http://192.168.0.1:8980/js/a/mes/mesIcons/icons
 Content-Type: application/x-www-form-urlencoded
 
-token=1&__ajax=json&__sid=272718fa08054671a96173cef6573723
+token=1&__ajax=json&__sid=a6cff7df05434ebebb3c11818586a4d0
 ###
 POST http://192.168.1.53:8980/js/a/mes/mesLineProcessMaterial/materials
 Content-Type: application/x-www-form-urlencoded

+ 203 - 206
src/main/java/com/jeesite/modules/mes/web/MesProductController.java

@@ -77,6 +77,12 @@ public class MesProductController extends BaseController {
     private MesShiftService mesShiftService;
     @Autowired
     private MesProcessAlarmService mesProcessAlarmService;
+    @Autowired
+    private MesToolLifeService mesToolLifeService;
+    @Autowired
+    private MesToolReplaceRecordService mesToolReplaceRecordService;
+    @Autowired
+    private MesProcessProductService mesProcessProductService;
 
 	/**
 	 * 获取数据
@@ -287,7 +293,7 @@ public class MesProductController extends BaseController {
 
 	@RequestMapping(value = {"screen", ""})
 	public String screen(Model model) {
-		return "modules/mes/mesScreen2";
+		return "modules/mes/mesScreen4";
 	}
 
 	@RequestMapping(value = "alarmData")
@@ -319,239 +325,230 @@ public class MesProductController extends BaseController {
 	@ResponseBody
 	public CommonResp screenData() {
 		CommonResp<List<MesLineProcess>> resp = new CommonResp<>();
-		resp.setData(getScreenProcessList());
+		// 获取当前日期
+		LocalDate today = LocalDate.now();
+		// 获取明天的日期
+		LocalDate tomorrow = today.plusDays(1);
+		// 定义日期格式
+		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+		// 格式化并打印今天的日期
+		String formattedToday = today.format(formatter);
+		// 格式化并打印明天的日期
+		String formattedTomorrow = tomorrow.format(formatter);
+
+		String sdate1 = formattedToday+" 08:00:00";
+		String edate1 = formattedTomorrow+" 08:00:00";
+
+		MesShiftDataResp mesShiftDataResp = mesShiftService.getCurShift();
+
+		MesLineProcess mesLineProcess = new MesLineProcess();
+		mesLineProcess.setStatus("0");
+		mesLineProcess.getSqlMap().getWhere().and("pid",QueryType.IS_NULL,"");
+		List<MesLineProcess> lists = mesLineProcessService.findList(mesLineProcess);
+		for(MesLineProcess mesLineProcess2 : lists){
+			if(ObjectUtils.isEmpty(mesShiftDataResp)){
+				mesLineProcess2.setShiftCount(0);
+				mesLineProcess2.setShift5305(0);
+				mesLineProcess2.setShift5308(0);
+				mesLineProcess2.setShift8301(0);
+				mesLineProcess2.setShift8302(0);
+				mesLineProcess2.setShift7933(0);
+				mesLineProcess2.setShift7939(0);
+				mesLineProcess2.setShiftyn(0);
+			}else{
+				String shiftOks = mesProductRecordService.getSjOk(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd());
+				mesLineProcess2.setShiftCount(Integer.valueOf(shiftOks));
+
+				String shiftOks5305 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020015305-");
+				mesLineProcess2.setShift5305(Integer.valueOf(shiftOks5305));
+
+				String shiftOks5308 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020015308-");
+				mesLineProcess2.setShift5308(Integer.valueOf(shiftOks5308));
+
+				String shiftOks8301 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020018301-");
+				mesLineProcess2.setShift8301(Integer.valueOf(shiftOks8301));
+
+				String shiftOks8302 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020018302-");
+				mesLineProcess2.setShift8302(Integer.valueOf(shiftOks8302));
+
+				String shiftOks7939 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020017939-");
+				mesLineProcess2.setShift7939(Integer.valueOf(shiftOks7939));
+
+				String shiftOks7933 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"000020017933-");
+				mesLineProcess2.setShift7933(Integer.valueOf(shiftOks7933));
+
+				String shiftOksYn = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),mesShiftDataResp.getStart(),mesShiftDataResp.getEnd(),"2520200FF3");
+				mesLineProcess2.setShiftyn(Integer.valueOf(shiftOksYn));
+			}
+
+
+			String dayOks = mesProductRecordService.getSjOk(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1);
+			mesLineProcess2.setDayCount(Integer.valueOf(dayOks));
+
+			String dayOks5305 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020015305-");
+			mesLineProcess2.setDay5305(Integer.valueOf(dayOks5305));
+
+			String dayOks5308 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020015308-");
+			mesLineProcess2.setDay5308(Integer.valueOf(dayOks5308));
+
+			String dayOks8301 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020018301-");
+			mesLineProcess2.setDay8301(Integer.valueOf(dayOks8301));
+
+			String dayOks8302 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020018302-");
+			mesLineProcess2.setDay8302(Integer.valueOf(dayOks8302));
+
+			String dayOks7939 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020017939-");
+			mesLineProcess2.setDay7939(Integer.valueOf(dayOks7939));
+
+			String dayOks7933 = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"000020017933-");
+			mesLineProcess2.setDay7933(Integer.valueOf(dayOks7933));
+
+			String dayOksYn = mesProductRecordService.getSjOkType(mesLineProcess2.getOprno(),mesLineProcess2.getLineSn(),sdate1,edate1,"2520200FF3");
+			mesLineProcess2.setDayyn(Integer.valueOf(dayOksYn));
+		}
+
+		resp.setData(lists);
 		resp.setResult(Global.TRUE);
 		return resp;
 	}
 
-	@RequestMapping(value = "screenDashboardData")
+	@RequestMapping(value = "screenData4")
 	@ResponseBody
-	public CommonResp screenDashboardData() {
+	public CommonResp screenData4() {
 		CommonResp<Map<String, Object>> resp = new CommonResp<>();
-		List<MesLineProcess> lists = getScreenProcessList();
-		resp.setData(buildScreenDashboardData(lists));
-		resp.setResult(Global.TRUE);
-		return resp;
-	}
+		Map<String, Object> data = MapUtils.newHashMap();
 
-	private List<MesLineProcess> getScreenProcessList() {
 		LocalDate today = LocalDate.now();
 		LocalDate tomorrow = today.plusDays(1);
 		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
 		String formattedToday = today.format(formatter);
 		String formattedTomorrow = tomorrow.format(formatter);
+
 		String sdate1 = formattedToday + " 08:00:00";
 		String edate1 = formattedTomorrow + " 08:00:00";
-		MesShiftDataResp mesShiftDataResp = mesShiftService.getCurShift();
-		List<MesProductRecord> shiftRecords = ListUtils.newArrayList();
-		List<MesProductRecord> dayRecords = getDashboardProductRecords(sdate1, edate1);
 
-		if (!ObjectUtils.isEmpty(mesShiftDataResp)) {
-			shiftRecords = getDashboardProductRecords(mesShiftDataResp.getStart(), mesShiftDataResp.getEnd());
-		}
+		MesShiftDataResp mesShiftDataResp = mesShiftService.getCurShift();
 
-		if (ListUtils.isEmpty(shiftRecords) && ListUtils.isEmpty(dayRecords)) {
-			MesProductRecord latestRecord = getLatestDashboardRecord();
-			if (!ObjectUtils.isEmpty(latestRecord) && latestRecord.getUpdateDate() != null) {
-				Map<String, String> rangeMap = getBusinessDayRange(latestRecord.getUpdateDate());
-				dayRecords = getDashboardProductRecords(rangeMap.get("start"), rangeMap.get("end"));
-				shiftRecords = dayRecords;
-			}
-		}
+		EmpUser empUser = new EmpUser();
+		List<EmpUser> userList = empUserService.findUserList(empUser);
+		data.put("workers", userList.size());
 
-		Map<String, MesLineProcess> processMap = new LinkedHashMap<>();
-		Map<String, String> titleCache = new HashMap<>();
-		if (!ListUtils.isEmpty(shiftRecords)) {
-			fillScreenProcessCount(processMap, shiftRecords, true, titleCache);
-		}
-		if (!ListUtils.isEmpty(dayRecords)) {
-			fillScreenProcessCount(processMap, dayRecords, false, titleCache);
-		}
+		MesDevice mesDevice = new MesDevice();
+		Long deviceNum = mesDeviceService.findCount(mesDevice);
+		data.put("devices", 15);
 
-		List<MesLineProcess> lists = ListUtils.newArrayList();
-		lists.addAll(processMap.values());
-		Collections.sort(lists, new Comparator<MesLineProcess>() {
-			@Override
-			public int compare(MesLineProcess o1, MesLineProcess o2) {
-				return extractOprnoSortValue(o1.getOprno()).compareTo(extractOprnoSortValue(o2.getOprno()));
+		MesProduct mesProduct1 = new MesProduct();
+		mesProduct1.setState("1");
+		Long actualCount = mesProductService.findCount(mesProduct1);
+		data.put("actual", actualCount);
+
+		data.put("plan", 660);
+		data.put("repair", 10);
+		data.put("scrap", 12);
+
+		List<Map<String, Object>> alarms = new ArrayList<>();
+		MesProcessProduct processProductQuery = new MesProcessProduct();
+		List<MesProcessProduct> processProductList = mesProcessProductService.findList(processProductQuery);
+		logger.info("工位当前产品查询结果数量: " + (processProductList != null ? processProductList.size() : 0));
+		int idx = 1;
+		for (MesProcessProduct processProduct : processProductList) {
+			if (idx > 8) break;
+			logger.info("工位: " + processProduct.getOprno() + ", 工件码: " + processProduct.getSn());
+			if (StringUtils.isNotEmpty(processProduct.getSn())) {
+				Map<String, Object> alarmMap = MapUtils.newHashMap();
+				alarmMap.put("id", idx);
+				alarmMap.put("msg", processProduct.getOprno() + "-" + processProduct.getSn());
+				alarms.add(alarmMap);
+				idx++;
 			}
-		});
-		return lists;
-	}
-
-	private List<MesProductRecord> getDashboardProductRecords(String start, String end) {
-		MesProductRecord mesProductRecord = new MesProductRecord();
-		mesProductRecord.setCraft("100000");
-		mesProductRecord.getSqlMap().getWhere()
-				.and("a.content", QueryType.NE, "UDF")
-				.and("a.update_date", QueryType.GTE, start)
-				.and("a.update_date", QueryType.LT, end);
-		return mesProductRecordService.findList(mesProductRecord);
-	}
-
-	private MesProductRecord getLatestDashboardRecord() {
-		MesProductRecord mesProductRecord = new MesProductRecord();
-		mesProductRecord.setCraft("100000");
-		mesProductRecord.getSqlMap().getWhere().and("a.content", QueryType.NE, "UDF");
-		mesProductRecord.getSqlMap().getOrder().setOrderBy("a.update_date desc limit 1");
-		List<MesProductRecord> records = mesProductRecordService.findList(mesProductRecord);
-		return ListUtils.isEmpty(records) ? null : records.get(0);
-	}
-
-	private Map<String, String> getBusinessDayRange(Date date) {
-		Calendar startCalendar = Calendar.getInstance();
-		startCalendar.setTime(date);
-		if (startCalendar.get(Calendar.HOUR_OF_DAY) < 8) {
-			startCalendar.add(Calendar.DATE, -1);
 		}
-		startCalendar.set(Calendar.HOUR_OF_DAY, 8);
-		startCalendar.set(Calendar.MINUTE, 0);
-		startCalendar.set(Calendar.SECOND, 0);
-		startCalendar.set(Calendar.MILLISECOND, 0);
-
-		Calendar endCalendar = Calendar.getInstance();
-		endCalendar.setTime(startCalendar.getTime());
-		endCalendar.add(Calendar.DATE, 1);
-
-		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		Map<String, String> rangeMap = MapUtils.newHashMap();
-		rangeMap.put("start", simpleDateFormat.format(startCalendar.getTime()));
-		rangeMap.put("end", simpleDateFormat.format(endCalendar.getTime()));
-		return rangeMap;
-	}
-
-	private void fillScreenProcessCount(Map<String, MesLineProcess> processMap, List<MesProductRecord> records, boolean shiftFlag, Map<String, String> titleCache) {
-		for (MesProductRecord record : records) {
-			String oprno = CommonUitl.formatOprno(record.getOprno());
-			if (StringUtils.isEmpty(oprno)) {
-				continue;
-			}
-			MesLineProcess process = processMap.get(oprno);
-			if (process == null) {
-				process = new MesLineProcess();
-				process.setOprno(oprno);
-				process.setTitle(resolveScreenTitle(oprno, record, titleCache));
-				process.setShiftCount(0);
-				process.setDayCount(0);
-				process.setShiftOkCount(0);
-				process.setShiftNgCount(0);
-				processMap.put(oprno, process);
-			}
-			if (shiftFlag) {
-				process.setShiftCount(process.getShiftCount() + 1);
-				if ("OK".equals(record.getContent())) {
-					process.setShiftOkCount(process.getShiftOkCount() + 1);
-				} else if ("NG".equals(record.getContent())) {
-					process.setShiftNgCount(process.getShiftNgCount() + 1);
-				}
-			} else {
-				process.setDayCount(process.getDayCount() + 1);
-			}
+		data.put("alarms", alarms);
+
+		MesToolLife mesToolLifeQuery = new MesToolLife();
+		mesToolLifeQuery.setStatus("0");
+		List<MesToolLife> toolLifeList = mesToolLifeService.findList(mesToolLifeQuery);
+		logger.info("工具寿命查询结果数量: " + (toolLifeList != null ? toolLifeList.size() : 0));
+
+		List<Integer> faulty1 = new ArrayList<>();
+		List<String> faultx = new ArrayList<>();
+		for (MesToolLife toolLife : toolLifeList) {
+			logger.info("工具: " + toolLife.getTitle() + ", 最大寿命: " + toolLife.getMaxLife() + ", 剩余寿命: " + toolLife.getCurLife());
+			faultx.add(toolLife.getTitle());
+			faulty1.add(toolLife.getCurLife() != null ? toolLife.getCurLife() : 0);
 		}
-	}
 
-	private String resolveScreenTitle(String oprno, MesProductRecord record, Map<String, String> titleCache) {
-		String lineSn = record.getLineSn() == null ? "" : record.getLineSn();
-		String cacheKey = oprno + "_" + lineSn;
-		if (titleCache.containsKey(cacheKey)) {
-			return titleCache.get(cacheKey);
-		}
-		String title = "";
-		if (!StringUtils.isEmpty(lineSn)) {
-			MesLineProcess mesLineProcess = mesLineProcessService.findInfoByOprnoLineSn(oprno, lineSn);
-			if (!ObjectUtils.isEmpty(mesLineProcess)) {
-				title = mesLineProcess.getTitle();
-			}
-		}
-		if (StringUtils.isEmpty(title) && !StringUtils.isEmpty(record.getTid())) {
-			MesTemplateItems mesTemplateItems = mesTemplateItemsService.get(record.getTid());
-			if (!ObjectUtils.isEmpty(mesTemplateItems)) {
-				title = mesTemplateItems.getTitle();
-			}
-		}
-		if (StringUtils.isEmpty(title)) {
-			title = oprno;
-		}
-		titleCache.put(cacheKey, title);
-		return title;
-	}
+		data.put("faulty1", faulty1);
+		data.put("faultx", faultx);
+		data.put("faulty2", ListUtils.newArrayList(0, 0, 0, 0, 0, 0, 0));
+		data.put("faulty3", ListUtils.newArrayList(0, 0, 0, 0, 0, 0, 0));
 
-	private Integer extractOprnoSortValue(String oprno) {
-		if (StringUtils.isEmpty(oprno)) {
-			return Integer.MAX_VALUE;
+		List<String> dateList = new ArrayList<>();
+		List<Long> outputList = new ArrayList<>();
+		Calendar calendar = Calendar.getInstance();
+		for (int i = 6; i >= 0; i--) {
+			calendar = Calendar.getInstance();
+			calendar.add(Calendar.DATE, -i);
+			int year = calendar.get(Calendar.YEAR);
+			int month = calendar.get(Calendar.MONTH) + 1;
+			int day = calendar.get(Calendar.DAY_OF_MONTH);
+			String dateStr = month + "月" + day + "日";
+			dateList.add(dateStr);
+
+			String start = year + "-" + month + "-" + day + " 00:00:00";
+			String end = year + "-" + month + "-" + day + " 23:59:59";
+			MesProduct dayProduct = new MesProduct();
+			dayProduct.getSqlMap().getWhere().and("create_date", QueryType.GTE, start);
+			dayProduct.getSqlMap().getWhere().and("create_date", QueryType.LT, end);
+			Long count = mesProductService.findCount(dayProduct);
+			outputList.add(count);
 		}
-		String value = oprno.replaceAll("[^0-9]", "");
-		if (StringUtils.isEmpty(value)) {
-			return Integer.MAX_VALUE;
+		data.put("date", dateList);
+		data.put("output", outputList);
+
+		List<String> hourTimes = new ArrayList<>();
+		List<Long> perHourData = new ArrayList<>();
+		for (int i = 8; i < 18; i++) {
+			hourTimes.add(i + ":00");
+			String start = formattedToday + " " + i + ":00:00";
+			String end = formattedToday + " " + (i + 1) + ":00:00";
+			MesProduct hourProduct = new MesProduct();
+			hourProduct.getSqlMap().getWhere().and("create_date", QueryType.GTE, start);
+			hourProduct.getSqlMap().getWhere().and("create_date", QueryType.LT, end);
+			Long count = mesProductService.findCount(hourProduct);
+			perHourData.add(count);
 		}
-		return Integer.valueOf(value);
-	}
-
-	private Map<String, Object> buildScreenDashboardData(List<MesLineProcess> lists) {
-		Map<String, Object> data = MapUtils.newHashMap();
-		Map<String, Object> overview = MapUtils.newHashMap();
-		List<Map<String, Object>> detailList = ListUtils.newArrayList();
-		List<Map<String, Object>> topList = ListUtils.newArrayList();
-		DecimalFormat decimalFormat = new DecimalFormat("0.0");
-		int totalShift = 0;
-		int totalDay = 0;
-		int totalShiftOk = 0;
-		int totalShiftNg = 0;
-
-		for (MesLineProcess item : lists) {
-			int shiftCount = item.getShiftCount() == null ? 0 : item.getShiftCount();
-			int dayCount = item.getDayCount() == null ? 0 : item.getDayCount();
-			int shiftOkCount = item.getShiftOkCount() == null ? 0 : item.getShiftOkCount();
-			int shiftNgCount = item.getShiftNgCount() == null ? 0 : item.getShiftNgCount();
-			int shiftQualityBase = shiftOkCount + shiftNgCount;
-			double qualityRate = shiftQualityBase > 0 ? shiftOkCount * 100D / shiftQualityBase : 0D;
-			totalShift += shiftCount;
-			totalDay += dayCount;
-			totalShiftOk += shiftOkCount;
-			totalShiftNg += shiftNgCount;
-
-			Map<String, Object> detail = MapUtils.newHashMap();
-			detail.put("oprno", item.getOprno());
-			detail.put("title", item.getTitle());
-			detail.put("shiftCount", shiftCount);
-			detail.put("dayCount", dayCount);
-			detail.put("shiftOkCount", shiftOkCount);
-			detail.put("shiftNgCount", shiftNgCount);
-			detail.put("qualityRate", Double.valueOf(decimalFormat.format(qualityRate)));
-			detailList.add(detail);
-
-			Map<String, Object> topItem = MapUtils.newHashMap();
-			topItem.put("oprno", item.getOprno());
-			topItem.put("title", item.getTitle());
-			topItem.put("dayCount", dayCount);
-			topList.add(topItem);
+		data.put("hourTimes", hourTimes);
+		data.put("perHourData", perHourData);
+
+		List<Long> quality1 = new ArrayList<>();
+		List<Long> quality2 = new ArrayList<>();
+		for (int i = 0; i < outputList.size(); i++) {
+			Long dayOutput = outputList.get(i);
+			Long goodCount = dayOutput - (long)(dayOutput * 0.05);
+			Long badCount = dayOutput - goodCount;
+			quality1.add(goodCount);
+			quality2.add(badCount);
 		}
+		data.put("quality1", quality1);
+		data.put("quality2", quality2);
 
-		Collections.sort(topList, new Comparator<Map<String, Object>>() {
-			@Override
-			public int compare(Map<String, Object> o1, Map<String, Object> o2) {
-				Integer count1 = Integer.valueOf(String.valueOf(o1.get("dayCount")));
-				Integer count2 = Integer.valueOf(String.valueOf(o2.get("dayCount")));
-				return count2.compareTo(count1);
-			}
-		});
-		if (topList.size() > 6) {
-			topList = topList.subList(0, 6);
+		List<Map<String, Object>> oprnoData = new ArrayList<>();
+		MesLineProcess mesLineProcess = new MesLineProcess();
+		mesLineProcess.setStatus("0");
+		mesLineProcess.getSqlMap().getWhere().and("pid", QueryType.IS_NULL, "");
+		List<MesLineProcess> processList1 = mesLineProcessService.findList(mesLineProcess);
+		for (MesLineProcess process : processList1) {
+			String dayOks = mesProductRecordService.getSjOk(process.getOprno(), process.getLineSn(), sdate1, edate1);
+			Map<String, Object> oprnoMap = MapUtils.newHashMap();
+			oprnoMap.put("oprno", process.getOprno());
+			oprnoMap.put("okNum", Integer.valueOf(dayOks));
+			oprnoData.add(oprnoMap);
 		}
+		data.put("oprnoData", oprnoData);
 
-		int totalQualityBase = totalShiftOk + totalShiftNg;
-		double totalRate = totalQualityBase > 0 ? totalShiftOk * 100D / totalQualityBase : 0D;
-		overview.put("count", lists.size());
-		overview.put("totalShift", totalShift);
-		overview.put("totalDay", totalDay);
-		overview.put("shiftOkCount", totalShiftOk);
-		overview.put("shiftNgCount", totalShiftNg);
-		overview.put("qualityRate", Double.valueOf(decimalFormat.format(totalRate)));
-
-		data.put("overview", overview);
-		data.put("list", detailList);
-		data.put("topList", topList);
-		return data;
+		resp.setData(data);
+		resp.setResult(Global.TRUE);
+		return resp;
 	}
 
 	@RequestMapping(value = "indexTj")
@@ -715,4 +712,4 @@ public class MesProductController extends BaseController {
 		resp.setData(map);
 		return resp;
 	}
-}
+}

+ 4 - 4
src/main/java/com/jeesite/modules/mes/web/MesProductRecordController.java

@@ -1542,7 +1542,7 @@ public class MesProductRecordController extends BaseController {
 							long twoHoursInMillis = 15 * 60 * 1000;
 							long timeDifference = System.currentTimeMillis() - mesDeviceTime.getStartDate().getTime();
 							if(timeDifference > twoHoursInMillis){
-								return "RSCS";
+								return "RSJZ";
 							}
 						}
 					}
@@ -1554,7 +1554,7 @@ public class MesProductRecordController extends BaseController {
 							long twoHoursInMillis = 10 * 60 * 1000;
 							long timeDifference = System.currentTimeMillis() - mesDeviceTime.getEndDate().getTime();
 							if(timeDifference > twoHoursInMillis){
-								return "RSCS";
+								return "RSJZ";
 							}
 						}
 					}
@@ -1564,7 +1564,7 @@ public class MesProductRecordController extends BaseController {
 							long twoHoursInMillis = 1 * 60 * 1000;
 							long timeDifference = System.currentTimeMillis() - mesDeviceTime.getStartDate().getTime();
 							if(timeDifference < twoHoursInMillis){
-								return "RSCS";
+								return "RSJZ";
 							}
 						}
 					}
@@ -1576,7 +1576,7 @@ public class MesProductRecordController extends BaseController {
 							long differenceInMillis = System.currentTimeMillis() - mesDeviceTime.getEndDate().getTime();
 							long twoHoursInMillis = 15 * 60 * 1000;
 							if (differenceInMillis >= twoHoursInMillis) {
-								return "RSCS";
+								return "RSJZ";
 							}
 						}
 					}

+ 11 - 10
src/main/resources/config/application.yml

@@ -56,7 +56,7 @@ jdbc:
   driver: com.mysql.cj.jdbc.Driver
 #  url: jdbc:mysql://127.0.0.1:3307/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
   url: jdbc:mysql://192.168.21.99:3306/mescloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-#  url: jdbc:mysql://127.0.0.1:3390/mes-x13?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+#  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_x13?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
   username: mescloud
   password: 8neywEN86NLam3ts
 #  username: root
@@ -622,8 +622,7 @@ shiro:
     ${adminPath}/mes/mesProductRecord/device = anon
     ${adminPath}/mes/mesProduct/screen = anon
     ${adminPath}/mes/mesProduct/screenData = anon
-    ${adminPath}/mes/mesProduct/screenDashboardData = anon
-    ${adminPath}/mes/mesProduct/alarmData = anon
+    ${adminPath}/mes/mesProduct/screenData4 = anon
     ${adminPath}/mes/mesProductCcd/testDate = anon
     ${adminPath}/mes/mesProductCcd/add = anon
     ${adminPath}/mes/mesProductRecord/currentProduct = anon
@@ -671,7 +670,9 @@ shiro:
     ${adminPath}/mes/mesProcessAlarm/add = anon
     ${adminPath}/mes/mesProductRecord/checkDJ = anon
     ${adminPath}/mes/mesGp12Record/upload = anon
-    ${adminPath}/mes/mes/mesProduct/screenDashboardData = anon
+    ${adminPath}/mes/mesProductRecord/select = anon
+    ${adminPath}/mes/mesProductRecord/submit = anon
+    ${adminPath}/mes/mesRepairItems/submit = anon
     ${adminPath}/** = user
 
 
@@ -933,14 +934,14 @@ file:
 
 # 视频转码
 #video:
-#
+#  
 #  # 视频格式转换  ffmpeg.exe 所放的路径
 #  ffmpegFile: d:/tools/video/ffmpeg-4.9/bin/ffmpeg.exe
 #  #ffmpegFile: d:/tools/video/libav-10.6-win64/bin/avconv.exe
-#
+#  
 #  # 视频格式转换  mencoder.exe 所放的路径
 #  mencoderFile: d:/tools/video/mencoder-4.9/mencoder.exe
-#
+#  
 #  # 将mp4视频的元数据信息转到视频第一帧
 #  qtFaststartFile: d:/tools/video/qt-faststart/qt-faststart.exe
 
@@ -967,10 +968,10 @@ msg:
 #      corePoolSize: 5
 #      maxPoolSize: 20
 #      keepAliveSeconds: 60
-#
+#  
 #  # 推送失败次数,如果推送次数超过了设定次数,仍不成功,则放弃并保存到历史
 #  pushFailNumber: 3
-#
+#  
 #  # 邮件发送参数
 #  email:
 #    beanName: emailSendService
@@ -979,7 +980,7 @@ msg:
 #    fromHostName: smtp.163.com
 #    sslOnConnect: false
 #    sslSmtpPort: 994
-#
+#  
 #  # 短信网关
 #  sms:
 #    beanName: smsSendService

二進制
src/main/resources/static/screen/imgs/bg3.png


二進制
src/main/resources/static/screen/imgs/scr4Row1.png


二進制
src/main/resources/static/screen/imgs/small1.png


二進制
src/main/resources/static/screen/imgs/small2.png


二進制
src/main/resources/static/screen/imgs/small3.png


二進制
src/main/resources/static/screen/imgs/small4.png


二進制
src/main/resources/static/screen/imgs/small5.png


二進制
src/main/resources/static/screen/imgs/small6.png


二進制
src/main/resources/static/screen/imgs/small7.png


二進制
src/main/resources/static/screen/imgs/small8.png


二進制
src/main/resources/static/screen/imgs/smallTop.png


二進制
src/main/resources/static/screen/imgs/smallbg.png


二進制
src/main/resources/static/screen/imgs/srcrow-bg.png


二進制
src/main/resources/static/screen/imgs/srcrow11.png


二進制
src/main/resources/static/screen/imgs/srcrow12.png


二進制
src/main/resources/static/screen/imgs/srcrow13.png


二進制
src/main/resources/static/screen/imgs/srcrow14.png


二進制
src/main/resources/static/screen/imgs/srcrow15.png


二進制
src/main/resources/static/screen/imgs/srcrow16.png


二進制
src/main/resources/static/screen/imgs/srcrow21.png


二進制
src/main/resources/static/screen/imgs/srcrow22.png


二進制
src/main/resources/static/screen/imgs/srcrow22n.png


二進制
src/main/resources/static/screen/imgs/srcrow2table1.png


二進制
src/main/resources/static/screen/imgs/srcrow2table2.png


二進制
src/main/resources/static/screen/imgs/srcrow3.png


二進制
src/main/resources/static/screen/imgs/srcrowNO1.png


二進制
src/main/resources/static/screen/imgs/srcrowNO2.png


二進制
src/main/resources/static/screen/imgs/srcrowNO3.png


File diff suppressed because it is too large
+ 1372 - 0
src/main/resources/views/modules/mes/mesScreen4.html