java扫码自动实现SAPmigo进出库管理
登录界面
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
<title>登录</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body class="login-bg">
<div class="login-contain">
<div class="login-header">
<p>欢迎登录</p>
</div>
<div class="form-group">
<div class="form-item">
<label for="username">
<img src="images/user.png">
</label>
<input id="username" type="text" placeholder="请输入账号">
</div>
<div class="form-item">
<label for="password">
<img src="images/password.png" alt="">
</label>
<input id="password" type="password" placeholder="请输入密码">
</div>
</div>
<div class="button-group">
<button class="login-btn" id="btn">登录</button>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/login.js"></script>
<script src="js/jquery.json-2.4.js"></script>
<script>
$(function(){
$(window).resize();
});
//js设置居中
$(window).resize(function(){
$(".login-contain").css({
position: "absolute",
left: ($(window).width() - $(".login-contain").outerWidth())/2,
top: ($(window).height() - $(".login-contain").outerHeight())/2
});
});
</script>
</body>
</html>
登录界面CSS
body, html, div, a, span, p, h1, h2, h3, h4, h5, ul, li, input, button {
margin: 0;
padding: 0;
}
a, li {
list-style: none;
}
a {
text-decoration: none;
color: black;
}
.login-bg {
background: url("../images/login-bg.jpg") repeat fixed;
color: #0000FF;
background-size: 100% 100%;
}
.login-contain {
width: 85%;
}
.login-header {
padding: 5%;
}
.login-header p {
font-size: 32px;
color: #ffffff;
font-weight: bold;
text-align: center;
letter-spacing: 2px;
text-shadow: 0.1em 0.15em 0.1em #74C3CA
}
.login-logo {
padding: 5%;
}
.login-logo img {
width: 55px;
height: 55px;
border-radius: 50%;
}
.login-logo p {
color: #ffffff;
font-size: 14px;
text-align: center;
letter-spacing: 2px;
margin-top: 2%;
}
.form-group {
padding: 5%;
}
.form-group .form-item {
margin-top: 5%;
padding:0 10px;
border-radius: 20px;
background-color: #B3DFE2;
}
.form-group .form-item input {
outline: none;
border: 0;
background-color: transparent;
color: #ffffff;
height: 40px;
font-size: 18px;
width: 55%;
margin-left: 12%;
}
.form-group .form-item input::-webkit-input-placeholder {
/* WebKit browsers */
color: #ffffff;
font-size: 16px;
}
.form-group .form-item input:-moz-placeholder {
/* Mozilla Firefox 4 to 18 */
color: #ffffff;
font-size: 16px;
}
.form-group .form-item input::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #ffffff;
font-size: 16px;
}
.form-group .form-item input:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #ffffff;
font-size: 16px;
}
.form-group .form-item label img {
width: 25px;
position: absolute;
margin-top: 5px;
}
.form-group .form-item button {
outline: none;
background: transparent;
border: 1px #00cc99 dashed;
color: #ffffff;
height: 30px;
border-radius: 5px;
float: right;
padding: 1%;
}
.button-group {
padding: 5%;
}
.button-group button {
outline: none;
border: 0;
width: 90%;
height: 35px;
margin-top: 4%;
border-radius: 20px;
margin-left: 4%;
color: #ffffff;
font-size: 18px;
}
.button-group .login-btn {
background-color: #ffffff;
color: #74C3CA;
}
.order-login {
padding: 5%;
}
.order-login-line {
display: block;
position: relative;
text-align: center;
font-size: 14px;
color: #ffffff;
}
.order-login-line:before,
.order-login-line:after {
content: '';
position: absolute;
top: 50%;
background: #ffffff;
width: 20%;
height: 1px;
}
.order-login-line:before {
left: 10%;
}
.order-login-line:after {
right: 10%;
}
.order-login-box {
display: flex;
width: 100%;
justify-content:center;
margin-top: 20px;
}
.order-login-box div{
flex: 1;
text-align: center;
}
.order-login-box div p{
text-align: center;
font-size: 14px;
color: #ffffff;
}
sap和java连接
package org.erp.xy.control;
import java.util.Map;
import org.erp.xy.util.SAPJCO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.sap.conn.jco.AbapException;
import com.sap.conn.jco.JCoDestination;
import com.sap.conn.jco.JCoDestinationManager;
import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoParameterList;
@RequestMapping("/wujinku")
@RestController
public class WuJinKuControl {
static String ABAP_AS1 = "ABAP_AS_WITHOUT_POOL1";
@RequestMapping(value="/wujinku",method=RequestMethod.POST,produces="application/json;charset=utf-8")
public Boolean wujinku(@RequestBody Map map) throws JCoException {
Boolean bool =false;
String tx=(String) map.get("tx");
String sl=(String) map.get("sl");
String cb=(String) map.get("cb");
String yd=(String) map.get("yd");
SAPJCO sapjco = new SAPJCO();
sapjco.connectWithoutPool();
JCoDestination destination = JCoDestinationManager
.getDestination(ABAP_AS1);
JCoFunction function = destination.getRepository().getFunction(
"ZTMXT");
if (function == null)
throw new RuntimeException(
"RFC_SYSTEM_INFO not found in SAP.");
try {
JCoParameterList parameterList = function
.getImportParameterList();//传参
parameterList.setValue("ZTXMSZ", tx);
parameterList.setValue("ZCBZX1", cb);
parameterList.setValue("ZSL", sl);
function.execute(destination);
JCoParameterList exportParam = function.getExportParameterList();
String fhxx = exportParam.getString("ZFHXX");
System.out.println(fhxx);
String fhxx1 = exportParam.getString("ZFHXX1");
System.out.println(fhxx1);
String fhxx2 = exportParam.getString("ZFHXX2");
System.out.println(fhxx2);
bool = true;
} catch (AbapException e) {
System.out.println(e.toString());
return bool;
}
System.out.println("函数存在");
return bool;
}
}
要扫码实现代码可加QQ2716916016