Commit d538ee0d authored by suichenguang's avatar suichenguang

Merge remote-tracking branch 'origin/dev' into dev

parents 0e45c02e 5c67c788
......@@ -30,9 +30,9 @@ public class ExportXMLApi {
private PreproPersonService preproPersonService;
/**
* 导出邮寄制证数据包
* 导出制证数据包
*/
@RequestMapping("printPostXmlData")
@RequestMapping("printXmlData")
// @RequiresPermissions("userInfo.add")//权限管理;
public byte[] printXmlData(@RequestParam("uploadNo") String uploadNo, @RequestParam("IDCard")String IDCard,@RequestParam("oldFile") String oldFile, @RequestParam("newFile")String newFile, @RequestParam("SSXQDM")String SSXQDM, @RequestParam("cardType")String cardType, @RequestParam("state")String state, @RequestParam("uploadDate")String uploadDate, HttpServletResponse response){
response.setContentType("application/x-download");
......
package com.yxproject.start.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/**
* @auther zhangyusheng
* 2019/3/1 15:01
*/
@Mapper
public interface QuerySequenceMapper {
@Select("select #{sequenceName} from dual")
public String selectSequenceNextValue(String sequenceName);
}
package com.yxproject.start.utils;
import com.yxproject.start.mapper.QuerySequenceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @auther zhangyusheng
* 2019/3/1 14:54
*/
@Service
public class QuerySequenceSercive {
@Autowired
private QuerySequenceMapper querySequenceMapper;
public String selectSequenceNextValue(String sequenceName){
String s = querySequenceMapper.selectSequenceNextValue(sequenceName + ".nextval()");
return s;
}
}
......@@ -13,9 +13,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面任何其他内容都*必须*跟随其后 -->
<title>北京制证辅助平台</title>
<script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<!--angularJs -->
<script src="components/angularjs/angular.js"></script>
<script src="components/angularjs/angular-local-storage.js"></script>
......@@ -76,7 +73,7 @@
<OBJECT classid="clsid:18EE8930-6993-4ADA-B8BB-02BA5820AC94" id="aaa" width="0px" height="0px" style="float: left;" CODEBASE="plugin/Termb.cab#version=1,0,0,1" VIEWASTEXT></OBJECT>
<body class="hold-transition skin-blue-light sidebar-mini">
<div class="wrapper">
<div ng-if="loginData.login == true" class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="index.html" class="logo" style="line-height: 50px;">
......@@ -219,6 +216,12 @@
<span>添加余证</span>
</a>
</li>
<li>
<a ng-click="logout()">
<i class="glyphicon glyphicon-user"></i>
<span>退出当前用户</span>
</a>
</li>
</ul>
</section>
<!-- /.sidebar -->
......@@ -231,6 +234,9 @@
<strong>北京盈信信息科技版权所有</strong>
</footer>
</div>
<div ng-if="loginData.login == false" class="wrapper" style="background-color: #EEEEEE;">
<div style="min-height: 500px;" ng-view></div>
</div>
<!-- iCheck -->
<script src="js/app.js"></script>
......@@ -250,5 +256,6 @@
<script src="views/createTaskList/createTaskList.js"></script>
<script src="views/dispatchTask/dispatchTask.js"></script>
<script src="views/addRest/addRest.js"></script>
<script src="views/login/login.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -18,6 +18,7 @@ angular.module('AvatarCheck', [
'AvatarCheck.task',
'AvatarCheck.createTaskList',
'AvatarCheck.dispatchTask',
'AvatarCheck.login',
'tm.pagination'
]).config(['$locationProvider', '$routeProvider', 'localStorageServiceProvider', '$qProvider', function ($locationProvider, $routeProvider, localStorageServiceProvider, $qProvider) {
$locationProvider.hashPrefix('!');
......@@ -30,12 +31,15 @@ angular.module('AvatarCheck', [
DebugService.debug("appCtrl:" + "AvatarCheck initial.")
$rootScope.loginData = localStorageService.get('loginData')
if ($rootScope.loginData == null) {
$rootScope.loginData = {userId: '用户未登录', login: false};
} else {
DebugService.debug("appCtrl:" + "Got user loginData from local storage:", $rootScope.loginData)
if($rootScope.loginData == null){
$rootScope.loginData = {userid:'用户未登录', login:false};
}
if($rootScope.loginData.login == false){
$location.path("/login");
}
$rootScope.tab = '/xmlAndSearch';
if ($location.path() == "/excelAndSearch") {
......@@ -113,5 +117,16 @@ angular.module('AvatarCheck', [
$location.path("/searchCard");
}
$scope.logout = function(){
HttpService.logout(function(data) {
localStorage.clear();
$location.path('/login')
$rootScope.loginData = {userid:'用户未登录', login:false};
});
}
});
......@@ -142,19 +142,25 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
uploadPackage:function(fd,func){
uploadPackage:function(fd,success){
$http({
method: 'POST',
url: "../importXML/getXMLToCheck",
data: fd,
headers: {'Content-Type': 'application/xml'},
headers: {'Content-Type': undefined},
transformRequest: angular.identity
}).then(function successCallback(resp) {
return func(resp.data)
}, function errorCallback(error) {
var err = {data: error, success: false, dur: 0}
return func(err)
}).then(function successCallback(response) {
success(response.data)
})
},
logout:function(success){
$http({
method: 'GET',
url: "../user/logout"+urlTimeStamp()
}).then(function successCallback(response) {
success(response.data)
})
}
}
});
\ No newline at end of file
<div class="login-box">
<div class="login-logo">
<h3>北京制证辅助平台</h3>
</div>
<!-- /.login-logo -->
<div class="login-box-body" style="border-radius: 4px;">
<p class="login-box-msg">用户登录</p>
<form>
<div class="form-group has-feedback">
<input type="text" class="form-control" ng-model="user.username" placeholder="用户名" required>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" ng-model="user.password" placeholder="密码" ng-keyup="enterEvent($event)" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<!-- /.col -->
<div class="col-xs-4 col-lg-offset-4">
<button type="submit" class="btn btn-primary btn-block btn-flat" ng-disabled='form.$invalid' ng-click="doLogin()">登录</button>
</div>
<!-- /.col -->
</div>
</form>
</div>
<!-- /.login-box-body -->
</div>
\ No newline at end of file
'use strict';
angular.module('AvatarCheck.login', ['ngRoute', 'AvatarCheck.http'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/login', {
templateUrl: 'views/login/login.html' + urlTimeStamp(),
controller: 'loginCtrl',
cache: false
});
}])
.controller('loginCtrl', function ($scope, $rootScope, $timeout, HttpService, ngDialog, MessageService, $filter,$location,$http,localStorageService) {
$scope.enterEvent = function(e) {
var keycode = window.event?e.keyCode:e.which;
if(keycode==13){
$scope.doLogin();
}
}
$scope.user = {};
$scope.doLogin = function(){
var json = JSON.stringify($scope.user);
$scope.authError = null;
// Try to login
$http({method: 'post', url: "../user/login", data: json}).then(function (resp) {
console.log(resp)
if(resp.data.status==200){
location.reload([true]);
$rootScope.loginData = resp.data.user;
$rootScope.loginData.login =true;
localStorageService.set('loginData', resp.data.user);
if($rootScope.loginData.username=='admin'){
$location.path('/xmlAndSearch')
}else{
$location.path('/excelAndSearch')
}
}else{
$scope.authError = resp.data.message;
}
})
}
});
\ No newline at end of file
......@@ -40,7 +40,7 @@
<tr>
<td width="10%">选择xml文件</td>
<td colspan="2" width="35%">
<input type="file" id="id_file_photo_for_check" class="file" data-show-preview="true" multiple/>
<input type="file" id="id_file_photo_for_check" class="file" data-show-preview="false" multiple="multiple"/>
</td>
<td style="text-align: left;"><button class="btn btn-primary" ng-click="uploadFile()">上传</button></td>
</tr>
......
......@@ -50,12 +50,16 @@ angular.module('AvatarCheck.xmlAndSearch', ['ngRoute', 'AvatarCheck.http', 'tm.p
$scope.uploadFile = function () {
var fd = new FormData();
var files = document.querySelector('input#id_file_photo_for_check').files[0];
var files = document.querySelector('input#id_file_photo_for_check').files;
for(var i in files){
fd.append('file', files[i]);
}
if(angular.isUndefined(files)){
MessageService.showAlert("请选择上传的文件...")
}else{
fd.append('file', files);
HttpService.uploadPackage(fd.get("file"),function (data) {
HttpService.uploadPackage(fd,function (data) {
console.log("导入项目的返回结果:",data)
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment