hfy преди 3 месеца
родител
ревизия
a5e4e75c50

+ 49 - 1
src/main/resources/mappings/modules/mes/MesDeviceTimeDao.xml

@@ -2,6 +2,54 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jeesite.modules.mes.dao.MesDeviceTimeDao">
 	
+	<select id="findList" resultType="MesDeviceTime">
+		SELECT
+			a.id AS "id",
+			a.oprno AS "oprno",
+			a.sn AS "sn",
+			a.start_date AS "startDate",
+			a.end_date AS "endDate",
+			a.interval AS "interval",
+			a.create_date AS "createDate",
+			a.update_date AS "updateDate",
+			a.scheduled_date AS "scheduledDate",
+			a.transfer AS "transfer",
+			a.product_cate AS "productCate",
+			COALESCE((
+				SELECT p.create_by
+				FROM mes_product_record p
+				WHERE p.sn = a.sn
+					AND p.line_sn = a.product_cate
+					AND (p.oprno = a.oprno OR p.oprno = LEFT(a.oprno, 5) OR LEFT(p.oprno, 5) = a.oprno)
+					AND p.create_by IS NOT NULL
+					AND p.create_by != ''
+				ORDER BY
+					CASE WHEN p.oprno = a.oprno THEN 0 ELSE 1 END,
+					p.update_date DESC,
+					p.id DESC
+				LIMIT 1
+			), '') AS "createBy",
+			COALESCE((
+				SELECT p.update_by
+				FROM mes_product_record p
+				WHERE p.sn = a.sn
+					AND p.line_sn = a.product_cate
+					AND (p.oprno = a.oprno OR p.oprno = LEFT(a.oprno, 5) OR LEFT(p.oprno, 5) = a.oprno)
+					AND p.update_by IS NOT NULL
+					AND p.update_by != ''
+				ORDER BY
+					CASE WHEN p.oprno = a.oprno THEN 0 ELSE 1 END,
+					p.update_date DESC,
+					p.id DESC
+				LIMIT 1
+			), '') AS "updateBy"
+		FROM mes_device_time a
+		<where>
+			${sqlMap.where.toSql()}
+		</where>
+		ORDER BY ${sqlMap.order.toSql()}
+	</select>
+
 	<!-- 查询数据
 	<select id="findList" resultType="MesDeviceTime">
 		SELECT ${sqlMap.column.toSql()}
@@ -21,4 +69,4 @@
         ORDER BY create_date DESC
         LIMIT 1
     </select>
-</mapper>
+</mapper>

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

@@ -80,9 +80,9 @@ $('#dataGrid').dataGrid({
 		// 		return "否";
 		// 	}
 		// }},
-		{header:'${text("创建人")}', name:'createBy', index:'a.create_by', width:120, align:"center"},
+		{header:'${text("创建人")}', name:'createBy', width:120, align:"center", sortable:false},
 		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:120, align:"center"},
-		{header:'${text("更新人")}', name:'updateBy', index:'a.update_by', width:120, align:"center"},
+		{header:'${text("更新人")}', name:'updateBy', width:120, align:"center", sortable:false},
 		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:125, align:"center"},
 		//{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
 		// {header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){

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

@@ -45,7 +45,7 @@ $('#dataGrid').dataGrid({
 			return '<a href="${ctx}/mes/mesProductRecord/winfo?id='+row.id+'" class="btnList" data-title="${text("查看记录详情")}">'+(val||row.id)+'</a>';
 		}},
 		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:90, align:"center"},
-		{header:'${text("作业人员")}', name:'materielSn', index:'a.materielSn', width:150, align:"center"},
+		{header:'${text("作业人员")}', name:'updateBy', index:'a.update_by', width:150, align:"center"},
 		{header:'${text("日期")}', name:'updateDate', index:'a.update_date', width:160, align:"center" },
 		{header:'${text("工位结果")}', name:'content', index:'a.content', width:100, align:"center"},
 	],
@@ -68,4 +68,4 @@ $('#btnExport').click(function(){
 		downloadFile:true
 	});
 });
-</script>
+</script>