hfy 3 месяцев назад
Родитель
Сommit
38788915f7

+ 14 - 0
db/mysql/create_mes_client_upgrade.sql

@@ -0,0 +1,14 @@
+CREATE TABLE IF NOT EXISTS `mes_client_upgrade` (
+  `id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'id',
+  `version` int(11) NULL DEFAULT NULL COMMENT 'version',
+  `line_sn` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'line sn',
+  `oprno` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'station oprno',
+  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'update content',
+  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'state',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'create by',
+  `create_date` datetime NOT NULL COMMENT 'create date',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'update by',
+  `update_date` datetime NOT NULL COMMENT 'update date',
+  PRIMARY KEY (`id`) USING BTREE,
+  KEY `idx_mes_client_upgrade_match` (`state`, `line_sn`, `oprno`, `version`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'client upgrade package' ROW_FORMAT = DYNAMIC;

+ 10 - 0
src/main/java/com/jeesite/modules/mes/dao/MesClientUpgradeDao.java

@@ -0,0 +1,10 @@
+package com.jeesite.modules.mes.dao;
+
+import com.jeesite.common.dao.CrudDao;
+import com.jeesite.common.mybatis.annotation.MyBatisDao;
+import com.jeesite.modules.mes.entity.MesClientUpgrade;
+
+@MyBatisDao
+public interface MesClientUpgradeDao extends CrudDao<MesClientUpgrade> {
+	MesClientUpgrade findLatestVersion(MesClientUpgrade mesClientUpgrade);
+}

+ 93 - 0
src/main/java/com/jeesite/modules/mes/entity/MesClientUpgrade.java

@@ -0,0 +1,93 @@
+package com.jeesite.modules.mes.entity;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.Size;
+
+import com.jeesite.common.entity.DataEntity;
+import com.jeesite.common.mybatis.annotation.Column;
+import com.jeesite.common.mybatis.annotation.Table;
+import com.jeesite.common.mybatis.mapper.query.QueryType;
+
+@Table(name="mes_client_upgrade", alias="a", label="client upgrade", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="version", attrName="version", label="version", isUpdateForce=true),
+		@Column(name="line_sn", attrName="lineSn", label="lineSn", queryType=QueryType.LIKE),
+		@Column(name="oprno", attrName="oprno", label="oprno", queryType=QueryType.LIKE),
+		@Column(name="content", attrName="content", label="content", queryType=QueryType.LIKE),
+		@Column(name="state", attrName="state", label="state"),
+		@Column(name="create_by", attrName="createBy", label="createBy", isUpdate=false, isQuery=false),
+		@Column(name="create_date", attrName="createDate", label="createDate", isUpdate=false, isQuery=false),
+		@Column(name="update_by", attrName="updateBy", label="updateBy", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="updateDate", isQuery=false),
+	}, orderBy="a.update_date DESC"
+)
+public class MesClientUpgrade extends DataEntity<MesClientUpgrade> {
+
+	private static final long serialVersionUID = 1L;
+	private Long version;
+	private String lineSn;
+	private String oprno;
+	private String content;
+	private String state;
+	private String path;
+
+	public MesClientUpgrade() {
+		this(null);
+	}
+
+	public MesClientUpgrade(String id) {
+		super(id);
+	}
+
+	public Long getVersion() {
+		return version;
+	}
+
+	public void setVersion(Long version) {
+		this.version = version;
+	}
+
+	@Size(min=0, max=100)
+	public String getLineSn() {
+		return lineSn;
+	}
+
+	public void setLineSn(String lineSn) {
+		this.lineSn = lineSn;
+	}
+
+	@Size(min=0, max=255)
+	public String getOprno() {
+		return oprno;
+	}
+
+	public void setOprno(String oprno) {
+		this.oprno = oprno;
+	}
+
+	public String getContent() {
+		return content;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	@NotBlank
+	@Size(min=0, max=1)
+	public String getState() {
+		return state;
+	}
+
+	public void setState(String state) {
+		this.state = state;
+	}
+
+	public String getPath() {
+		return path;
+	}
+
+	public void setPath(String path) {
+		this.path = path;
+	}
+}

+ 66 - 0
src/main/java/com/jeesite/modules/mes/service/MesClientUpgradeService.java

@@ -0,0 +1,66 @@
+package com.jeesite.modules.mes.service;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.file.utils.FileUploadUtils;
+import com.jeesite.modules.mes.dao.MesClientUpgradeDao;
+import com.jeesite.modules.mes.entity.MesClientUpgrade;
+
+@Service
+public class MesClientUpgradeService extends CrudService<MesClientUpgradeDao, MesClientUpgrade> {
+
+	@Override
+	public MesClientUpgrade get(MesClientUpgrade mesClientUpgrade) {
+		return super.get(mesClientUpgrade);
+	}
+
+	@Override
+	public Page<MesClientUpgrade> findPage(MesClientUpgrade mesClientUpgrade) {
+		return super.findPage(mesClientUpgrade);
+	}
+
+	@Override
+	public List<MesClientUpgrade> findList(MesClientUpgrade mesClientUpgrade) {
+		return super.findList(mesClientUpgrade);
+	}
+
+	@Override
+	@Transactional
+	public void save(MesClientUpgrade mesClientUpgrade) {
+		super.save(mesClientUpgrade);
+		FileUploadUtils.saveFileUpload(mesClientUpgrade, mesClientUpgrade.getId(), "mesClientUpgrade_file");
+	}
+
+	@Override
+	@Transactional
+	public void updateStatus(MesClientUpgrade mesClientUpgrade) {
+		super.updateStatus(mesClientUpgrade);
+	}
+
+	@Override
+	@Transactional
+	public void delete(MesClientUpgrade mesClientUpgrade) {
+		super.delete(mesClientUpgrade);
+	}
+
+	public MesClientUpgrade findLatestVersion(String lineSn, String oprno) {
+		MesClientUpgrade mesClientUpgrade = new MesClientUpgrade();
+		mesClientUpgrade.setState("0");
+		mesClientUpgrade.setLineSn(trimToNull(lineSn));
+		mesClientUpgrade.setOprno(trimToNull(oprno));
+		return dao.findLatestVersion(mesClientUpgrade);
+	}
+
+	private String trimToNull(String value) {
+		if (value == null) {
+			return null;
+		}
+		value = value.trim();
+		return value.length() == 0 ? null : value;
+	}
+}

+ 304 - 0
src/main/java/com/jeesite/modules/mes/web/MesClientUpgradeController.java

@@ -0,0 +1,304 @@
+package com.jeesite.modules.mes.web;
+
+import com.jeesite.common.collect.ListUtils;
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.lang.ObjectUtils;
+import com.jeesite.common.lang.StringUtils;
+import com.jeesite.common.mybatis.mapper.query.QueryType;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.file.entity.FileUpload;
+import com.jeesite.modules.file.service.FileUploadService;
+import com.jeesite.modules.mes.entity.MesClientUpgrade;
+import com.jeesite.modules.mes.entity.MesLine;
+import com.jeesite.modules.mes.entity.MesLineProcess;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesClientUpgradeService;
+import com.jeesite.modules.mes.service.MesLineService;
+import com.jeesite.modules.mes.service.MesLineProcessService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesClientUpgrade")
+public class MesClientUpgradeController extends BaseController {
+
+	@Autowired
+	private MesClientUpgradeService mesClientUpgradeService;
+
+	@Autowired
+	private MesLineProcessService mesLineProcessService;
+
+	@Autowired
+	private MesLineService mesLineService;
+
+	@Resource
+	private FileUploadService fileUploadService;
+
+	@ModelAttribute
+	public MesClientUpgrade get(String id, boolean isNewRecord) {
+		return mesClientUpgradeService.get(id, isNewRecord);
+	}
+
+	@RequiresPermissions("mes:mesClient:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesClientUpgrade mesClientUpgrade, Model model, HttpServletRequest request) {
+		boolean lineProcessJar = "1".equals(request.getParameter("lineProcessJar"));
+		String lineProcessId = request.getParameter("lineProcessId");
+		fillLineProcessJarLineSn(mesClientUpgrade, lineProcessId);
+		model.addAttribute("mesClientUpgrade", mesClientUpgrade);
+		model.addAttribute("lineProcessJar", lineProcessJar);
+		model.addAttribute("lineProcessId", lineProcessId);
+		return "modules/mes/mesClientUpgradeList";
+	}
+
+	@RequiresPermissions("mes:mesClient:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesClientUpgrade> listData(MesClientUpgrade mesClientUpgrade,
+			HttpServletRequest request, HttpServletResponse response) {
+		if ("1".equals(request.getParameter("lineProcessJar"))) {
+			List<String> oprnos = fillLineProcessJarLineSn(mesClientUpgrade, request.getParameter("lineProcessId"));
+			if (StringUtils.isNotBlank(mesClientUpgrade.getLineSn())) {
+				mesClientUpgrade.getSqlMap().getWhere().and("a.line_sn", QueryType.EQ, mesClientUpgrade.getLineSn());
+				mesClientUpgrade.setLineSn(null);
+			}
+			if (!oprnos.isEmpty()) {
+				mesClientUpgrade.getSqlMap().getWhere().and("a.oprno", QueryType.IN, oprnos.toArray(new String[0]));
+				mesClientUpgrade.setOprno(null);
+			} else if (StringUtils.isNotBlank(mesClientUpgrade.getOprno())) {
+				mesClientUpgrade.getSqlMap().getWhere().and("a.oprno", QueryType.EQ, mesClientUpgrade.getOprno());
+				mesClientUpgrade.setOprno(null);
+			}
+		}
+		mesClientUpgrade.setPage(new Page<>(request, response));
+		return mesClientUpgradeService.findPage(mesClientUpgrade);
+	}
+
+	private List<String> fillLineProcessJarLineSn(MesClientUpgrade mesClientUpgrade, String lineProcessId) {
+		List<String> oprnos = new ArrayList<>();
+		if (StringUtils.isBlank(lineProcessId)) {
+			return oprnos;
+		}
+		MesLineProcess lineProcess = mesLineProcessService.get(lineProcessId);
+		if (lineProcess == null) {
+			return oprnos;
+		}
+		if (StringUtils.isBlank(mesClientUpgrade.getLineSn())) {
+			String lineSn = lineProcess.getLineSn();
+			if (StringUtils.isBlank(lineSn) && StringUtils.isNotBlank(lineProcess.getLineId())) {
+				MesLine line = mesLineService.get(lineProcess.getLineId());
+				if (line != null) {
+					lineSn = line.getSn();
+				}
+			}
+			mesClientUpgrade.setLineSn(lineSn);
+		}
+		for (MesLineProcess child : findChildLineProcesses(lineProcessId)) {
+			if (StringUtils.isNotBlank(child.getOprno())) {
+				oprnos.add(child.getOprno());
+			}
+		}
+		if (oprnos.isEmpty() && StringUtils.isNotBlank(lineProcess.getOprno())) {
+			oprnos.add(lineProcess.getOprno());
+		}
+		return oprnos;
+	}
+
+	private List<MesLineProcess> findChildLineProcesses(String lineProcessId) {
+		if (StringUtils.isBlank(lineProcessId)) {
+			return ListUtils.newArrayList();
+		}
+		MesLineProcess childQuery = new MesLineProcess();
+		childQuery.setPid(lineProcessId);
+		return mesLineProcessService.findList(childQuery);
+	}
+
+	@RequiresPermissions("mes:mesClient:view")
+	@RequestMapping(value = "form")
+	public String form(MesClientUpgrade mesClientUpgrade, Model model, HttpServletRequest request) {
+		String lineProcessId = request.getParameter("lineProcessId");
+		boolean lineProcessJar = StringUtils.isNotBlank(lineProcessId);
+		if (lineProcessJar) {
+			fillLineProcessJarLineSn(mesClientUpgrade, lineProcessId);
+			model.addAttribute("childLineProcessList", findChildLineProcesses(lineProcessId));
+		}
+		model.addAttribute("mesClientUpgrade", mesClientUpgrade);
+		model.addAttribute("lineProcessJar", lineProcessJar);
+		model.addAttribute("lineProcessId", lineProcessId);
+		return "modules/mes/mesClientUpgradeForm";
+	}
+
+	@RequiresPermissions("mes:mesClient:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesClientUpgrade mesClientUpgrade) {
+		mesClientUpgradeService.save(mesClientUpgrade);
+		return renderResult(Global.TRUE, text("保存客户端升级版本成功!"));
+	}
+
+	@RequiresPermissions("mes:mesClient:edit")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesClientUpgrade mesClientUpgrade) {
+		mesClientUpgradeService.delete(mesClientUpgrade);
+		return renderResult(Global.TRUE, text("删除客户端升级版本成功!"));
+	}
+
+	@RequestMapping(value = "checkUpdate")
+	@ResponseBody
+	public CommonResp<ClientUpdateInfo> checkUpdate(HttpServletRequest request) {
+		CommonResp<ClientUpdateInfo> resp = new CommonResp<>();
+		String lineSn = trimToNull(request.getParameter("lineSn"));
+		String oprno = trimToNull(request.getParameter("oprno"));
+		//获取最大版本的实体
+		MesClientUpgrade latest = mesClientUpgradeService.findLatestVersion(lineSn, oprno);
+		if (ObjectUtils.isEmpty(latest)) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("no version record");
+			return resp;
+		}
+
+		FileUpload fu = new FileUpload();
+		fu.setBizKey(latest.getId());
+		fu.setBizType("mesClientUpgrade_file");
+		List<FileUpload> files = fileUploadService.findList(fu);
+		if (ListUtils.isEmpty(files)) {
+			resp.setResult(Global.FALSE);
+			resp.setMessage("no downloadable file");
+			return resp;
+		}
+
+		Long currentVersion = parseLong(request.getParameter("currentVersion"));
+		FileUpload file = files.get(0);
+		ClientUpdateInfo updateInfo = new ClientUpdateInfo();
+		updateInfo.setCurrentVersion(currentVersion);
+		updateInfo.setLatestVersion(latest.getVersion());
+		updateInfo.setLineSn(latest.getLineSn());
+		updateInfo.setOprno(latest.getOprno());
+		updateInfo.setHasUpdate(currentVersion == null || latest.getVersion() != null && latest.getVersion() > currentVersion);
+		updateInfo.setContent(latest.getContent());
+		updateInfo.setDownloadUrl(buildFileUrl(request, file.getFileUrl()));
+		updateInfo.setFileName(extractFileName(file.getFileUrl()));
+		resp.setData(updateInfo);
+		resp.setResult(Global.TRUE);
+		return resp;
+	}
+
+	private String buildFileUrl(HttpServletRequest request, String fileUrl) {
+		String host = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
+		return host + request.getContextPath() + fileUrl;
+	}
+
+	private String trimToNull(String value) {
+		if (value == null) {
+			return null;
+		}
+		value = value.trim();
+		return value.length() == 0 ? null : value;
+	}
+
+	private String extractFileName(String fileUrl) {
+		if (fileUrl == null) {
+			return null;
+		}
+		int index = fileUrl.lastIndexOf('/');
+		return index >= 0 ? fileUrl.substring(index + 1) : fileUrl;
+	}
+
+	private Long parseLong(String value) {
+		try {
+			return ObjectUtils.isEmpty(value) ? null : Long.valueOf(value);
+		} catch (NumberFormatException ex) {
+			return null;
+		}
+	}
+
+	public static class ClientUpdateInfo {
+		private Long currentVersion;
+		private Long latestVersion;
+		private String lineSn;
+		private String oprno;
+		private boolean hasUpdate;
+		private String content;
+		private String downloadUrl;
+		private String fileName;
+
+		public Long getCurrentVersion() {
+			return currentVersion;
+		}
+
+		public void setCurrentVersion(Long currentVersion) {
+			this.currentVersion = currentVersion;
+		}
+
+		public Long getLatestVersion() {
+			return latestVersion;
+		}
+
+		public void setLatestVersion(Long latestVersion) {
+			this.latestVersion = latestVersion;
+		}
+
+		public String getLineSn() {
+			return lineSn;
+		}
+
+		public void setLineSn(String lineSn) {
+			this.lineSn = lineSn;
+		}
+
+		public String getOprno() {
+			return oprno;
+		}
+
+		public void setOprno(String oprno) {
+			this.oprno = oprno;
+		}
+
+		public boolean isHasUpdate() {
+			return hasUpdate;
+		}
+
+		public void setHasUpdate(boolean hasUpdate) {
+			this.hasUpdate = hasUpdate;
+		}
+
+		public String getContent() {
+			return content;
+		}
+
+		public void setContent(String content) {
+			this.content = content;
+		}
+
+		public String getDownloadUrl() {
+			return downloadUrl;
+		}
+
+		public void setDownloadUrl(String downloadUrl) {
+			this.downloadUrl = downloadUrl;
+		}
+
+		public String getFileName() {
+			return fileName;
+		}
+
+		public void setFileName(String fileName) {
+			this.fileName = fileName;
+		}
+	}
+}

+ 8 - 7
src/main/resources/config/application.yml

@@ -163,13 +163,13 @@ jdbc:
   # Mysql 数据库配置
   type: mysql
   driver: com.mysql.cj.jdbc.Driver
-#  url: jdbc:mysql://127.0.0.1:3306/mes_cloud_dy?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_liuan?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_cloude_npd?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-  url: jdbc:mysql://192.168.9.181:3306/mes_cloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
-  username: mes_cloud
-  password: s2ENj7KaEySTC7dW
-#  username: root
-#  password: root
+ # url: jdbc:mysql://192.168.9.181:3306/mes_cloud?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
+#  username: mes_cloud
+ # password: s2ENj7KaEySTC7dW
+  username: root
+  password: 123456
   testSql: SELECT 1
 
   #  # Oracle 数据库配置(若使用 12c,请修改 /modules/core/pom.xml 文件,打开 12c 依赖,去掉 11g 依赖)
@@ -729,6 +729,7 @@ shiro:
   # 提示:填写过滤规则,请注意先后顺序,从上到下,先匹配先受用规则,匹配成功后不再继续匹配。
   filterChainDefinitions: |
     ${adminPath}/mes/mesApp/ver = anon
+    ${adminPath}/mes/mesClientUpgrade/checkUpdate = anon
     ${adminPath}/mes/mesLogin/login = anon
     ${adminPath}/mes/mesQuality/save = anon
     ${adminPath}/sys/emailLogin/sendCode = anon
@@ -1066,7 +1067,7 @@ file:
   enabled: true
 
   #  # 文件上传根路径,设置路径中不允许包含“userfiles”,在指定目录中系统会自动创建userfiles目录,如果不设置默认为contextPath路径
-  baseDir: E:/mescloud
+  baseDir: D:/mescloud
   #  baseDir: /www/wwwroot/mes_cloud_dy
   #
   #  # 上传文件的相对路径(支持:yyyy, MM, dd, HH, mm, ss, E)

+ 28 - 0
src/main/resources/mappings/modules/mes/MesClientUpgradeDao.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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.MesClientUpgradeDao">
+
+    <select id="findLatestVersion" resultType="com.jeesite.modules.mes.entity.MesClientUpgrade">
+        SELECT ${sqlMap.column.toSql()}
+        FROM ${sqlMap.table.toSql()}
+        WHERE a.state = #{state}
+        <choose>
+            <when test="lineSn != null and lineSn != '' and oprno != null and oprno != ''">
+                AND (
+                    (a.line_sn = #{lineSn} AND a.oprno = #{oprno})
+                    OR ((a.line_sn IS NULL OR a.line_sn = '') AND (a.oprno IS NULL OR a.oprno = ''))
+                )
+                ORDER BY
+                    CASE WHEN a.line_sn = #{lineSn} AND a.oprno = #{oprno} THEN 0 ELSE 1 END,
+                    a.version DESC,
+                    a.create_date DESC
+            </when>
+            <otherwise>
+                AND (a.line_sn IS NULL OR a.line_sn = '')
+                AND (a.oprno IS NULL OR a.oprno = '')
+                ORDER BY a.version DESC, a.create_date DESC
+            </otherwise>
+        </choose>
+        LIMIT 1
+    </select>
+</mapper>

+ 111 - 0
src/main/resources/views/modules/mes/mesClientUpgradeForm.html

@@ -0,0 +1,111 @@
+<% layout('/layouts/default.html', {title: '客户端版本上传', libs: ['validate','fileupload']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-cloud-upload"></i> ${text(mesClientUpgrade.isNewRecord ? '新增客户端版本' : '编辑客户端版本')}
+			</div>
+			<div class="box-tools pull-right">
+				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
+			</div>
+		</div>
+		<#form:form id="inputForm" model="${mesClientUpgrade}" action="${ctx}/mes/mesClientUpgrade/save" method="post" class="form-horizontal">
+			<div class="box-body">
+				<div class="form-unit">${text('基本信息')}</div>
+				<#form:hidden path="id"/>
+				<div class="row">
+					<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>
+							<div class="col-sm-8">
+								<#form:input path="version" maxlength="9" class="form-control required digits"/>
+							</div>
+						</div>
+					</div>
+					<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>
+							<div class="col-sm-8">
+								<#form:select path="state" dictType="mes_app_status" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('产线编号')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<#form:input path="lineSn" maxlength="100" class="form-control"/>
+							</div>
+						</div>
+					</div>
+					<div class="col-xs-6">
+						<div class="form-group">
+							<label class="control-label col-sm-4" title="">
+								<span class="required hide">*</span> ${text('工位')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-8">
+								<% if(lineProcessJar && !isEmpty(childLineProcessList)){ %>
+									<#form:select path="oprno" items="${childLineProcessList}" itemLabel="oprno" itemValue="oprno" blankOption="true" class="form-control required"/>
+								<% } else { %>
+									<#form:input path="oprno" maxlength="255" class="form-control"/>
+								<% } %>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2" title="">
+								<span class="required hide">*</span> ${text('更新内容')}:<i class="fa icon-question hide"></i></label>
+							<div class="col-sm-10">
+								<#form:textarea path="content" rows="4" class="form-control"/>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="row">
+					<div class="col-xs-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2">
+								<span class="required hide">*</span> ${text('客户端包')}:</label>
+							<div class="col-sm-10">
+								<#form:fileupload id="uploadFile" bizKey="${mesClientUpgrade.id}" bizType="mesClientUpgrade_file"
+									uploadType="all" class="" allowSuffixes="jar,exe" maxUploadNum="1" readonly="false" preview="true"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesClient:edit')){ %>
+							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保存')}</button>&nbsp;
+						<% } %>
+						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关闭')}</button>
+					</div>
+				</div>
+			</div>
+		</#form:form>
+	</div>
+</div>
+<% } %>
+<script>
+$("#inputForm").validate({
+	submitHandler: function(form){
+		js.ajaxSubmitForm($(form), function(data){
+			js.showMessage(data.message);
+			if(data.result == Global.TRUE){
+				js.closeCurrentTabPage(function(contentWindow){
+					contentWindow.page();
+				});
+			}
+		}, "json");
+    }
+});
+</script>

+ 88 - 0
src/main/resources/views/modules/mes/mesClientUpgradeList.html

@@ -0,0 +1,88 @@
+<% layout('/layouts/default.html', {title: '客户端版本上传', libs: ['dataGrid']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header">
+			<div class="box-title">
+				<i class="fa icon-cloud-upload"></i> ${text('客户端版本上传')}
+			</div>
+			<div class="box-tools pull-right">
+				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
+				<% if(hasPermi('mes:mesClient:edit')){ %>
+					<% if(lineProcessJar){ %>
+						<a href="${ctx}/mes/mesClientUpgrade/form?lineProcessId=${lineProcessId}" class="btn btn-default btnTool" title="${text('新增客户端版本')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+					<% } else { %>
+						<a href="${ctx}/mes/mesClientUpgrade/form" class="btn btn-default btnTool" title="${text('新增客户端版本')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+					<% } %>
+				<% } %>
+				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
+			</div>
+		</div>
+		<div class="box-body">
+			<#form:form id="searchForm" model="${mesClientUpgrade}" action="${ctx}/mes/mesClientUpgrade/listData" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<% if(lineProcessJar){ %>
+					<input type="hidden" name="lineProcessJar" value="1"/>
+					<input type="hidden" name="lineProcessId" value="${lineProcessId}"/>
+				<% } %>
+				<div class="form-group">
+					<label class="control-label">${text('版本号')}:</label>
+					<div class="control-inline">
+						<#form:input path="version" maxlength="9" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('产线编号')}:</label>
+					<div class="control-inline">
+						<#form:input path="lineSn" maxlength="100" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('工位')}:</label>
+					<div class="control-inline">
+						<#form:input path="oprno" maxlength="255" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('状态')}:</label>
+					<div class="control-inline width-120">
+						<#form:select path="state" dictType="mes_app_status" blankOption="true" class="form-control"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
+					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
+				</div>
+			</#form:form>
+			<table id="dataGrid"></table>
+			<div id="dataGridPage"></div>
+		</div>
+	</div>
+</div>
+<% } %>
+<script>
+$('#dataGrid').dataGrid({
+	searchForm: $("#searchForm"),
+	columnModel: [
+		{header:'${text("版本号")}', name:'version', index:'a.version', width:120, align:"left", frozen:true, formatter: function(val, obj, row, act){
+			return '<a href="${ctx}/mes/mesClientUpgrade/form?id='+row.id+'" class="btnList" data-title="${text("编辑客户端版本")}">'+(val||row.id)+'</a>';
+		}},
+		{header:'${text("产线编号")}', name:'lineSn', index:'a.line_sn', width:120, align:"center"},
+		{header:'${text("工位")}', name:'oprno', index:'a.oprno', width:120, align:"center"},
+		{header:'${text("更新内容")}', name:'content', index:'a.content', width:220, align:"left"},
+		{header:'${text("状态")}', name:'state', index:'a.state', width:100, align:"center", formatter: function(val, obj, row, act){
+				return js.getDictLabel(${@DictUtils.getDictListJson('mes_app_status')}, val, '${text("未知")}', true);
+			}},
+		{header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:150, align:"center"},
+		{header:'${text("操作")}', name:'actions', width:100, formatter: function(val, obj, row, act){
+			var actions = [];
+			//<% if(hasPermi('mes:mesClient:edit')){ %>
+				actions.push('<a href="${ctx}/mes/mesClientUpgrade/form?id='+row.id+'" class="btnList" title="${text("编辑客户端版本")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+				actions.push('<a href="${ctx}/mes/mesClientUpgrade/delete?id='+row.id+'" class="btnList" title="${text("删除客户端版本")}" data-confirm="${text("确认要删除该客户端版本吗?")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
+			//<% } %>
+			return actions.join('');
+		}}
+	],
+	ajaxSuccess: function(data){
+	}
+});
+</script>

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

@@ -115,7 +115,7 @@ $('#dataGrid').dataGrid({
 				actions.push('<a href="${ctx}/mes/mesLineProcessConsume/list?lineProcessId='+row.id+'" class="btn btn-warning btn-xs btnList" title="物料">物料</a>&nbsp;');
 				actions.push('<a href="${ctx}/mes/mesLineProcessUser/list?lineProcessId='+row.id+'" class="btn btn-success btn-xs btnList" title="人员">人员</a>&nbsp;');
 				actions.push('<a href="${ctx}/mes/mesLineProcess/sublist?pid='+row.id+'" class="btn btn-primary btn-xs btnList" title="子工位">子工位</a>&nbsp;');
-				actions.push('<a href="${ctx}/mes/mesLineProcess/jarManagement?id='+row.id+'" class="btn btn-xs btnList" title="JAR管理" style="background-color: #605ca8; border-color: #605ca8; color: #fff;">JAR管理</a>&nbsp;');
+				actions.push('<a href="${ctx}/mes/mesClientUpgrade/list?lineProcessJar=1&lineProcessId='+row.id+'" class="btn btn-xs btnList" title="JAR管理" style="background-color: #605ca8; border-color: #605ca8; color: #fff;">JAR管理</a>&nbsp;');
 				return '<div style="overflow-x: auto; white-space: nowrap; width: 100%; text-align: left; padding: 2px 0;">' + actions.join('') + '</div>';
 		}}
 	],
@@ -125,4 +125,4 @@ $('#dataGrid').dataGrid({
 		
 	}
 });
-</script>
+</script>