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
36592699
Commit
36592699
authored
Aug 13, 2019
by
顾俭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aship/aship#1 防伪码功能:申请防伪码接口
parent
d1a7c884
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
20 deletions
+73
-20
PoDtlFile.java
...n/java/com/i1/srm/purchaseOrder/dao/entity/PoDtlFile.java
+11
-0
PoMstFileController.java
...ava/com/i1/srm/purchaseOrder/web/PoMstFileController.java
+22
-3
PoDtlFileDto.java
...n/java/com/i1/srm/purchaseOrder/web/dto/PoDtlFileDto.java
+9
-0
update.js
...n/resources/static/app/srm/deliveryOrder/update/update.js
+1
-1
query.html
...n/resources/static/app/srm/purchaseOrder/query/query.html
+1
-3
query.js
...ain/resources/static/app/srm/purchaseOrder/query/query.js
+29
-13
No files found.
src/main/java/com/i1/srm/purchaseOrder/dao/entity/PoDtlFile.java
View file @
36592699
...
...
@@ -71,6 +71,7 @@ public class PoDtlFile extends IdentifiableObject {
private
Long
erpOrderId
;
private
String
remark
;
private
String
statusCode
;
private
BigDecimal
appliedAmount
;
@Transient
private
BigDecimal
relationAmount
;
private
String
projectNumber
;
...
...
@@ -418,4 +419,14 @@ public class PoDtlFile extends IdentifiableObject {
public
void
setReturnRemark
(
String
returnRemark
)
{
this
.
returnRemark
=
returnRemark
;
}
@Basic
@Column
(
name
=
"APPLIED_AMOUNT"
,
nullable
=
true
,
precision
=
5
)
public
BigDecimal
getAppliedAmount
()
{
return
appliedAmount
;
}
public
void
setAppliedAmount
(
BigDecimal
appliedAmount
)
{
this
.
appliedAmount
=
appliedAmount
;
}
}
src/main/java/com/i1/srm/purchaseOrder/web/PoMstFileController.java
View file @
36592699
...
...
@@ -8,7 +8,9 @@ import com.i1.srm.am.entity.Function;
import
com.i1.srm.am.entity.Resource
;
import
com.i1.srm.am.service.ResourcePermission
;
import
com.i1.srm.am.service.SecuredPage
;
import
com.i1.srm.purchaseOrder.dao.entity.PoDtlFile
;
import
com.i1.srm.purchaseOrder.dao.entity.PoMstFile
;
import
com.i1.srm.purchaseOrder.service.IPoDtlFileService
;
import
com.i1.srm.purchaseOrder.service.IPoMstFileService
;
import
com.i1.srm.purchaseOrder.web.dto.PoBarcodeDtlDto
;
import
com.i1.srm.purchaseOrder.web.dto.PoBarcodeDto
;
...
...
@@ -19,8 +21,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
static
com
.
i1
.
erp
.
base
.
web
.
dto
.
SyncResponseCode
.
SUCCESS_CODE
;
@RestController
@RequestMapping
(
"/purchaseOrders"
)
...
...
@@ -40,6 +46,9 @@ public class PoMstFileController extends AbstractController<PoMstFile, PoMstFile
@Autowired
private
BarcodeGenClient
barcodeGenClient
;
@Autowired
private
IPoDtlFileService
poDtlFileService
;
/**
* 申请防伪码
*
...
...
@@ -52,13 +61,23 @@ public class PoMstFileController extends AbstractController<PoMstFile, PoMstFile
@ResponseStatus
(
HttpStatus
.
CREATED
)
public
SyncResponse
getBarCode
(
@RequestBody
PoBarcodeDto
input
)
throws
IOneWebRestfulException
{
try
{
// TODO check
String
factoryUid
=
Objects
.
requireNonNull
(
input
.
getFactoryUid
());
String
purchaseOrderUid
=
Objects
.
requireNonNull
(
input
.
getPurchaseOrderUid
());
List
<
PoBarcodeDtlDto
>
dtls
=
Objects
.
requireNonNull
(
input
.
getDtl
());
return
barcodeGenClient
.
genBarcode
(
input
);
SyncResponse
syncResponse
=
barcodeGenClient
.
genBarcode
(
input
);
// 更新已申请数量
if
(
SUCCESS_CODE
.
equals
(
syncResponse
.
getCode
()))
{
for
(
PoBarcodeDtlDto
dtl
:
dtls
)
{
Optional
<
PoDtlFile
>
opPoDtl
=
poDtlFileService
.
findByPoMstPurchaseOrderUidAndPoDtlRowAndFactoryFactoryUid
(
purchaseOrderUid
,
dtl
.
getPoDtlRow
(),
factoryUid
);
if
(
opPoDtl
.
isPresent
())
{
PoDtlFile
poDtlFile
=
opPoDtl
.
get
();
poDtlFile
.
setAppliedAmount
(
dtl
.
getBarcodeAmount
().
add
(
poDtlFile
.
getAppliedAmount
()
==
null
?
BigDecimal
.
ZERO
:
poDtlFile
.
getAppliedAmount
()));
poDtlFileService
.
update
(
poDtlFile
);
}
}
}
return
syncResponse
;
}
catch
(
Exception
e
)
{
throw
new
IOneWebRestfulException
(
e
);
}
...
...
src/main/java/com/i1/srm/purchaseOrder/web/dto/PoDtlFileDto.java
View file @
36592699
...
...
@@ -47,6 +47,7 @@ public class PoDtlFileDto extends Dto<PoDtlFile> {
private
String
statusCode
;
private
String
projectNumber
;
private
String
returnRemark
;
private
BigDecimal
appliedAmount
;
//ext
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
,
timezone
=
"Asia/Shanghai"
)
...
...
@@ -398,4 +399,12 @@ public class PoDtlFileDto extends Dto<PoDtlFile> {
public
void
setReturnRemark
(
String
returnRemark
)
{
this
.
returnRemark
=
returnRemark
;
}
public
BigDecimal
getAppliedAmount
()
{
return
appliedAmount
;
}
public
void
setAppliedAmount
(
BigDecimal
appliedAmount
)
{
this
.
appliedAmount
=
appliedAmount
;
}
}
src/main/resources/static/app/srm/deliveryOrder/update/update.js
View file @
36592699
...
...
@@ -812,7 +812,7 @@ angular.module('IOne').controller('SteelCoilDlgCtrl', function ($scope, $uibModa
selectionRowHeaderWidth
:
35
,
enableSorting
:
true
,
enableColumnResizing
:
true
,
rowEditWaitInterval
:
-
1
,
rowEditWaitInterval
:
-
1
,
// 不加会发生saveRow错误 造成不能再次修改
enableCellEditOnFocus
:
true
,
columnDefs
:
[
{
name
:
'物料编码'
,
field
:
'doDtlProduct.product.productUid'
,
enableCellEdit
:
false
,
width
:
110
},
...
...
src/main/resources/static/app/srm/purchaseOrder/query/query.html
View file @
36592699
...
...
@@ -149,9 +149,7 @@
</div>
<div
class=
"modal-body"
>
<h5><strong>
采购单{{selectedPurchaseOrder.poMst.purchaseOrderUid}},请填写需要申请项次的申请数量:
</strong></h5>
<!--ui-grid-selection-->
<div
ui-grid=
"barcodeGridOptions"
ui-grid-resize-columns
ui-grid-edit
ui-grid-row-edit
ui-grid-cellNav
class=
"grid"
style=
"height: 300px"
>
<div
ui-grid=
"barcodeGridOptions"
ui-grid-edit
ui-grid-row-edit
ui-grid-cellNav
ui-grid-resize-columns
class=
"grid"
style=
"height: 300px"
>
</div>
</div>
<div
class=
"modal-footer"
>
...
...
src/main/resources/static/app/srm/purchaseOrder/query/query.js
View file @
36592699
...
...
@@ -282,22 +282,23 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
// 申请防伪码
$scope
.
barcodeGridOptions
=
{
enableRowSelection
:
false
,
enableSelectAll
:
true
,
multiSelect
:
false
,
selectionRowHeaderWidth
:
35
,
enableSorting
:
true
,
enableColumnResizing
:
true
,
rowEditWaitInterval
:
-
1
,
enableCellEditOnFocus
:
true
,
columnDefs
:
[
{
name
:
'项次'
,
field
:
'poDtlRow'
,
width
:
50
},
{
name
:
'物料编号'
,
field
:
'product.productUid'
,
width
:
100
},
{
name
:
'物料名称'
,
field
:
'product.name'
,
width
:
130
},
{
name
:
'物料规格'
,
field
:
'product.standard'
,
width
:
180
},
{
name
:
'申请数量'
,
field
:
'barcodeAmount'
,
width
:
80
,
enableCellEdit
:
true
,
type
:
'number'
,
cellClass
:
'editable-field'
},
{
name
:
'订单数量'
,
field
:
'orderAmount'
,
width
:
80
},
{
name
:
'回执数量'
,
field
:
'supplierReturnedAmount'
,
width
:
80
},
{
name
:
'已交数量'
,
field
:
'deliveredAmount'
,
width
:
80
},
{
name
:
'已关联数量'
,
field
:
'relationAmount'
,
width
:
80
}
{
name
:
'项次'
,
field
:
'poDtlRow'
,
width
:
50
,
enableCellEdit
:
false
},
{
name
:
'物料编号'
,
field
:
'product.productUid'
,
width
:
110
,
enableCellEdit
:
false
},
{
name
:
'物料名称'
,
field
:
'product.name'
,
width
:
140
,
enableCellEdit
:
false
},
{
name
:
'物料规格'
,
field
:
'product.standard'
,
width
:
190
,
enableCellEdit
:
false
},
{
name
:
'申请数量'
,
field
:
'barcodeAmount'
,
width
:
90
,
enableCellEdit
:
true
,
type
:
'number'
,
cellClass
:
'editable-field'
},
{
name
:
'可申请数量'
,
field
:
'canApplyAmount'
,
width
:
90
,
enableCellEdit
:
false
},
{
name
:
'已申请数量'
,
field
:
'appliedAmount'
,
width
:
90
,
enableCellEdit
:
false
},
{
name
:
'订单数量'
,
field
:
'orderAmount'
,
width
:
90
,
enableCellEdit
:
false
},
// {name: '回执数量', field: 'supplierReturnedAmount', width: 80, enableCellEdit: false},
// {name: '已交数量', field: 'deliveredAmount', width: 80, enableCellEdit: false},
// {name: '已关联数量', field: 'relationAmount', width: 80, enableCellEdit: false}
],
data
:
[]
};
...
...
@@ -310,6 +311,19 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
};
$scope
.
genBarcodeClick
=
function
()
{
// check
var
canApplyFlag
=
true
;
angular
.
forEach
(
$scope
.
barcodeGridOptions
.
data
,
function
(
item
)
{
if
(
item
.
barcodeAmount
>
item
.
canApplyAmount
)
{
UtilService
.
showWarn
(
"项次"
+
item
.
poDtlRow
+
"申请数量:"
+
item
.
barcodeAmount
+
"<br>"
+
"不能超过可申请数量"
);
canApplyFlag
=
false
;
}
});
if
(
!
canApplyFlag
)
{
return
;
}
// prepare input
var
barcodeInput
=
{};
var
barcodeDtlInput
=
[];
barcodeInput
.
factoryUid
=
$scope
.
selectedPurchaseOrder
.
factory
.
factoryUid
;
...
...
@@ -324,7 +338,8 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
}
});
barcodeInput
.
dtl
=
barcodeDtlInput
;
// call api & handle response
PoMstFileService
.
genBarcode
(
barcodeInput
).
then
(
function
(
response
)
{
if
(
response
.
data
)
{
...
...
@@ -353,6 +368,7 @@ angular.module('IOne').controller('PurchaseOrderQueryController', function ($sco
$scope
.
barcodeGridOptions
.
data
=
response
.
data
;
angular
.
forEach
(
$scope
.
barcodeGridOptions
.
data
,
function
(
item
)
{
item
.
barcodeAmount
=
0
;
item
.
canApplyAmount
=
item
.
orderAmount
-
item
.
appliedAmount
;
});
});
});
...
...
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