Przeglądaj źródła

服务器新增不良记录

dzc 3 dni temu
rodzic
commit
c34646973d

+ 15 - 0
src/main/java/com/jeesite/modules/mes/dao/MesGp12ItemsDao.java

@@ -0,0 +1,15 @@
+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.MesGp12Items;
+
+/**
+ * GP12工位问题项DAO接口
+ * @author mes
+ * @version 2026-08-04
+ */
+@MyBatisDao
+public interface MesGp12ItemsDao extends CrudDao<MesGp12Items> {
+
+}

+ 56 - 0
src/main/java/com/jeesite/modules/mes/entity/MesGp12Items.java

@@ -0,0 +1,56 @@
+package com.jeesite.modules.mes.entity;
+
+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;
+
+import javax.validation.constraints.Size;
+
+/**
+ * GP12工位问题项(不良原因)Entity
+ * @author mes
+ * @version 2026-08-04
+ */
+@Table(name="mes_gp12_items", alias="a", label="GP12工位问题项信息", columns={
+		@Column(name="id", attrName="id", label="id", isPK=true),
+		@Column(name="res_oprno", attrName="resOprno", label="责任工位", queryType=QueryType.LIKE),
+		@Column(name="description", attrName="description", label="问题描述", queryType=QueryType.LIKE),
+		@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="更新人", isQuery=false),
+		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false, isUpdateForce=true),
+	}, orderBy="a.update_date DESC"
+)
+public class MesGp12Items extends DataEntity<MesGp12Items> {
+
+	private static final long serialVersionUID = 1L;
+	private String resOprno;
+	private String description;
+
+	public MesGp12Items() {
+		this(null);
+	}
+
+	public MesGp12Items(String id) {
+		super(id);
+	}
+
+	@Size(min=0, max=20, message="责任工位长度不能超过 20 个字符")
+	public String getResOprno() {
+		return resOprno;
+	}
+
+	public void setResOprno(String resOprno) {
+		this.resOprno = resOprno;
+	}
+
+	@Size(min=0, max=255, message="问题描述长度不能超过 255 个字符")
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+}

+ 46 - 0
src/main/java/com/jeesite/modules/mes/service/MesGp12ItemsService.java

@@ -0,0 +1,46 @@
+package com.jeesite.modules.mes.service;
+
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.service.CrudService;
+import com.jeesite.modules.mes.dao.MesGp12ItemsDao;
+import com.jeesite.modules.mes.entity.MesGp12Items;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * GP12工位问题项Service
+ * @author mes
+ * @version 2026-08-04
+ */
+@Service
+public class MesGp12ItemsService extends CrudService<MesGp12ItemsDao, MesGp12Items> {
+
+	@Override
+	public MesGp12Items get(MesGp12Items mesGp12Items) {
+		return super.get(mesGp12Items);
+	}
+
+	@Override
+	public Page<MesGp12Items> findPage(MesGp12Items mesGp12Items) {
+		return super.findPage(mesGp12Items);
+	}
+
+	@Override
+	public List<MesGp12Items> findList(MesGp12Items mesGp12Items) {
+		return super.findList(mesGp12Items);
+	}
+
+	@Override
+	@Transactional
+	public void save(MesGp12Items mesGp12Items) {
+		super.save(mesGp12Items);
+	}
+
+	@Override
+	@Transactional
+	public void delete(MesGp12Items mesGp12Items) {
+		super.delete(mesGp12Items);
+	}
+}

+ 91 - 0
src/main/java/com/jeesite/modules/mes/web/MesGp12ItemsController.java

@@ -0,0 +1,91 @@
+package com.jeesite.modules.mes.web;
+
+import com.jeesite.common.config.Global;
+import com.jeesite.common.entity.Page;
+import com.jeesite.common.web.BaseController;
+import com.jeesite.modules.mes.entity.MesGp12Items;
+import com.jeesite.modules.mes.resp.CommonResp;
+import com.jeesite.modules.mes.service.MesGp12ItemsService;
+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.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * GP12工位问题项(不良原因)Controller
+ * @author mes
+ * @version 2026-08-04
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/mes/mesGp12Items")
+public class MesGp12ItemsController extends BaseController {
+
+	@Autowired
+	private MesGp12ItemsService mesGp12ItemsService;
+
+	@ModelAttribute
+	public MesGp12Items get(String id, boolean isNewRecord) {
+		return mesGp12ItemsService.get(id, isNewRecord);
+	}
+
+	@RequiresPermissions("mes:mesGp12Items:view")
+	@RequestMapping(value = {"list", ""})
+	public String list(MesGp12Items mesGp12Items, Model model) {
+		model.addAttribute("mesGp12Items", mesGp12Items);
+		return "modules/mes/mesGp12ItemsList";
+	}
+
+	@RequiresPermissions("mes:mesGp12Items:view")
+	@RequestMapping(value = "listData")
+	@ResponseBody
+	public Page<MesGp12Items> listData(MesGp12Items mesGp12Items, HttpServletRequest request, HttpServletResponse response) {
+		mesGp12Items.setPage(new Page<>(request, response));
+		return mesGp12ItemsService.findPage(mesGp12Items);
+	}
+
+	@RequiresPermissions("mes:mesGp12Items:view")
+	@RequestMapping(value = "form")
+	public String form(MesGp12Items mesGp12Items, Model model) {
+		model.addAttribute("mesGp12Items", mesGp12Items);
+		return "modules/mes/mesGp12ItemsForm";
+	}
+
+	@RequiresPermissions("mes:mesGp12Items:edit")
+	@PostMapping(value = "save")
+	@ResponseBody
+	public String save(@Validated MesGp12Items mesGp12Items) {
+		mesGp12ItemsService.save(mesGp12Items);
+		return renderResult(Global.TRUE, text("保存不良原因成功!"));
+	}
+
+	@RequiresPermissions("mes:mesGp12Items:edit")
+	@RequestMapping(value = "delete")
+	@ResponseBody
+	public String delete(MesGp12Items mesGp12Items) {
+		mesGp12ItemsService.delete(mesGp12Items);
+		return renderResult(Global.TRUE, text("删除不良原因成功!"));
+	}
+
+	/**
+	 * 客户端:查询不良原因列表(anon)
+	 */
+	@PostMapping(value = "items")
+	@ResponseBody
+	public CommonResp items() {
+		CommonResp<List<MesGp12Items>> resp = new CommonResp<>();
+		List<MesGp12Items> list = mesGp12ItemsService.findList(new MesGp12Items());
+		resp.setResult(Global.TRUE);
+		resp.setMessage("查询成功");
+		resp.setData(list);
+		return resp;
+	}
+}

