|
@@ -4,6 +4,7 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.druid.util.StringUtils;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -140,5 +141,34 @@ public class MesProductCncController extends BaseController {
|
|
|
mesProductCncService.delete(mesProductCnc);
|
|
mesProductCncService.delete(mesProductCnc);
|
|
|
return renderResult(Global.TRUE, text("删除CNC断刀记录成功!"));
|
|
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断刀记录成功!"));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|