Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
srm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
aship
srm
Commits
0ab0d6ca
Commit
0ab0d6ca
authored
Aug 15, 2019
by
顾俭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aship/aship#3 防伪码功能-作废重打:UI
parent
ab33641d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
249 additions
and
6 deletions
+249
-6
combinedJs.gradle
combinedJs.gradle
+3
-1
BarcodeController.java
.../java/com/i1/srm/purchaseOrder/web/BarcodeController.java
+29
-5
app.js
src/main/resources/static/app/app.js
+1
-0
barcode.html
src/main/resources/static/app/srm/barcode/barcode.html
+13
-0
barcode.js
src/main/resources/static/app/srm/barcode/barcode.js
+42
-0
query.html
src/main/resources/static/app/srm/barcode/query/query.html
+67
-0
query.js
src/main/resources/static/app/srm/barcode/query/query.js
+91
-0
index.html
src/main/resources/templates/index.html
+3
-0
No files found.
combinedJs.gradle
View file @
0ab0d6ca
...
@@ -184,7 +184,9 @@ combineJs {
...
@@ -184,7 +184,9 @@ combineJs {
'src/main/resources/static/app/srm/invoice/view/view.js'
,
'src/main/resources/static/app/srm/invoice/view/view.js'
,
'src/main/resources/static/app/srm/session/session.js'
,
'src/main/resources/static/app/srm/session/session.js'
,
'src/main/resources/static/app/srm/session/query/query.js'
'src/main/resources/static/app/srm/session/query/query.js'
,
'src/main/resources/static/app/srm/barcode/barcode.js'
,
'src/main/resources/static/app/srm/barcode/query/query.js'
)
)
dest
=
file
(
"src/main/resources/static/all.js"
)
dest
=
file
(
"src/main/resources/static/all.js"
)
...
...
src/main/java/com/i1/srm/purchaseOrder/web/BarcodeController.java
View file @
0ab0d6ca
...
@@ -2,22 +2,32 @@ package com.i1.srm.purchaseOrder.web;
...
@@ -2,22 +2,32 @@ package com.i1.srm.purchaseOrder.web;
import
com.i1.base.exception.IOneWebRestfulException
;
import
com.i1.base.exception.IOneWebRestfulException
;
import
com.i1.erp.barcode.soap.BarcodeGetStatusClient
;
import
com.i1.erp.barcode.soap.BarcodeGetStatusClient
;
import
com.i1.erp.barcode.soap.BarcodePrintClient
;
import
com.i1.erp.barcode.soap.BarcodeVoidClient
;
import
com.i1.erp.barcode.soap.BarcodeVoidClient
;
import
com.i1.erp.base.web.dto.SyncResponse
;
import
com.i1.erp.base.web.dto.SyncResponse
;
import
com.i1.erp.base.web.dto.SyncResponseWithList
;
import
com.i1.srm.am.entity.Function
;
import
com.i1.srm.am.entity.Function
;
import
com.i1.srm.am.entity.Resource
;
import
com.i1.srm.am.entity.Resource
;
import
com.i1.srm.am.service.ResourcePermission
;
import
com.i1.srm.am.service.ResourcePermission
;
import
com.i1.srm.am.service.SecuredPage
;
import
com.i1.srm.am.service.SecuredPage
;
import
com.i1.srm.purchaseOrder.web.dto.PoBarcodePrintDto
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
com
.
i1
.
erp
.
barcode
.
soap
.
BarcodePrintClient
.
TYPE_REPRINT
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
SUCCESS_CODE
;
/**
/**
* 申请防伪码在/purchaseOrders/genBarcode
* 申请防伪码在/purchaseOrders/genBarcode
* 获取防伪码打印url在/purchaseOrderDetails/{id}/printBarcode
* 按项次首次获取防伪码打印url在/purchaseOrderDetails/{id}/printBarcode
*
*/
*/
@RestController
@RestController
@RequestMapping
(
"/barcode"
)
@RequestMapping
(
"/barcode"
)
...
@@ -30,11 +40,13 @@ public class BarcodeController {
...
@@ -30,11 +40,13 @@ public class BarcodeController {
@Autowired
@Autowired
private
BarcodeVoidClient
barcodeVoidClient
;
private
BarcodeVoidClient
barcodeVoidClient
;
@Autowired
private
BarcodePrintClient
barCodePrintClient
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeController
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeController
.
class
);
@RequestMapping
(
value
=
"/status"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/status"
,
method
=
RequestMethod
.
GET
)
@ResourcePermission
(
values
=
{
Resource
.
GET_BARCODE_STATUS
})
@ResourcePermission
(
values
=
{
Resource
.
GET_BARCODE_STATUS
})
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
SyncResponse
getBarCodeStatus
(
@RequestParam
String
factoryUid
,
@RequestParam
String
barcode
)
throws
IOneWebRestfulException
{
public
SyncResponse
getBarCodeStatus
(
@RequestParam
String
factoryUid
,
@RequestParam
String
barcode
)
throws
IOneWebRestfulException
{
return
barcodeGetStatusClient
.
getBarcodeStatus
(
factoryUid
,
barcode
);
return
barcodeGetStatusClient
.
getBarcodeStatus
(
factoryUid
,
barcode
);
}
}
...
@@ -46,4 +58,16 @@ public class BarcodeController {
...
@@ -46,4 +58,16 @@ public class BarcodeController {
return
barcodeVoidClient
.
voidBarcode
(
factoryUid
,
barcode
);
return
barcodeVoidClient
.
voidBarcode
(
factoryUid
,
barcode
);
}
}
@RequestMapping
(
value
=
"/print"
,
method
=
RequestMethod
.
GET
)
@ResourcePermission
(
values
=
{
Resource
.
PRINT_BARCODE
})
public
PoBarcodePrintDto
printBarCodeStatus
(
@RequestParam
String
factoryUid
,
@RequestParam
String
barcode
)
throws
IOneWebRestfulException
{
List
<
String
>
urls
=
new
ArrayList
<>();
SyncResponseWithList
responseWithList
=
barCodePrintClient
.
getBarcodePrintUrls
(
factoryUid
,
""
,
""
,
barcode
,
TYPE_REPRINT
);
if
(
SUCCESS_CODE
.
equals
(
responseWithList
.
getCode
()))
{
urls
.
addAll
(
responseWithList
.
getContent
());
}
return
new
PoBarcodePrintDto
(
responseWithList
.
getCode
(),
responseWithList
.
getMessage
(),
urls
);
}
}
}
src/main/resources/static/app/app.js
View file @
0ab0d6ca
...
@@ -60,6 +60,7 @@
...
@@ -60,6 +60,7 @@
// icon: 'fa fa-book',
// icon: 'fa fa-book',
// acl: 'PURCHASE_ORDER_CHANGE_FUNCTION'
// acl: 'PURCHASE_ORDER_CHANGE_FUNCTION'
// }
// }
{
name
:
'防伪码管理'
,
url
:
'/#!/barcode'
,
icon
:
'fa fa-book'
,
acl
:
'BARCODE_FUNCTION'
}
]
]
},
},
//2
//2
...
...
src/main/resources/static/app/srm/barcode/barcode.html
0 → 100644
View file @
0ab0d6ca
<!-- Content Header (Page header) -->
<section
class=
"content-header"
>
<h1>
防伪码管理
<small>
{{vm.subPages[vm.currentPage].name}}
</small>
</h1>
</section>
<!-- Main content -->
<section
class=
"content"
>
<div
multiple-tabs
sub-pages=
"vm.subPages"
current-page=
"vm.currentPage"
vm=
"vm"
>
</div>
</section>
<!-- /.content -->
\ No newline at end of file
src/main/resources/static/app/srm/barcode/barcode.js
0 → 100644
View file @
0ab0d6ca
(
function
()
{
angular
.
module
(
'IOne'
).
config
([
'$routeProvider'
,
function
(
$routeProvider
)
{
$routeProvider
.
when
(
'/barcode'
,
{
controller
:
'BarcodeController'
,
templateUrl
:
'app/srm/barcode/barcode.html'
,
controllerAs
:
'vm'
,
resolve
:
{
currentAcl
:
function
(
AuthService
)
{
return
AuthService
.
getCurrentAcl
();
}
}
});
}]);
angular
.
module
(
'IOne'
).
factory
(
'BarcodeService'
,
function
(
$http
)
{
return
angular
.
extend
(
new
BaseService
(
'/barcode'
,
$http
),
{
voidBarcode
:
function
(
factoryUid
,
barcode
)
{
return
this
.
httpService
.
delete
(
'/barcode/void?factoryUid='
+
factoryUid
+
'&barcode='
+
barcode
);
},
getBarcodeStatus
:
function
(
factoryUid
,
barcode
)
{
return
this
.
httpService
.
get
(
'/barcode/status?factoryUid='
+
factoryUid
+
'&barcode='
+
barcode
);
},
printBarcode
:
function
(
factoryUid
,
barcode
)
{
return
this
.
httpService
.
get
(
'/barcode/print?factoryUid='
+
factoryUid
+
'&barcode='
+
barcode
);
}
});
});
angular
.
module
(
'IOne'
).
controller
(
'BarcodeController'
,
BarcodeController
);
BarcodeController
.
$inject
=
[
'$rootScope'
,
'currentAcl'
];
function
BarcodeController
(
$rootScope
,
currentAcl
)
{
var
vm
=
this
;
vm
.
currentAcl
=
currentAcl
.
data
;
//variables
vm
.
subPages
=
{
'index'
:
{
name
:
'防伪码作废/重打'
,
show
:
true
,
closable
:
false
,
url
:
'app/srm/barcode/query/query.html'
},
};
}
})();
\ No newline at end of file
src/main/resources/static/app/srm/barcode/query/query.html
0 → 100644
View file @
0ab0d6ca
<div
ng-controller=
"BarcodeQueryController"
>
<form
name=
"barcodeForm"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"form-group"
>
<label>
营运中心
</label>
<select
class=
"form-control select2"
ng-model=
"queryCondition.factory.id"
required
style=
"width: 100%;"
>
<option
ng-repeat=
"factory in factories"
value=
"{{factory.id}}"
>
{{factory.name}}
</option>
</select>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"form-group"
>
<label>
防伪码
</label>
<input
class=
"form-control"
ng-change=
"barcodeChange()"
ng-model=
"queryCondition.barcode"
required
type=
"text"
>
</div>
</div>
<div
class=
"col-md-2"
>
<div
class=
"form-group"
>
<label>
</label>
<div>
<button
acl-check
class=
"btn btn-primary"
func=
" 'BARCODE_FUNCTION' "
ng-click=
"query()"
ng-disabled=
"!barcodeForm.$valid"
resource=
" 'QUERY' "
type=
"button"
><i
class=
"fa fa-search"
></i>
查询状态
</button>
<span
ng-if=
"loading"
><img
src=
"img/spinner.gif"
style=
"width: 30px;"
/></span>
</div>
</div>
</div>
</div>
</form>
<div
class=
"button-bar"
style=
"height: 200px"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<h1
class=
"pam"
>
条码状态:有效
</h1>
<h5
class=
"pam"
>
条码状态:有效
</h5>
</div>
</div>
</div>
<div
class=
"button-bar"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<button
acl-check
class=
"btn btn-primary plm prm mrm"
func=
" 'BARCODE_FUNCTION' "
ng-click=
"void()"
ng-disabled=
"!okStats"
resource=
" 'VOID_BARCODE' "
>
<i
class=
"fa fa-times"
></i>
作废
</button>
<button
acl-check
class=
"btn btn-primary plm prm"
func=
" 'BARCODE_FUNCTION' "
ng-click=
"print()"
ng-disabled=
"!okStats"
resource=
" 'PRINT_BARCODE' "
>
<i
class=
'fa fa-print'
></i>
重打
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/main/resources/static/app/srm/barcode/query/query.js
0 → 100644
View file @
0ab0d6ca
angular
.
module
(
'IOne'
).
controller
(
'BarcodeQueryController'
,
function
(
$scope
,
Constants
,
$interval
,
$uibModal
,
UtilService
,
BaseFactoryFileService
,
AuthService
,
BarcodeService
)
{
$scope
.
queryCondition
=
{
factory
:
{
id
:
null
},
barcode
:
null
};
$scope
.
okStatus
=
false
;
$scope
.
dtlMessage
=
""
;
$scope
.
query
=
function
()
{
if
(
AuthService
.
hasAcl
(
$scope
.
vm
.
currentAcl
,
'BARCODE_FUNCTION'
,
'QUERY'
))
{
BarcodeService
.
getBarcodeStatus
(
$scope
.
queryCondition
.
factory
.
factoryUid
,
$scope
.
queryCondition
.
barcode
).
then
(
function
(
response
)
{
if
(
response
.
data
.
code
==
'0'
)
{
$scope
.
okStatus
=
true
;
UtilService
.
showInfo
(
response
.
data
.
message
);
$scope
.
dtlMessage
=
response
.
data
.
message
;
}
else
{
UtilService
.
showError
(
response
.
data
.
message
);
$scope
.
dtlMessage
=
response
.
data
.
message
;
}
},
function
(
response
)
{
UtilService
.
showError
(
response
.
data
.
error
);
$scope
.
dtlMessage
=
response
.
data
.
message
;
}
);
}
};
$scope
.
void
=
function
()
{
UtilService
.
showConfirm
(
'确认作废'
+
$scope
.
queryCondition
.
barcode
+
'?'
,
''
,
function
()
{
BarcodeService
.
voidBarcode
(
$scope
.
queryCondition
.
factory
.
factoryUid
,
$scope
.
queryCondition
.
barcode
).
then
(
function
(
response
)
{
if
(
response
.
data
.
code
==
'0'
)
{
UtilService
.
showInfo
(
response
.
data
.
message
);
}
else
{
UtilService
.
showError
(
"作废失败:<br>"
+
response
.
data
.
message
);
}
},
function
(
response
)
{
UtilService
.
showError
(
"作废失败:<br>"
+
response
.
data
.
error
);
}
);
});
};
$scope
.
print
=
function
()
{
BarcodeService
.
printBarcode
(
$scope
.
queryCondition
.
factory
.
factoryUid
,
$scope
.
queryCondition
.
barcode
).
then
(
function
(
response
)
{
if
(
response
.
data
&&
response
.
data
.
code
===
'0'
)
{
if
(
response
.
data
.
printUrls
.
length
===
0
)
{
UtilService
.
showWarn
(
"没有可打印的防伪码"
);
return
;
}
angular
.
forEach
(
response
.
data
.
printUrls
,
function
(
url
)
{
try
{
$window
.
open
(
url
);
}
catch
(
e
)
{
console
.
error
(
e
);
}
});
}
else
{
UtilService
.
showError
(
"打印防伪码失败:<br>"
+
response
.
data
.
message
);
}
},
function
(
response
)
{
UtilService
.
showError
(
"打印防伪码失败:<br>"
+
response
.
data
);
}
)
};
$scope
.
barcodeChange
=
function
()
{
$scope
.
okStatus
=
false
;
$scope
.
dtlMessage
=
""
;
};
$scope
.
init
=
function
()
{
$scope
.
loading
=
false
;
BaseFactoryFileService
.
getByAccount
().
then
(
function
(
response
)
{
$scope
.
factories
=
response
;
if
(
$scope
.
factories
.
length
>
0
)
{
$scope
.
queryCondition
.
factory
.
id
=
$scope
.
factories
[
0
].
id
;
}
});
};
$scope
.
init
();
});
src/main/resources/templates/index.html
View file @
0ab0d6ca
...
@@ -363,6 +363,9 @@
...
@@ -363,6 +363,9 @@
<script
th:if=
"${dev}"
src=
"app/srm/session/session.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/session/session.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/session/query/query.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/session/query/query.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/barcode/barcode.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/barcode/query/query.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/test.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/test.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/chart/chart.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/chart/chart.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/uiGrid/uiGrid.js"
></script>
<script
th:if=
"${dev}"
src=
"app/srm/zTest/uiGrid/uiGrid.js"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment