Pārlūkot izejas kodu

断刀记录和刀具寿命函数调用

liuwei 3 mēneši atpakaļ
vecāks
revīzija
57a2b0b49c

+ 30 - 0
src/main/java/com/jeesite/modules/mes/web/MesProductCncController.java

@@ -4,6 +4,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.alibaba.druid.util.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -140,5 +141,34 @@ public class MesProductCncController extends BaseController {
 		mesProductCncService.delete(mesProductCnc);
 		return renderResult(Global.TRUE, text("删除CNC断刀记录成功!"));
 	}
+
+	/**
+	 * 客户端保存断刀记录(供 CNC 客户端调用,无需登录)
+	 * 参数:sn, lineSn, oprno, tools, remark(可选), ucode
+	 */
+	@PostMapping(value = "saveBroken")
+	@ResponseBody
+	public String saveBroken(HttpServletRequest request) {
+		String sn = request.getParameter("sn");
+		String lineSn = request.getParameter("lineSn");
+		String oprno = request.getParameter("oprno");
+		String tools = request.getParameter("tools");
+		String remark = request.getParameter("remark");
+		String ucode = request.getParameter("ucode");
+		if (StringUtils.isEmpty(sn) || StringUtils.isEmpty(lineSn)
+				|| StringUtils.isEmpty(oprno) || StringUtils.isEmpty(tools)
+				|| StringUtils.isEmpty(ucode)) {
+			return renderResult(Global.FALSE, text("参数错误!"));
+		}
+		MesProductCnc mesProductCnc = new MesProductCnc();
+		mesProductCnc.setSn(sn);
+		mesProductCnc.setLineSn(lineSn);
+		mesProductCnc.setOprno(oprno);
+		mesProductCnc.setTools(tools);
+		mesProductCnc.setRemark(remark);
+		mesProductCnc.setCreateBy(ucode);
+		mesProductCncService.save(mesProductCnc);
+		return renderResult(Global.TRUE, text("保存CNC断刀记录成功!"));
+	}
 	
 }

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

@@ -703,6 +703,10 @@ shiro:
     ${adminPath}/mes/mesProductRecord/pccheck = anon
     ${adminPath}/mes/mesProductRecord/pccreate = anon
     ${adminPath}/mes/mesProductRecord/pcresult = anon
+    ${adminPath}/mes/mesProductCncLife/saveLife = anon
+    ${adminPath}/mes/mesProductCnc/saveBroken = anon
+    ${adminPath}/mes/mesProductCncParam/batchsave = anon
+    ${adminPath}/mes/mesProductRecord/pcdevice = anon
     ${adminPath}/mes/mesProductRecord/checkProduct = anon
     ${adminPath}/mes/mesProductRecord/editProduct = anon
     
@@ -742,7 +746,8 @@ shiro:
     ${adminPath}/mes/mesMaterialLl/codeList= anon
     ${adminPath}/mes/mesMaterialLl/codeInfo= anon
     ${adminPath}/mes/mesMaterialTl/mesMaterialTl= anon
-    
+    ${adminPath}/mes/mesProductCnc/importData= anon
+    ${adminPath}/mes/mesProductCncLife/saveLife= anon