+ 66 - 0
src/main/resources/views/modules/mes/mesGp12ItemsForm.html

@@ -0,0 +1,66 @@
+<% layout('/layouts/default.html', {title: '不良原因配置', libs: ['validate']}){ %>
+<div class="main-content">
+	<div class="box box-main">
+		<div class="box-header with-border">
+			<div class="box-title">
+				<i class="fa icon-note"></i> ${text(mesGp12Items.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="${mesGp12Items}" action="${ctx}/mes/mesGp12Items/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-12">
+						<div class="form-group">
+							<label class="control-label col-sm-2">
+								${text('责任工位')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="resOprno" maxlength="20" 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">*</span> ${text('问题描述')}:</label>
+							<div class="col-sm-8">
+								<#form:input path="description" maxlength="255" class="form-control required"/>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<div class="box-footer">
+				<div class="row">
+					<div class="col-sm-offset-2 col-sm-10">
+						<% if (hasPermi('mes:mesGp12Items: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>

+ 59 - 0
src/main/resources/views/modules/mes/mesGp12ItemsList.html

@@ -0,0 +1,59 @@
+<% 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-notebook"></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:mesGp12Items:edit')){ %>
+					<a href="${ctx}/mes/mesGp12Items/form" class="btn btn-default btnTool" title="${text('新增不良原因')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
+				<% } %>
+			</div>
+		</div>
+		<div class="box-body">
+			<#form:form id="searchForm" model="${mesGp12Items}" action="${ctx}/mes/mesGp12Items/listData" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<div class="form-group">
+					<label class="control-label">${text('责任工位')}:</label>
+					<div class="control-inline">
+						<#form:input path="resOprno" maxlength="20" class="form-control width-120"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('问题描述')}:</label>
+					<div class="control-inline">
+						<#form:input path="description" maxlength="255" class="form-control width-260"/>
+					</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:'resOprno', index:'a.res_oprno', width:150, align:"center"},
+		{header:'${text("问题描述")}', name:'description', index:'a.description', width:400, align:"center"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:160, align:"center"},
+		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
+			var actions = [];
+			<% if(hasPermi('mes:mesGp12Items:edit')){ %>
+				actions.push('<a href="${ctx}/mes/mesGp12Items/form?id='+row.id+'" class="btnList" title="${text("编辑")}"><i class="fa fa-pencil"></i></a>&nbsp;');
+				actions.push('<a href="${ctx}/mes/mesGp12Items/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>

+ 58 - 0
src/main/resources/views/modules/mes/mesProductGp12ListUser.html

@@ -0,0 +1,58 @@
+<% 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-notebook"></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>
+				<a href="#" class="btn btn-default" id="btnRefresh" title="${text('刷新')}" onclick="page()"><i class="fa fa-refresh"></i> ${text('刷新')}</a>
+			</div>
+		</div>
+		<div class="box-body">
+			<#form:form id="searchForm" model="${mesProductGp12}" action="${ctx}/mes/mesProductGp12/listData" method="post" class="form-inline hide"
+					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
+				<#form:hidden path="lineSn"/>
+				<#form:hidden path="oprno"/>
+				<div class="form-group">
+					<label class="control-label">${text('工件码')}:</label>
+					<div class="control-inline">
+						<#form:input path="sn" maxlength="50" class="form-control width-260"/>
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="control-label">${text('创建时间')}:</label>
+					<div class="control-inline">
+						<#form:input path="createDate_gte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
+							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm" data-done="createDate_lte.click()"/>
+						&nbsp;-&nbsp;
+						<#form:input path="createDate_lte" readonly="true" maxlength="20" class="form-control laydate width-datetime"
+							dataFormat="datetime" data-type="datetime" data-format="yyyy-MM-dd HH:mm"/>
+					</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:'sn', index:'a.sn', width:280, align:"center", frozen:true},
+		{header:'${text("工位号")}', name:'oprno', index:'a.oprno', width:120, align:"center"},
+		{header:'${text("产线")}', name:'lineSn', index:'a.line_sn', width:80, align:"center"},
+		{header:'${text("不良原因")}', name:'remark', index:'a.remark', width:300, align:"left"},
+		{header:'${text("创建人")}', name:'createBy', index:'a.create_by', width:120, align:"center"},
+		{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:160, align:"center"}
+	],
+	ajaxSuccess: function(data){}
+});
+</script>