inspiry设备管理

master
taylor.dang 6 years ago
parent 68ce23af11
commit 3db0c13c7d

@ -2117,7 +2117,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (deviceInfo.getIntValue("client_id") != client.getIntValue("client_id")) { if (deviceInfo.getIntValue("client_id") != client.getIntValue("client_id")) {
throw new NotFoundException("设备不存在"); throw new NotFoundException("设备不存在");
} }
if (StringUtils.equals(InspiryPOSFinder.INSPIRY_DEVICE_TYPE, deviceInfo.getString("dev_type"))) { if (StringUtils.equals(InspiryPOSFinder.INSPIRY_DEVICE_TYPE, deviceInfo.getString("client_type")) && enable) {
JSONObject inspiryDevice = clientDeviceMapper.findDeviceInfoByDeviceNo(deviceInfo.getString("client_dev_id"), InspiryPOSFinder.INSPIRY_DEVICE_TYPE); JSONObject inspiryDevice = clientDeviceMapper.findDeviceInfoByDeviceNo(deviceInfo.getString("client_dev_id"), InspiryPOSFinder.INSPIRY_DEVICE_TYPE);
if (inspiryDevice != null) { if (inspiryDevice != null) {
throw new ServerErrorException("当前设备已被使用"); throw new ServerErrorException("当前设备已被使用");

@ -2989,9 +2989,6 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}]); }]);
app.controller('newDeviceDialogCtrl', ['$scope', '$http', 'clientMoniker', function ($scope, $http,clientMoniker) { app.controller('newDeviceDialogCtrl', ['$scope', '$http', 'clientMoniker', function ($scope, $http,clientMoniker) {
$scope.params = {};
$scope.manager = {};
$scope.save = function (form) { $scope.save = function (form) {
$scope.errmsg = null; $scope.errmsg = null;
if (form.$invalid) { if (form.$invalid) {
@ -3002,6 +2999,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
return; return;
} }
alert($scope.device);
$http.post('/sys/partners/' + clientMoniker + '/add_device', $scope.device).then(function () { $http.post('/sys/partners/' + clientMoniker + '/add_device', $scope.device).then(function () {
$scope.$close(); $scope.$close();
}, function (resp) { }, function (resp) {

@ -2,49 +2,52 @@
<h4>New Manager Device</h4> <h4>New Manager Device</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="row">
<form novalidate name="deviceForm"> <form novalidate name="deviceForm">
<div class="form-group" <div class="form-group"
ng-class="{'has-error':deviceForm.client_dev_id.$invalid && deviceForm.client_dev_id.$dirty}"> ng-class="{'has-error':deviceForm.client_dev_id.$invalid && deviceForm.client_dev_id.$dirty}">
<label class="control-label" for="client_dev_id-input">* 设备编号</label> <label class="control-label" for="client_dev_id-input">* Device No</label>
<input required class="form-control text-lowercase" id="client_dev_id-input" name="client_dev_id" <input required class="form-control text-lowercase" id="client_dev_id-input" name="client_dev_id"
ng-model="device.client_dev_id" maxlength="50"> ng-model="device.client_dev_id" maxlength="25">
<div ng-messages="deviceForm.client_dev_id.$error" ng-if="deviceForm.client_dev_id.$dirty"> <div ng-messages="deviceForm.client_dev_id.$error" ng-if="deviceForm.client_dev_id.$dirty">
<p class="small text-danger" ng-message="required">client_dev_id field is required</p> <p class="small text-danger" ng-message="required">Device No Cannot Be Empty</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':deviceForm.auth_code.$invalid && deviceForm.auth_code.$dirty}"> ng-class="{'has-error':deviceForm.auth_code.$invalid && deviceForm.auth_code.$dirty}">
<label class="control-label" for="auth_code-input">* 设备密钥</label> <label class="control-label" for="auth_code-input">* Device Key</label>
<input required class="form-control" id="auth_code-input" name="auth_code" <input required class="form-control" id="auth_code-input" name="auth_code"
ng-model="device.auth_code" maxlength="50"> ng-model="device.auth_code" maxlength="50">
<div ng-messages="deviceForm.auth_code.$error" ng-if="deviceForm.auth_code.$dirty"> <div ng-messages="deviceForm.auth_code.$error" ng-if="deviceForm.auth_code.$dirty">
<p class="small text-danger" ng-message="required">设备密钥 field is required</p> <p class="small text-danger" ng-message="required">Device Key Cannot Be Empty</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label" for="client_type-input">设备类型</label> <label class="control-label" for="client_type-input">Device Type</label>
<input class="form-control" id="client_type-input" name="client_type" <input class="form-control" id="client_type-input" name="client_type"
ng-model="device.client_type" ng-init="inspiry" readonly> ng-init="device.client_type='inspiry'" placeholder="inspiry"
ng-model="device.client_type" readonly>
</div> </div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error':deviceForm.version.$invalid && deviceForm.version.$dirty}"> ng-class="{'has-error':deviceForm.version.$invalid && deviceForm.version.$dirty}">
<label class="control-label" for="version-input">* version</label> <label class="control-label" for="version-input">* version</label>
<input required class="form-control" id="version-input" name="version" <input required class="form-control" id="version-input" name="version"
ng-model="device.version"> ng-model="device.version" maxlength="10">
<div ng-messages="deviceForm.version.$error" ng-if="deviceForm.version.$dirty"> <div ng-messages="deviceForm.version.$error" ng-if="deviceForm.version.$dirty">
<p class="small text-danger" ng-message="required">version field is required</p> <p class="small text-danger" ng-message="required">Version No Cannot Be Empty</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group"
<label class="control-label" for="remark-input">Remark</label> ng-class="{'has-error':deviceForm.remark.$invalid && deviceForm.remark.$dirty}">
<input class="form-control" id="remark-input" name="version" <label class="control-label" for="remark-input">* Remark</label>
ng-model="device.remark"> <input required class="form-control" id="remark-input" name="remark"
ng-model="device.remark" maxlength="50">
<div ng-messages="deviceForm.remark.$error" ng-if="deviceForm.remark.$dirty">
<p class="small text-danger" ng-message="required">Remark Cannot Be Empty</p>
</div> </div>
</form>
</div> </div>
</div> <div class="alert alert-danger" ng-if="errmsg" ng-bind="errmsg"></div>
</form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="btn-group"> <div class="btn-group">

Loading…
Cancel
Save