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
d9b28d27
Commit
d9b28d27
authored
Aug 13, 2019
by
顾俭
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '#2' into 'master'
aship/aship#2 防伪码功能-打印 See merge request
!3
parents
36592699
6d8ed3b3
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
330 additions
and
20 deletions
+330
-20
application.yml
deploy/IOne-SRM-Prod/application.yml
+4
-0
application.yml
deploy/IOne-SRM-Staging/application.yml
+4
-0
BarCodePrintService.java
.../java/com/i1/erp/barcode/service/BarCodePrintService.java
+43
-0
IBarCodePrintService.java
...java/com/i1/erp/barcode/service/IBarCodePrintService.java
+8
-0
BarCodePrintClient.java
...main/java/com/i1/erp/barcode/soap/BarCodePrintClient.java
+111
-0
BarcodeGenClient.java
src/main/java/com/i1/erp/barcode/soap/BarcodeGenClient.java
+6
-8
SyncResponseWithList.java
...in/java/com/i1/erp/base/web/dto/SyncResponseWithList.java
+27
-0
Function.java
src/main/java/com/i1/srm/am/entity/Function.java
+1
-1
Resource.java
src/main/java/com/i1/srm/am/entity/Resource.java
+2
-1
PoDtlFileController.java
...ava/com/i1/srm/purchaseOrder/web/PoDtlFileController.java
+36
-6
PoBarcodePrintDto.java
...a/com/i1/srm/purchaseOrder/web/dto/PoBarcodePrintDto.java
+43
-0
application.yml
src/main/resources/application.yml
+9
-1
po.js
src/main/resources/static/app/srm/purchaseOrder/po.js
+3
-2
query.html
...n/resources/static/app/srm/purchaseOrder/query/query.html
+4
-0
query.js
...ain/resources/static/app/srm/purchaseOrder/query/query.js
+29
-1
No files found.
deploy/IOne-SRM-Prod/application.yml
View file @
d9b28d27
...
@@ -54,6 +54,10 @@ srm:
...
@@ -54,6 +54,10 @@ srm:
supplierErpCheck
:
true
supplierErpCheck
:
true
supplierErpSend
:
true
supplierErpSend
:
true
genBarcode
:
SRM_genbarcode
genBarcode
:
SRM_genbarcode
printBarcode
:
SRM_printbarcode
voidBarcode
:
SRM_voidbarcode
getBarcodeStatus
:
SRM_getbarcodestatus
fahuoConfirm
:
SRM_fahuoconfirm
email
:
email
:
enable
:
true
enable
:
true
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
...
...
deploy/IOne-SRM-Staging/application.yml
View file @
d9b28d27
...
@@ -54,6 +54,10 @@ srm:
...
@@ -54,6 +54,10 @@ srm:
supplierErpCheck
:
true
supplierErpCheck
:
true
supplierErpSend
:
true
supplierErpSend
:
true
genBarcode
:
SRM_genbarcode
genBarcode
:
SRM_genbarcode
printBarcode
:
SRM_printbarcode
voidBarcode
:
SRM_voidbarcode
getBarcodeStatus
:
SRM_getbarcodestatus
fahuoConfirm
:
SRM_fahuoconfirm
email
:
email
:
enable
:
true
enable
:
true
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
...
...
src/main/java/com/i1/erp/barcode/service/BarCodePrintService.java
0 → 100644
View file @
d9b28d27
package
com
.
i1
.
erp
.
barcode
.
service
;
import
com.i1.base.exception.IOneServiceException
;
import
com.i1.erp.entity.request.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
BarCodePrintService
implements
IBarCodePrintService
{
@Override
public
Request
getRequestXml
(
String
organization
,
String
docno
,
String
seq
,
String
barcode
,
String
type
)
throws
IOneServiceException
{
if
(
StringUtils
.
isBlank
(
docno
)
&&
StringUtils
.
isBlank
(
seq
)
&&
StringUtils
.
isBlank
(
barcode
))
{
throw
new
IOneServiceException
(
"防伪码打印参数为空"
);
}
Access
access
=
Access
.
of
(
Authentication
.
of
(
"017552"
,
"tiptop"
),
Connection
.
of
(
"SRM"
,
"192.168.1.1"
),
Organization
.
of
(
organization
),
Locale
.
of
(
"zh_cn"
));
List
<
Field
>
mstFieldList
=
new
ArrayList
<>();
mstFieldList
.
add
(
Field
.
of
(
"docno"
,
docno
));
mstFieldList
.
add
(
Field
.
of
(
"seq"
,
seq
));
mstFieldList
.
add
(
Field
.
of
(
"barcode"
,
barcode
));
mstFieldList
.
add
(
Field
.
of
(
"type"
,
type
));
Record
mstRecord
=
Record
.
of
(
mstFieldList
);
Master
mst
=
Master
.
of
(
mstRecord
,
"MST"
);
RecordSet
recordSet
=
RecordSet
.
of
(
"1"
,
mst
);
List
<
RecordSet
>
recordSetList
=
new
ArrayList
<>();
recordSetList
.
add
(
recordSet
);
RequestContent
requestContent
=
new
RequestContent
();
requestContent
.
setDocument
(
Document
.
of
(
recordSetList
));
requestContent
.
setParameter
(
Parameter
.
of
(
Record
.
of
(
null
)));
return
Request
.
of
(
access
,
requestContent
);
}
}
src/main/java/com/i1/erp/barcode/service/IBarCodePrintService.java
0 → 100644
View file @
d9b28d27
package
com
.
i1
.
erp
.
barcode
.
service
;
import
com.i1.base.exception.IOneServiceException
;
import
com.i1.erp.entity.request.Request
;
public
interface
IBarCodePrintService
{
Request
getRequestXml
(
String
organization
,
String
docno
,
String
seq
,
String
barcode
,
String
type
)
throws
IOneServiceException
;
}
src/main/java/com/i1/erp/barcode/soap/BarCodePrintClient.java
0 → 100644
View file @
d9b28d27
package
com
.
i1
.
erp
.
barcode
.
soap
;
import
com.i1.base.exception.IOneServiceException
;
import
com.i1.erp.WebServiceClient
;
import
com.i1.erp.barcode.service.IBarCodePrintService
;
import
com.i1.erp.base.web.dto.SyncResponseWithList
;
import
com.i1.erp.entity.request.Field
;
import
com.i1.erp.entity.request.RecordSet
;
import
com.i1.erp.entity.request.Request
;
import
com.i1.erp.entity.response.Document
;
import
com.i1.erp.entity.response.Response
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.cxf.endpoint.Client
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
tw.com.dsc.tiptop.tiptopservicegateway.SRMPrintbarcodeRequestSRMPrintbarcodeRequest
;
import
tw.com.dsc.tiptop.tiptopservicegateway.SRMPrintbarcodeResponseSRMPrintbarcodeResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
FAIL_CODE
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
SUCCESS_CODE
;
import
static
com
.
i1
.
srm
.
utils
.
SafeType
.
safeString
;
/**
* 防伪码接口只做了动态客户端版本
*/
@Component
public
class
BarCodePrintClient
extends
WebServiceClient
{
@Value
(
"${srm.soapWs.printBarcode}"
)
public
String
ERP_PRINT_BARCODE_OP
;
@Value
(
"${srm.soapWs.wsdlUrl}"
)
private
String
WSDL_URL
;
@Autowired
private
IBarCodePrintService
barCodePrintService
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeGenClient
.
class
);
public
SyncResponseWithList
getBarcodePrintUrls
(
String
organization
,
String
docno
,
String
seq
,
String
barcode
,
String
type
)
{
List
<
String
>
urls
=
new
ArrayList
<>();
try
{
// xml
logger
.
info
(
"prepare gen barcode {}"
,
organization
+
"-"
+
docno
+
"-"
+
seq
+
"-"
+
barcode
+
"-"
+
type
);
Request
requestXml
=
barCodePrintService
.
getRequestXml
(
organization
,
docno
,
seq
,
barcode
,
type
);
if
(
requestXml
==
null
)
{
logger
.
error
(
"error:防伪码打印地址无法生成XML结构"
);
return
SyncResponseWithList
.
of
(
FAIL_CODE
,
"防伪码打印地址无法生成XML结构"
,
urls
);
}
// request
SRMPrintbarcodeRequestSRMPrintbarcodeRequest
printbarcodeRequest
=
new
SRMPrintbarcodeRequestSRMPrintbarcodeRequest
();
printbarcodeRequest
.
setRequest
(
covertObjectToXML
(
requestXml
,
Request
.
class
));
logger
.
info
(
printbarcodeRequest
.
getRequest
());
if
(
StringUtils
.
isBlank
(
WSDL_URL
)
||
StringUtils
.
isBlank
(
ERP_PRINT_BARCODE_OP
))
{
throw
new
IOneServiceException
(
"WSDL不可为空."
);
}
Client
client
=
getClient
(
WSDL_URL
);
Object
[]
objects
=
client
.
invoke
(
ERP_PRINT_BARCODE_OP
,
new
Object
[]{
printbarcodeRequest
});
client
.
destroy
();
// response
if
(
objects
!=
null
&&
objects
.
length
>
0
)
{
SRMPrintbarcodeResponseSRMPrintbarcodeResponse
printbarcodeResponse
=
(
SRMPrintbarcodeResponseSRMPrintbarcodeResponse
)
objects
[
0
];
logger
.
info
(
printbarcodeResponse
.
getResponse
());
Response
response
=
convertXMLToObject
(
printbarcodeResponse
.
getResponse
(),
Response
.
class
);
if
(
response
.
getExecution
().
getStatus
().
getCode
().
equalsIgnoreCase
(
"0"
))
{
Document
document
=
response
.
getResponseContent
().
getDocument
();
List
<
RecordSet
>
recordSetList
=
new
ArrayList
<>();
if
(
document
!=
null
)
{
recordSetList
=
response
.
getResponseContent
().
getDocument
().
getRecordSetList
();
}
if
(
document
!=
null
&&
recordSetList
!=
null
&&
recordSetList
.
size
()
>
0
)
{
for
(
RecordSet
recordSet
:
recordSetList
)
{
List
<
Field
>
fieldList
=
recordSet
.
getMaster
().
getRecord
().
getFieldList
();
for
(
Field
field
:
fieldList
)
{
if
(
"url"
.
equals
(
field
.
getName
()))
{
urls
.
add
(
field
.
getValue
());
}
}
}
}
else
{
logger
.
warn
(
"warn:"
,
"erp无返回资料"
);
}
return
SyncResponseWithList
.
of
(
SUCCESS_CODE
,
"获取防伪码打印地址成功"
,
urls
);
}
else
{
String
errorDetails
=
String
.
format
(
"失败码:%s,原因:%s,SQL:%s"
,
safeString
(
response
.
getExecution
().
getStatus
().
getCode
()),
safeString
(
response
.
getExecution
().
getStatus
().
getDescription
()),
safeString
(
response
.
getExecution
().
getStatus
().
getSqlcode
()));
return
SyncResponseWithList
.
of
(
FAIL_CODE
,
errorDetails
,
urls
);
}
}
else
{
logger
.
error
(
"ERP无响应."
);
return
SyncResponseWithList
.
of
(
FAIL_CODE
,
"ERP无响应"
,
urls
);
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"e"
,
e
);
return
SyncResponseWithList
.
of
(
FAIL_CODE
,
e
.
getMessage
(),
urls
);
}
}
}
\ No newline at end of file
src/main/java/com/i1/erp/barcode/soap/BarcodeGenClient.java
View file @
d9b28d27
...
@@ -23,25 +23,23 @@ import static com.i1.srm.utils.SafeType.safeString;
...
@@ -23,25 +23,23 @@ import static com.i1.srm.utils.SafeType.safeString;
@Component
@Component
public
class
BarcodeGenClient
extends
WebServiceClient
{
public
class
BarcodeGenClient
extends
WebServiceClient
{
// 防伪码接口只做了动态客户端版本
@Value
(
"${srm.soapWs.wsDynamicClient}"
)
@Value
(
"${srm.soapWs.wsDynamicClient}"
)
public
Boolean
wsDynamicClient
;
public
Boolean
wsDynamicClient
;
@Value
(
"${srm.soapWs.wsdlUrl}"
)
private
String
WSDL_URL
;
@Value
(
"${srm.soapWs.genBarcode}"
)
@Value
(
"${srm.soapWs.genBarcode}"
)
public
String
ERP_GEN_BARCODE_OP
;
public
String
ERP_GEN_BARCODE_OP
;
@Value
(
"${srm.soapWs.wsdlUrl}"
)
private
String
WSDL_URL
;
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeGenClient
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeGenClient
.
class
);
@Autowired
@Autowired
private
BarCodeGenService
barCodeGenService
l
;
private
BarCodeGenService
barCodeGenService
;
public
SyncResponse
genBarcode
(
PoBarcodeDto
input
)
{
public
SyncResponse
genBarcode
(
PoBarcodeDto
input
)
{
try
{
try
{
// xml
// xml
logger
.
info
(
"prepare gen barcode {}"
,
input
.
getFactoryUid
()
+
"-"
+
input
.
getPurchaseOrderUid
());
logger
.
info
(
"prepare gen barcode {}"
,
input
.
getFactoryUid
()
+
"-"
+
input
.
getPurchaseOrderUid
());
Request
requestXml
=
barCodeGenService
l
.
genXml
(
input
);
Request
requestXml
=
barCodeGenService
.
genXml
(
input
);
if
(
requestXml
==
null
)
{
if
(
requestXml
==
null
)
{
logger
.
error
(
"error:防伪码申请无法生成XML结构"
);
logger
.
error
(
"error:防伪码申请无法生成XML结构"
);
return
SyncResponse
.
of
(
FAIL_CODE
,
"防伪码申请无法生成XML结构"
);
return
SyncResponse
.
of
(
FAIL_CODE
,
"防伪码申请无法生成XML结构"
);
...
@@ -69,7 +67,7 @@ public class BarcodeGenClient extends WebServiceClient {
...
@@ -69,7 +67,7 @@ public class BarcodeGenClient extends WebServiceClient {
if
(
response
.
getExecution
().
getStatus
().
getCode
().
equalsIgnoreCase
(
"0"
))
{
if
(
response
.
getExecution
().
getStatus
().
getCode
().
equalsIgnoreCase
(
"0"
))
{
return
SyncResponse
.
of
(
SUCCESS_CODE
,
"申请防伪码成功"
);
return
SyncResponse
.
of
(
SUCCESS_CODE
,
"申请防伪码成功"
);
}
else
{
}
else
{
String
errorDetails
=
String
.
format
(
"失败码:%s
, 原因: %s, SQL:
"
,
String
errorDetails
=
String
.
format
(
"失败码:%s
, 原因:%s,SQL:%s
"
,
safeString
(
response
.
getExecution
().
getStatus
().
getCode
()),
safeString
(
response
.
getExecution
().
getStatus
().
getCode
()),
safeString
(
response
.
getExecution
().
getStatus
().
getDescription
()),
safeString
(
response
.
getExecution
().
getStatus
().
getDescription
()),
safeString
(
response
.
getExecution
().
getStatus
().
getSqlcode
()));
safeString
(
response
.
getExecution
().
getStatus
().
getSqlcode
()));
...
...
src/main/java/com/i1/erp/base/web/dto/SyncResponseWithList.java
0 → 100644
View file @
d9b28d27
package
com
.
i1
.
erp
.
base
.
web
.
dto
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
java.util.List
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
SyncResponseWithList
extends
SyncResponse
{
private
List
<
String
>
content
;
public
SyncResponseWithList
(
String
code
,
String
message
,
List
<
String
>
content
)
{
super
(
code
,
message
);
this
.
content
=
content
;
}
public
List
<
String
>
getContent
()
{
return
content
;
}
public
void
setContent
(
List
<
String
>
content
)
{
this
.
content
=
content
;
}
public
static
SyncResponseWithList
of
(
String
code
,
String
message
,
List
<
String
>
content
)
{
return
new
SyncResponseWithList
(
code
,
message
,
content
);
}
}
src/main/java/com/i1/srm/am/entity/Function.java
View file @
d9b28d27
...
@@ -15,7 +15,7 @@ import static com.i1.srm.am.entity.Resource.*;
...
@@ -15,7 +15,7 @@ import static com.i1.srm.am.entity.Resource.*;
public
enum
Function
{
public
enum
Function
{
INDEX_NOTICE_FUNCTION
(
0
,
0
,
"首页公告"
,
Lists
.
newArrayList
(
QUERY
,
CREATE
,
VIEW_NOTICE_HISTORY
)),
INDEX_NOTICE_FUNCTION
(
0
,
0
,
"首页公告"
,
Lists
.
newArrayList
(
QUERY
,
CREATE
,
VIEW_NOTICE_HISTORY
)),
//1采购协同管理
//1采购协同管理
PURCHASE_ORDER_FUNCTION
(
1
,
11
,
"采购单管理"
,
Lists
.
newArrayList
(
QUERY
,
VIEW
,
RETURN
,
EXPORT
,
GEN_BARCODE
)),
PURCHASE_ORDER_FUNCTION
(
1
,
11
,
"采购单管理"
,
Lists
.
newArrayList
(
QUERY
,
VIEW
,
RETURN
,
EXPORT
,
GEN_BARCODE
,
PRINT_BARCODE
)),
PURCHASE_ORDER_CHANGE_FUNCTION
(
14
,
12
,
"采购变更单管理"
,
Lists
.
newArrayList
(
QUERY
,
VIEW
,
EXPORT
,
RETURN
,
CONFIRM
,
RETURN_ACCEPT
,
RETURN_REJECT
,
CONFIRM_ACCEPT
,
CONFIRM_REJECT
)),
PURCHASE_ORDER_CHANGE_FUNCTION
(
14
,
12
,
"采购变更单管理"
,
Lists
.
newArrayList
(
QUERY
,
VIEW
,
EXPORT
,
RETURN
,
CONFIRM
,
RETURN_ACCEPT
,
RETURN_REJECT
,
CONFIRM_ACCEPT
,
CONFIRM_REJECT
)),
//2送货协同管理
//2送货协同管理
...
...
src/main/java/com/i1/srm/am/entity/Resource.java
View file @
d9b28d27
...
@@ -63,7 +63,8 @@ public enum Resource {
...
@@ -63,7 +63,8 @@ public enum Resource {
CHECK_RELEASE
(
53
,
"审核发布"
),
CHECK_RELEASE
(
53
,
"审核发布"
),
ADDITIONAL_RECORDING
(
54
,
"补录税票"
),
ADDITIONAL_RECORDING
(
54
,
"补录税票"
),
SEND_TO_ERP
(
55
,
"上传ERP"
),
SEND_TO_ERP
(
55
,
"上传ERP"
),
GEN_BARCODE
(
56
,
"申请防伪码"
)
GEN_BARCODE
(
56
,
"申请防伪码"
),
PRINT_BARCODE
(
57
,
"打印防伪码"
)
;
;
private
Integer
id
;
private
Integer
id
;
...
...
src/main/java/com/i1/srm/purchaseOrder/web/PoDtlFileController.java
View file @
d9b28d27
...
@@ -3,6 +3,8 @@ package com.i1.srm.purchaseOrder.web;
...
@@ -3,6 +3,8 @@ package com.i1.srm.purchaseOrder.web;
import
com.i1.base.exception.IOneServiceException
;
import
com.i1.base.exception.IOneServiceException
;
import
com.i1.base.exception.IOneWebRestfulException
;
import
com.i1.base.exception.IOneWebRestfulException
;
import
com.i1.base.web.AbstractController
;
import
com.i1.base.web.AbstractController
;
import
com.i1.erp.barcode.soap.BarCodePrintClient
;
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
;
...
@@ -11,6 +13,7 @@ import com.i1.srm.deliveryOrder.service.IDoDtlFileService;
...
@@ -11,6 +13,7 @@ import com.i1.srm.deliveryOrder.service.IDoDtlFileService;
import
com.i1.srm.purchaseOrder.dao.entity.PoDtlFile
;
import
com.i1.srm.purchaseOrder.dao.entity.PoDtlFile
;
import
com.i1.srm.purchaseOrder.service.IPoDtlFileService
;
import
com.i1.srm.purchaseOrder.service.IPoDtlFileService
;
import
com.i1.srm.purchaseOrder.service.IPoMstFileService
;
import
com.i1.srm.purchaseOrder.service.IPoMstFileService
;
import
com.i1.srm.purchaseOrder.web.dto.PoBarcodePrintDto
;
import
com.i1.srm.purchaseOrder.web.dto.PoDtlFileDto
;
import
com.i1.srm.purchaseOrder.web.dto.PoDtlFileDto
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -21,10 +24,14 @@ import org.springframework.data.domain.Pageable;
...
@@ -21,10 +24,14 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
FAIL_CODE
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
SUCCESS_CODE
;
@RestController
@RestController
@RequestMapping
(
"/purchaseOrderDetails"
)
@RequestMapping
(
"/purchaseOrderDetails"
)
...
@@ -37,13 +44,15 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -37,13 +44,15 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
private
IDoDtlFileService
doDtlFileService
;
private
IDoDtlFileService
doDtlFileService
;
@Autowired
@Autowired
private
IPoMstFileService
poMstFileService
;
private
IPoMstFileService
poMstFileService
;
@Autowired
private
BarCodePrintClient
barCodePrintClient
;
@Override
@Override
protected
IPoDtlFileService
getService
()
{
protected
IPoDtlFileService
getService
()
{
return
service
;
return
service
;
}
}
@ResourcePermission
(
values
=
{
Resource
.
QUERY
})
@ResourcePermission
(
values
=
{
Resource
.
QUERY
})
@RequestMapping
(
value
=
"/getAllByPageAndExample"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getAllByPageAndExample"
,
method
=
RequestMethod
.
GET
)
public
Page
<
PoDtlFileDto
>
getAllByPageAndExample
(
@RequestParam
String
exampleJson
,
@RequestParam
(
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
defaultValue
=
"100"
)
int
size
)
throws
IOneWebRestfulException
{
public
Page
<
PoDtlFileDto
>
getAllByPageAndExample
(
@RequestParam
String
exampleJson
,
@RequestParam
(
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
defaultValue
=
"100"
)
int
size
)
throws
IOneWebRestfulException
{
try
{
try
{
...
@@ -53,7 +62,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -53,7 +62,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
PoDtlFileDto
dtoExample
=
getDtoFromExampleJson
(
exampleJson
);
PoDtlFileDto
dtoExample
=
getDtoFromExampleJson
(
exampleJson
);
PoDtlFile
poDtlFile
=
getEntityFromDto
(
dtoExample
);
PoDtlFile
poDtlFile
=
getEntityFromDto
(
dtoExample
);
if
(
null
!=
dtoExample
.
getRequiredDeliveryDateEnd
())
{
if
(
null
!=
dtoExample
.
getRequiredDeliveryDateEnd
())
{
Date
dateEnd
=
dtoExample
.
getRequiredDeliveryDateEnd
();
Date
dateEnd
=
dtoExample
.
getRequiredDeliveryDateEnd
();
dateEnd
.
setHours
(
23
);
dateEnd
.
setHours
(
23
);
dateEnd
.
setMinutes
(
59
);
dateEnd
.
setMinutes
(
59
);
...
@@ -69,7 +78,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -69,7 +78,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
poDtl
.
setRelationAmount
(
doDtlFileService
.
getRelationAmount
(
poDtl
.
getId
()));
poDtl
.
setRelationAmount
(
doDtlFileService
.
getRelationAmount
(
poDtl
.
getId
()));
}
}
System
.
out
.
println
(
entities
.
getTotalElements
());
//TODO delete after test
System
.
out
.
println
(
entities
.
getTotalElements
());
//TODO delete after test
return
new
PageImpl
<>(
convertEntitiesToDtos
(
entities
.
getContent
()),
pageable
,
entities
.
getTotalElements
());
return
new
PageImpl
<>(
convertEntitiesToDtos
(
entities
.
getContent
()),
pageable
,
entities
.
getTotalElements
());
}
else
{
}
else
{
throw
new
IOneWebRestfulException
(
"Example is null."
);
throw
new
IOneWebRestfulException
(
"Example is null."
);
...
@@ -88,7 +97,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -88,7 +97,7 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
PoDtlFileDto
dtoExample
=
getDtoFromExampleJson
(
exampleJson
);
PoDtlFileDto
dtoExample
=
getDtoFromExampleJson
(
exampleJson
);
PoDtlFile
entity
=
getEntityFromDto
(
dtoExample
);
PoDtlFile
entity
=
getEntityFromDto
(
dtoExample
);
if
(
null
!=
dtoExample
.
getRequiredDeliveryDateEnd
())
{
if
(
null
!=
dtoExample
.
getRequiredDeliveryDateEnd
())
{
Date
dateEnd
=
dtoExample
.
getRequiredDeliveryDateEnd
();
Date
dateEnd
=
dtoExample
.
getRequiredDeliveryDateEnd
();
dateEnd
.
setHours
(
23
);
dateEnd
.
setHours
(
23
);
dateEnd
.
setMinutes
(
59
);
dateEnd
.
setMinutes
(
59
);
...
@@ -121,14 +130,14 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -121,14 +130,14 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
PoDtlFile
poDtlFile
=
getEntityFromDto
(
dtoExample
);
PoDtlFile
poDtlFile
=
getEntityFromDto
(
dtoExample
);
List
<
String
>
stringMatchFields
=
Arrays
.
asList
(
"poMst.purchaseOrderUid"
);
List
<
String
>
stringMatchFields
=
Arrays
.
asList
(
"poMst.purchaseOrderUid"
);
if
(
null
!=
dtoExample
.
getPoMst
()
&&
null
!=
dtoExample
.
getPoMst
().
getOrderDateEnd
())
{
if
(
null
!=
dtoExample
.
getPoMst
()
&&
null
!=
dtoExample
.
getPoMst
().
getOrderDateEnd
())
{
Date
dateEnd
=
dtoExample
.
getPoMst
().
getOrderDateEnd
();
Date
dateEnd
=
dtoExample
.
getPoMst
().
getOrderDateEnd
();
dateEnd
.
setHours
(
23
);
dateEnd
.
setHours
(
23
);
dateEnd
.
setMinutes
(
59
);
dateEnd
.
setMinutes
(
59
);
dateEnd
.
setSeconds
(
59
);
dateEnd
.
setSeconds
(
59
);
dtoExample
.
getPoMst
().
setOrderDateEnd
(
dateEnd
);
dtoExample
.
getPoMst
().
setOrderDateEnd
(
dateEnd
);
}
}
if
(
null
!=
dtoExample
.
getConfirmedDeliveryDateEnd
())
{
if
(
null
!=
dtoExample
.
getConfirmedDeliveryDateEnd
())
{
Date
dateEnd
=
dtoExample
.
getConfirmedDeliveryDateEnd
();
Date
dateEnd
=
dtoExample
.
getConfirmedDeliveryDateEnd
();
dateEnd
.
setHours
(
23
);
dateEnd
.
setHours
(
23
);
dateEnd
.
setMinutes
(
59
);
dateEnd
.
setMinutes
(
59
);
...
@@ -195,4 +204,25 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
...
@@ -195,4 +204,25 @@ public class PoDtlFileController extends AbstractController<PoDtlFile, PoDtlFile
throw
new
IOneWebRestfulException
(
e
);
throw
new
IOneWebRestfulException
(
e
);
}
}
}
}
@ResourcePermission
(
values
=
{
Resource
.
PRINT_BARCODE
})
@RequestMapping
(
value
=
"/{id}/printBarcode"
,
method
=
RequestMethod
.
GET
)
public
PoBarcodePrintDto
printBarcode
(
@PathVariable
Long
id
)
throws
IOneWebRestfulException
{
try
{
List
<
String
>
urls
=
new
ArrayList
<>();
PoDtlFile
exist
=
getService
().
get
(
id
);
if
(
exist
!=
null
)
{
SyncResponseWithList
responseWithList
=
barCodePrintClient
.
getBarcodePrintUrls
(
exist
.
getPoMst
().
getFactory
().
getFactoryUid
(),
exist
.
getPoMst
().
getPurchaseOrderUid
(),
exist
.
getPoDtlRow
().
toString
(),
""
,
"1"
);
if
(
SUCCESS_CODE
.
equals
(
responseWithList
.
getCode
()))
{
urls
.
addAll
(
responseWithList
.
getContent
());
}
return
new
PoBarcodePrintDto
(
responseWithList
.
getCode
(),
responseWithList
.
getMessage
(),
urls
);
}
else
{
return
new
PoBarcodePrintDto
(
FAIL_CODE
,
"找不到该采购单,id:"
+
id
,
urls
);
}
}
catch
(
IOneServiceException
e
)
{
throw
new
IOneWebRestfulException
(
e
);
}
}
}
}
src/main/java/com/i1/srm/purchaseOrder/web/dto/PoBarcodePrintDto.java
0 → 100644
View file @
d9b28d27
package
com
.
i1
.
srm
.
purchaseOrder
.
web
.
dto
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
java.util.List
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
PoBarcodePrintDto
{
private
String
code
;
private
String
message
;
private
List
<
String
>
printUrls
;
public
PoBarcodePrintDto
(
String
code
,
String
message
,
List
<
String
>
printUrls
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
printUrls
=
printUrls
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getMessage
()
{
return
message
;
}
public
void
setMessage
(
String
message
)
{
this
.
message
=
message
;
}
public
List
<
String
>
getPrintUrls
()
{
return
printUrls
;
}
public
void
setPrintUrls
(
List
<
String
>
printUrls
)
{
this
.
printUrls
=
printUrls
;
}
}
src/main/resources/application.yml
View file @
d9b28d27
...
@@ -104,7 +104,10 @@ srm:
...
@@ -104,7 +104,10 @@ srm:
supplierErpCheck
:
false
supplierErpCheck
:
false
supplierErpSend
:
false
supplierErpSend
:
false
genBarcode
:
SRM_genbarcode
genBarcode
:
SRM_genbarcode
printBarcode
:
SRM_printbarcode
voidBarcode
:
SRM_voidbarcode
getBarcodeStatus
:
SRM_getbarcodestatus
fahuoConfirm
:
SRM_fahuoconfirm
email
:
email
:
enable
:
true
enable
:
true
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
...
@@ -205,6 +208,11 @@ srm:
...
@@ -205,6 +208,11 @@ srm:
defaultPoChgReturnType
:
1
defaultPoChgReturnType
:
1
supplierErpCheck
:
false
supplierErpCheck
:
false
supplierErpSend
:
false
supplierErpSend
:
false
genBarcode
:
SRM_genbarcode
printBarcode
:
SRM_printbarcode
voidBarcode
:
SRM_voidbarcode
getBarcodeStatus
:
SRM_getbarcodestatus
fahuoConfirm
:
SRM_fahuoconfirm
email
:
email
:
enable
:
true
enable
:
true
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
recipients
:
gujian@benchmarkchina.com,raven@benchmarkchina.com
...
...
src/main/resources/static/app/srm/purchaseOrder/po.js
View file @
d9b28d27
...
@@ -30,13 +30,14 @@
...
@@ -30,13 +30,14 @@
}
}
);
);
},
},
getUnReturnedOrders
:
function
()
{
getUnReturnedOrders
:
function
()
{
return
this
.
httpService
.
get
(
'/purchaseOrderDetails/getSummary/getUnReturnedOrders'
);
return
this
.
httpService
.
get
(
'/purchaseOrderDetails/getSummary/getUnReturnedOrders'
);
},
},
getOverdueUnfinishedOrders
:
function
()
{
getOverdueUnfinishedOrders
:
function
()
{
return
this
.
httpService
.
get
(
'/purchaseOrderDetails/getSummary/getOverdueUnfinishedOrders'
);
return
this
.
httpService
.
get
(
'/purchaseOrderDetails/getSummary/getOverdueUnfinishedOrders'
);
},
printBarcode
:
function
(
id
)
{
return
this
.
httpService
.
get
(
'/purchaseOrderDetails/'
+
id
+
"/printBarcode"
);
}
}
});
});
});
});
...
...
src/main/resources/static/app/srm/purchaseOrder/query/query.html
View file @
d9b28d27
...
@@ -124,6 +124,10 @@
...
@@ -124,6 +124,10 @@
data-toggle=
"modal"
data-target=
"#get-barcode-dlg"
data-toggle=
"modal"
data-target=
"#get-barcode-dlg"
ng-disabled=
"!currentPurchaseOrderMaster"
acl-check
func=
" 'PURCHASE_ORDER_FUNCTION' "
resource=
" 'GEN_BARCODE' "
>
申请防伪码
ng-disabled=
"!currentPurchaseOrderMaster"
acl-check
func=
" 'PURCHASE_ORDER_FUNCTION' "
resource=
" 'GEN_BARCODE' "
>
申请防伪码
</button>
</button>
<button
class=
"btn btn-default mrs"
ng-if=
"queryCondition.poMst.supplier && queryCondition.poMst.supplier.useBarcode == 'Y'"
ng-click=
"printBarcodeClick()"
ng-disabled=
"!currentPurchaseOrderMaster"
acl-check
func=
" 'PURCHASE_ORDER_FUNCTION' "
resource=
" 'PRINT_BARCODE' "
>
打印防伪码
</button>
<button
class=
"btn btn-default mrs"
ng-click=
"clickExport()"
ng-disabled=
"gridOptions.data.length == 0"
acl-check
func=
" 'PURCHASE_ORDER_FUNCTION' "
resource=
" 'EXPORT' "
>
导出
</button>
<button
class=
"btn btn-default mrs"
ng-click=
"clickExport()"
ng-disabled=
"gridOptions.data.length == 0"
acl-check
func=
" 'PURCHASE_ORDER_FUNCTION' "
resource=
" 'EXPORT' "
>
导出
</button>
<ul
uib-pagination
total-items=
"pageOption.totalElements"
ng-model=
"pageOption.page"
items-per-page=
"pageOption.size"
ng-change=
"getPurchaseOrderDetails()"
<ul
uib-pagination
total-items=
"pageOption.totalElements"
ng-model=
"pageOption.page"
items-per-page=
"pageOption.size"
ng-change=
"getPurchaseOrderDetails()"
class=
"pagination-sm pull-right mbn mtn"
boundary-links=
"true"
rotate=
"false"
max-size=
"5"
class=
"pagination-sm pull-right mbn mtn"
boundary-links=
"true"
rotate=
"false"
max-size=
"5"
...
...
src/main/resources/static/app/srm/purchaseOrder/query/query.js
View file @
d9b28d27
angular
.
module
(
'IOne'
).
controller
(
'PurchaseOrderQueryController'
,
function
(
$scope
,
$rootScope
,
$timeout
,
$log
,
$interval
,
$routeParams
,
angular
.
module
(
'IOne'
).
controller
(
'PurchaseOrderQueryController'
,
function
(
$scope
,
$rootScope
,
$timeout
,
$log
,
$interval
,
$routeParams
,
$window
,
PoMstFileService
,
PoDtlFileService
,
BaseFactoryFileService
,
AuthService
,
PoMstFileService
,
PoDtlFileService
,
BaseFactoryFileService
,
AuthService
,
BaseSupplierFileService
,
BaseProductFileService
,
UtilService
,
Constants
)
{
BaseSupplierFileService
,
BaseProductFileService
,
UtilService
,
Constants
)
{
//variables
//variables
...
@@ -373,4 +373,32 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
...
@@ -373,4 +373,32 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
});
});
});
});
// 打印防伪码
// printBarcode
$scope
.
printBarcodeClick
=
function
()
{
// to call poDtl api, to call soap ws, to get print urls, to open windows
PoDtlFileService
.
printBarcode
(
$scope
.
selectedPurchaseOrder
.
id
).
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
);
}
)
}
});
});
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