liuwei 2 месяцев назад
Родитель
Сommit
2477a9268e

+ 5 - 5
src/main/java/com/jeesite/modules/mes/entity/MesProductScreen.java

@@ -16,10 +16,10 @@ import javax.validation.constraints.Size;
  */
 @Table(name="mes_product_screen", alias="a", label="大屏展示配置信息", columns={
 		@Column(name="id", attrName="id", label="id", isPK=true),
-		@Column(name="screen_type", attrName="screenType", label="大屏类型", comment="MP毛坯 JJ机加 BP半成品", queryType=QueryType.EQ),
+		@Column(name="screen_type", attrName="screenType", label="大屏类型", comment="ZS总屏 MP毛坯 JJ机加", queryType=QueryType.EQ),
 		@Column(name="people_num", attrName="peopleNum", label="生产人数"),
 		@Column(name="machine_num", attrName="machineNum", label="设备数量"),
-		@Column(name="plan_output", attrName="planOutput", label="计划产量"),
+		@Column(name="plan_output", attrName="planOutput", label="每日计划"),
 		@Column(name="create_by", attrName="createBy", label="创建人", isUpdate=false, isQuery=false),
 		@Column(name="create_date", attrName="createDate", label="创建日期", isUpdate=false, isQuery=false, isUpdateForce=true),
 		@Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
@@ -29,7 +29,7 @@ import javax.validation.constraints.Size;
 public class MesProductScreen extends DataEntity<MesProductScreen> {
 
 	private static final long serialVersionUID = 1L;
-	/** MP毛坯 / JJ机加 / BP半成品 */
+	/** ZS总屏 / MP毛坯 / JJ机加 */
 	private String screenType;
 	private String peopleNum;
 	private String machineNum;
@@ -73,8 +73,8 @@ public class MesProductScreen extends DataEntity<MesProductScreen> {
 		this.machineNum = machineNum;
 	}
 
-	@NotBlank(message="计划产量不能为空")
-	@Size(min=0, max=255, message="计划产量长度不能超过 255 个字符")
+	@NotBlank(message="每日计划不能为空")
+	@Size(min=0, max=255, message="每日计划长度不能超过 255 个字符")
 	public String getPlanOutput() {
 		return planOutput;
 	}

+ 2 - 2
src/main/java/com/jeesite/modules/mes/service/MesProductScreenService.java

@@ -54,7 +54,7 @@ public class MesProductScreenService extends CrudService<MesProductScreenDao, Me
 
 	/**
 	 * 按大屏类型取最新一条配置。screenType 为空时取全局最新(兼容旧调用)。
-	 * MP毛坯 / JJ机加 / BP半成品
+	 * ZS总屏 / MP毛坯 / JJ机加
 	 */
 	public MesProductScreen getLatestByScreenType(String screenType) {
 		String code = normalizeScreenType(screenType);
@@ -76,7 +76,7 @@ public class MesProductScreenService extends CrudService<MesProductScreenDao, Me
 		return null;
 	}
 
-	/** JeeSite select 可能提交成 JJ=机加大屏,统一成 JJ / MP / BP */
+	/** JeeSite select 可能提交成 JJ=机加大屏,统一成 ZS / JJ / MP */
 	public static String normalizeScreenType(String screenType) {
 		if (screenType == null) {
 			return "";

+ 5 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductController.java

@@ -362,6 +362,11 @@ public class MesProductController extends BaseController {
 
 	@RequestMapping(value = {"screen", ""})
 	public String screen(Model model) {
+		return "modules/mes/mesScreenRotate";
+	}
+
+	@RequestMapping(value = {"screenAll"})
+	public String screenAll(Model model) {
 		return "modules/mes/mesScreen3";
 	}
 

+ 1 - 1
src/main/java/com/jeesite/modules/mes/web/MesProductScreenController.java

@@ -96,9 +96,9 @@ public class MesProductScreenController extends BaseController {
 
 	private static Map<String, String> buildScreenTypeMap() {
 		Map<String, String> map = new java.util.LinkedHashMap<>();
+		map.put("ZS", "总屏");
 		map.put("MP", "毛坯大屏");
 		map.put("JJ", "机加大屏");
-		map.put("BP", "半成品大屏");
 		return map;
 	}
 

+ 6 - 0
src/main/resources/config/application.yml

@@ -642,7 +642,13 @@ shiro:
     ${adminPath}/mes/mesProductRecord/qmresult = anon
     ${adminPath}/mes/mesProductRecord/device = anon
     ${adminPath}/mes/mesProduct/screen = anon
+    ${adminPath}/mes/mesProduct/screenAll = anon
+    ${adminPath}/mes/mesProduct/screen3 = anon
+    ${adminPath}/mes/mesProduct/screen5 = anon
     ${adminPath}/mes/mesProduct/screenData = anon
+    ${adminPath}/mes/mesProductScreen/latestConfig = anon
+    ${adminPath}/mes/mesProductScreen/lineProcessList = anon
+    ${adminPath}/mes/mesProductRecord/weekQualityData = anon
     ${adminPath}/mes/mesProductCcd/testDate = anon
     ${adminPath}/mes/mesProductCcd/add = anon
     ${adminPath}/mes/mesProductRecord/currentProduct = anon

+ 2 - 2
src/main/resources/views/modules/mes/mesProductScreenForm.html

@@ -21,9 +21,9 @@
 							<div class="col-sm-8">
 								<select name="screenType" id="screenType" class="form-control required">
 									<option value="">${text('-- 请选择 --')}</option>
+									<option value="ZS">总屏</option>
 									<option value="MP">毛坯大屏</option>
 									<option value="JJ">机加大屏</option>
-									<option value="BP">半成品大屏</option>
 								</select>
 							</div>
 						</div>
@@ -49,7 +49,7 @@
 					<div class="col-xs-6">
 						<div class="form-group">
 							<label class="control-label col-sm-4" title="">
-								<span class="required ">*</span> ${text('计划产量')}:<i class="fa icon-question hide"></i></label>
+								<span class="required ">*</span> ${text('每日计划')}:<i class="fa icon-question hide"></i></label>
 							<div class="col-sm-8">
 								<#form:input path="planOutput" maxlength="255" class="form-control required digits"/>
 							</div>

+ 4 - 4
src/main/resources/views/modules/mes/mesProductScreenList.html

@@ -22,9 +22,9 @@
 					<div class="control-inline">
 						<select name="screenType" class="form-control width-120">
 							<option value="">${text('全部')}</option>
+							<option value="ZS">总屏</option>
 							<option value="MP">毛坯大屏</option>
 							<option value="JJ">机加大屏</option>
-							<option value="BP">半成品大屏</option>
 						</select>
 					</div>
 				</div>
@@ -41,7 +41,7 @@
 					</div>
 				</div>
 				<div class="form-group">
-					<label class="control-label">${text('计划产量')}:</label>
+					<label class="control-label">${text('每日计划')}:</label>
 					<div class="control-inline">
 						<#form:input path="planOutput" maxlength="255" class="form-control width-120"/>
 					</div>
@@ -65,14 +65,14 @@ $('#dataGrid').dataGrid({
 			var code = String(val || '');
 			var eq = code.indexOf('=');
 			if (eq > 0) code = code.substring(0, eq);
+			if (code === 'ZS') return '总屏';
 			if (code === 'MP') return '毛坯大屏';
 			if (code === 'JJ') return '机加大屏';
-			if (code === 'BP') return '半成品大屏';
 			return val || '';
 		}},
 		{header:'${text("生产人数")}', name:'peopleNum', index:'a.people_num', width:150, align:"center"},
 		{header:'${text("设备数量")}', name:'machineNum', index:'a.machine_num', width:150, align:"center"},
-		{header:'${text("计划产量")}', name:'planOutput', index:'a.plan_output', width:150, align:"center"},
+		{header:'${text("每日计划")}', name:'planOutput', index:'a.plan_output', width:150, align:"center"},
 		{header:'${text("操作人")}', name:'createBy', index:'a.create_by', width:150, align:"center"},
 		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
 			var actions = [];

+ 4 - 2
src/main/resources/views/modules/mes/mesScreen3.html

@@ -704,7 +704,7 @@
 					<div class="card-value" id="deviceCount">56</div>
 				</div>
 				<div class="mes3-data-card">
-					<div class="card-label">计划产量</div>
+					<div class="card-label">每日计划</div>
 					<div class="card-value" id="planProduction">221</div>
 				</div>
 				<div class="mes3-data-card">
@@ -1509,12 +1509,14 @@
 		renderAlerts();
 	}
 
-	/** 总览三卡:生产人数 / 设备数量 / 计划产量 <- mesProductScreen 最新配置 */
+	/** 总览三卡:生产人数 / 设备数量 / 每日计划 <- mesProductScreen 总屏配置 */
+	var SCREEN_TYPE = 'ZS';
 	function updateScreenConfigByApi() {
 		$.ajax({
 			url: '${ctx}/mes/mesProductScreen/latestConfig',
 			type: 'POST',
 			dataType: 'json',
+			data: { screenType: SCREEN_TYPE },
 			success: function(resp) {
 				if (!resp || resp.result !== 'true' || !resp.data) return;
 				var d = resp.data;

+ 33 - 6
src/main/resources/views/modules/mes/mesScreen4.html

@@ -186,8 +186,8 @@
 			height: 58px;
 			color: #4DC9F5;
 			font-weight: bold;
-			font-size: 20px;
-			letter-spacing: 1px;
+			font-size: 18px;
+			letter-spacing: 0;
 			background: rgba(0, 100, 180, 0.28);
 			border-bottom: 2px solid rgba(77, 201, 245, 0.5);
 			text-align: center;
@@ -329,9 +329,9 @@
 				<tr>
 					<th style="width:160px">工位</th>
 					<th style="width:300px">工位名称</th>
-					<th>当天产量</th>
-					<th>当班产量</th>
-					<th>上班产量</th>
+					<th id="thDayCapacity">当天产量</th>
+					<th id="thShiftCapacity">当班产量</th>
+					<th id="thPrevShiftCapacity">上班产量</th>
 				</tr>
 				</thead>
 				<tbody id="opTableBody"></tbody>
@@ -358,7 +358,7 @@
 						<div class="oc-value"><span id="deviceCount">56</span></div>
 					</div>
 					<div class="overview-card">
-						<div class="oc-label">计划产量</div>
+						<div class="oc-label">每日计划</div>
 						<div class="oc-value"><span id="planProduction">221</span></div>
 					</div>
 					<div class="overview-card">
@@ -409,6 +409,32 @@
 
 	function pad(n) { return n < 10 ? '0' + n : '' + n; }
 
+	function formatMd(d) {
+		return (d.getMonth() + 1) + '.' + d.getDate();
+	}
+
+	function updateCapacityHeaders() {
+		var now = new Date();
+		var hour = now.getHours();
+		var today = formatMd(now);
+		var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
+		var ymd = formatMd(yesterday);
+		var dayEl = document.getElementById('thDayCapacity');
+		var shiftEl = document.getElementById('thShiftCapacity');
+		var prevEl = document.getElementById('thPrevShiftCapacity');
+		if (dayEl) dayEl.textContent = today + '产量';
+		if (hour >= 8 && hour < 20) {
+			if (shiftEl) shiftEl.textContent = today + '白班';
+			if (prevEl) prevEl.textContent = ymd + '夜班';
+		} else if (hour >= 20) {
+			if (shiftEl) shiftEl.textContent = today + '夜班';
+			if (prevEl) prevEl.textContent = today + '白班';
+		} else {
+			if (shiftEl) shiftEl.textContent = ymd + '夜班';
+			if (prevEl) prevEl.textContent = ymd + '白班';
+		}
+	}
+
 	function updateClock() {
 		var now = new Date();
 		var y = now.getFullYear();
@@ -418,6 +444,7 @@
 		document.getElementById('mes4Date').textContent = y + '年' + pad(m) + '月' + pad(d) + '日 ' + w;
 		var h = now.getHours(), mi = now.getMinutes(), s = now.getSeconds();
 		document.getElementById('mes4Time').textContent = pad(h) + ':' + pad(mi) + ':' + pad(s);
+		updateCapacityHeaders();
 	}
 
 	// ====== 页面数据 ======

+ 33 - 6
src/main/resources/views/modules/mes/mesScreen5.html

@@ -188,8 +188,8 @@
 			height: 56px;
 			color: #4DC9F5;
 			font-weight: bold;
-			font-size: 20px;
-			letter-spacing: 1px;
+			font-size: 18px;
+			letter-spacing: 0;
 			background: rgba(0, 100, 180, 0.28);
 			border-bottom: 2px solid rgba(77, 201, 245, 0.5);
 			text-align: center;
@@ -347,9 +347,9 @@
 				<tr>
 					<th style="width:160px">工位</th>
 					<th style="width:300px">工位名称</th>
-					<th>当天产量</th>
-					<th>当班产量</th>
-					<th>上班产量</th>
+					<th id="thDayCapacity">当天产量</th>
+					<th id="thShiftCapacity">当班产量</th>
+					<th id="thPrevShiftCapacity">上班产量</th>
 				</tr>
 				</thead>
 				<tbody id="opTableBody"></tbody>
@@ -376,7 +376,7 @@
 						<div class="oc-value"><span id="deviceCount">56</span></div>
 					</div>
 					<div class="overview-card">
-						<div class="oc-label">计划产量</div>
+						<div class="oc-label">每日计划</div>
 						<div class="oc-value"><span id="planProduction">221</span></div>
 					</div>
 					<div class="overview-card">
@@ -427,6 +427,32 @@
 
 	function pad(n) { return n < 10 ? '0' + n : '' + n; }
 
+	function formatMd(d) {
+		return (d.getMonth() + 1) + '.' + d.getDate();
+	}
+
+	function updateCapacityHeaders() {
+		var now = new Date();
+		var hour = now.getHours();
+		var today = formatMd(now);
+		var yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
+		var ymd = formatMd(yesterday);
+		var dayEl = document.getElementById('thDayCapacity');
+		var shiftEl = document.getElementById('thShiftCapacity');
+		var prevEl = document.getElementById('thPrevShiftCapacity');
+		if (dayEl) dayEl.textContent = today + '产量';
+		if (hour >= 8 && hour < 20) {
+			if (shiftEl) shiftEl.textContent = today + '白班';
+			if (prevEl) prevEl.textContent = ymd + '夜班';
+		} else if (hour >= 20) {
+			if (shiftEl) shiftEl.textContent = today + '夜班';
+			if (prevEl) prevEl.textContent = today + '白班';
+		} else {
+			if (shiftEl) shiftEl.textContent = ymd + '夜班';
+			if (prevEl) prevEl.textContent = ymd + '白班';
+		}
+	}
+
 	/** 工位表:每页条数与自动翻页间隔(毫秒) */
 	var OP_TABLE_PAGE_SIZE = 6;
 	var OP_TABLE_PAGE_ROTATE_MS = 8000;
@@ -482,6 +508,7 @@
 		document.getElementById('mes4Date').textContent = y + '年' + pad(m) + '月' + pad(d) + '日 ' + w;
 		var h = now.getHours(), mi = now.getMinutes(), s = now.getSeconds();
 		document.getElementById('mes4Time').textContent = pad(h) + ':' + pad(mi) + ':' + pad(s);
+		updateCapacityHeaders();
 	}
 
 	// ====== 页面数据 ======