Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
xffruit
Commits
c70042bf
Commit
c70042bf
authored
May 23, 2017
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a44e79ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
185 additions
and
27 deletions
+185
-27
ICRHTTPController.h
XFFruit/Controllers/HTTPController/ICRHTTPController.h
+3
-0
ICRHTTPController.m
XFFruit/Controllers/HTTPController/ICRHTTPController.m
+32
-0
Info.plist
XFFruit/Info.plist
+2
-2
NewPurchaseViewController.m
...trollers/Purchase/Controllers/NewPurchaseViewController.m
+1
-0
PurchaseDetailViewController.m
...llers/Purchase/Controllers/PurchaseDetailViewController.m
+11
-11
ShopDetaileViewController.h
...trollers/PurchaseNotice/Views/ShopDetaileViewController.h
+8
-0
ShopDetaileViewController.m
...trollers/PurchaseNotice/Views/ShopDetaileViewController.m
+57
-4
NewTransportViewController.m
...ollers/Transport/Controllers/NewTransportViewController.m
+16
-0
TransportDetailViewController.m
...ers/Transport/Controllers/TransportDetailViewController.m
+8
-1
TransportPurchaseViewController.h
...s/Transport/Controllers/TransportPurchaseViewController.h
+3
-0
TransportPurchaseViewController.m
...s/Transport/Controllers/TransportPurchaseViewController.m
+38
-9
TransportPdtDetail.h
...uit/ViewControllers/Transport/Models/TransportPdtDetail.h
+6
-0
No files found.
XFFruit/Controllers/HTTPController/ICRHTTPController.h
View file @
c70042bf
...
...
@@ -378,6 +378,9 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
-
(
void
)
purchaseStockWithPurchaseUuid
:(
NSString
*
)
PurchaseUuid
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
-
(
void
)
purchaseStockWithPurchaseUuid
:(
NSString
*
)
PurchaseUuid
product
:(
NSString
*
)
productCode
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
/**
* 是否wms仓库
...
...
XFFruit/Controllers/HTTPController/ICRHTTPController.m
View file @
c70042bf
...
...
@@ -2454,6 +2454,38 @@ acceptTypeJson:YES
failure
:
failure
];
}
-
(
void
)
purchaseStockWithPurchaseUuid
:
(
NSString
*
)
PurchaseUuid
product
:
(
NSString
*
)
productCode
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
if
(
!
PurchaseUuid
)
{
if
(
fail
)
{
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
}
return
;
}
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
CLog
(
@"%@"
,
responseObject
);
if
(
succ
)
{
succ
(
responseObject
);
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
CLog
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@/mdata/inv/gets/%@?productCode=%@"
,
HTTP_REST_API_BASE_URL
,
PurchaseUuid
,
productCode
];
NSString
*
encodeUrlStr
=
[
url
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
[
self
GET
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
/**
* 是否wms仓库
...
...
XFFruit/Info.plist
View file @
c70042bf
...
...
@@ -15,11 +15,11 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.1
7
<
/string
>
<
string
>
1.2.1
8
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.2.1
7
<
/string
>
<
string
>
1.2.1
8
<
/string
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
...
...
XFFruit/ViewControllers/Purchase/Controllers/NewPurchaseViewController.m
View file @
c70042bf
...
...
@@ -249,6 +249,7 @@ typedef enum : NSUInteger {
NSInteger
indexTag
=
[[[
fication
userInfo
]
objectForKey
:
@"indexTag"
]
integerValue
];
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
if
(
billProduct
)
{
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
...
...
XFFruit/ViewControllers/Purchase/Controllers/PurchaseDetailViewController.m
View file @
c70042bf
...
...
@@ -214,23 +214,23 @@ typedef enum : NSUInteger {
//显示结束按钮
[
arr
addObject
:
@"结束"
];
}
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
]){
//作废权
//显示作废按钮
[
arr
addObject
:
@"作废"
];
}
//
if([self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]){//作废权
//
//显示作废按钮
//
[arr addObject:@"作废"];
//
}
[
self
createBtnWithArr
:
arr
];
if
(
arr
.
count
==
0
)
{
[
self
hiddenTwoBtn
];
}
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_FINISHED
]){
//完成
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
])
{
//有作废权的
//显示作废按钮
NSArray
*
arr
=
@[
@"作废"
];
[
self
createBtnWithArr
:
arr
];
}
else
{
//
if ([self checkIsPermission:PURCHASE_PERMISSIONS_ABORT]) {//有作废权的
//
//显示作废按钮
//
NSArray *arr = @[@"作废"];
//
[self createBtnWithArr:arr];
//
//
}else{
[
self
hiddenTwoBtn
];
}
//
}
}
else
if
([
self
.
bill
.
state
isEqualToString
:
PURCHASE_STATE_PROCESSFAIL
]){
//系统处理失败的
if
([
self
checkIsPermission
:
PURCHASE_PERMISSIONS_ABORT
])
{
//有作废权的
//显示作废按钮
...
...
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.h
View file @
c70042bf
...
...
@@ -9,10 +9,18 @@
#import "ICRBaseViewController.h"
#import "Survey.h"
#import "ShopDetail.h"
typedef
NS_ENUM
(
NSInteger
,
ShopDetailInterType
)
{
ShopDetailInterTypeTransport
=
1
,
ShopDetailInterTypePurchase
,
ShopDetailInterTypeTranfer
};
typedef
void
(
^
ChoseShopDetail
)(
ShopDetail
*
shopDetail
);
@interface
ShopDetaileViewController
:
ICRBaseViewController
@property
(
nonatomic
,
strong
)
Survey
*
survey
;
@property
(
nonatomic
,
strong
)
ShopDetail
*
shopDetail
;
@property
(
nonatomic
,
strong
)
ChoseShopDetail
choseShopDetail
;
@property
(
nonatomic
,
strong
)
NSString
*
navTitle
;
@property
(
assign
,
nonatomic
)
ShopDetailInterType
intertype
;
@end
XFFruit/ViewControllers/PurchaseNotice/Views/ShopDetaileViewController.m
View file @
c70042bf
...
...
@@ -16,6 +16,7 @@
#import "GXFSearchVendorViewController.h"
#import "GXFProductUnit.h"
#import "CalculateHelper.h"
#import "ProductStockModel.h"
#define LeftMargin 15
#define BtnHeight 44
#define TableHeight 46
...
...
@@ -174,11 +175,26 @@ typedef enum : NSUInteger {
break
;
case
CommitTag
:
{
if
([
self
informationComplete
])
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
self
.
choseShopDetail
(
shopDetail
);
//回调
[
self
PopViewControllerAnimated
:
YES
];
//只有发运单才需要差库存
if
(
self
.
intertype
==
ShopDetailInterTypeTransport
)
{
__weak
ShopDetaileViewController
*
weakSelf
=
self
;
[
self
stockValidWithBillNumber
:
self
.
shopDetail
.
sourceBillNumber
complete
:
^
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
weakSelf
.
choseShopDetail
(
shopDetail
);
//回调
[
weakSelf
PopViewControllerAnimated
:
YES
];
}];
}
else
{
ShopDetail
*
shopDetail
=
self
.
shopDetail
;
shopDetail
.
IsDeleted
=
NO
;
self
.
choseShopDetail
(
shopDetail
);
//回调
[
self
PopViewControllerAnimated
:
YES
];
}
}
}
break
;
...
...
@@ -186,6 +202,43 @@ typedef enum : NSUInteger {
break
;
}
}
-
(
void
)
stockValidWithBillNumber
:
(
NSString
*
)
billNumber
complete
:
(
void
(
^
)(
void
))
complete
{
__weak
ShopDetaileViewController
*
weakSelf
=
self
;
IBTLoadingView
*
hud
=
[
IBTLoadingView
showHUDAddedTo
:
self
.
view
animated
:
YES
];
[
HTTP
purchaseStockWithPurchaseUuid
:
billNumber
product
:
self
.
shopDetail
.
product_code
success
:^
(
id
succ
)
{
[
hud
hide
:
YES
];
[
IBTLoadingView
hideHUDForView
:
weakSelf
.
view
];
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNumber
];
ShowMessage
(
msg
);
return
;
}
for
(
NSDictionary
*
dict
in
succ
[
@"data"
])
{
ProductStockModel
*
model
=
[
ProductStockModel
new
];
[
model
setValuesForKeysWithDictionary
:
dict
];
if
([
self
.
shopDetail
.
product_code
isEqualToString
:
model
.
productCode
])
{
if
(
self
.
shopDetail
.
foundationQuantity
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNumber
];
ShowMessage
(
msg
);
return
;
}
}
}
complete
();
}
failure
:^
(
id
fail
)
{
[
hud
hide
:
YES
];
[
IBTLoadingView
showTips
:
fail
];
}];
}
-
(
void
)
alertView
:
(
UIAlertView
*
)
alertView
clickedButtonAtIndex
:
(
NSInteger
)
buttonIndex
{
if
(
buttonIndex
==
1
)
{
if
(
self
.
shopDetail
!=
nil
)
{
...
...
XFFruit/ViewControllers/Transport/Controllers/NewTransportViewController.m
View file @
c70042bf
...
...
@@ -41,6 +41,10 @@ typedef enum : NSUInteger {
* 用户选择的第一个商品的采购单
*/
@property
(
strong
,
nonatomic
)
PurchaseBill
*
firstBill
;
/**
* 缓存的选择的采购单数据
*/
@property
(
strong
,
nonatomic
)
NSMutableDictionary
*
dicProduct
;
@end
@implementation
NewTransportViewController
...
...
@@ -334,8 +338,12 @@ typedef enum : NSUInteger {
}
};
tpv
.
dicProduct
=
self
.
dicProduct
;
[
self
PushViewController
:
tpv
animated
:
YES
];
}
-
(
void
)
addTransportCost
:
(
NSNotification
*
)
fination
{
NewCostViewController
*
nvc
=
[
NewCostViewController
new
];
...
...
@@ -368,6 +376,7 @@ typedef enum : NSUInteger {
ShopDetaileViewController
*
svc
=
[[
ShopDetaileViewController
alloc
]
init
];
if
(
billProduct
)
{
svc
.
intertype
=
ShopDetailInterTypeTransport
;
svc
.
navTitle
=
@"编辑商品"
;
ShopDetail
*
shopDetail
=
[
self
coverShopDetail
:
billProduct
];
shopDetail
.
IsXiuGai
=
YES
;
...
...
@@ -467,6 +476,13 @@ typedef enum : NSUInteger {
}
}
-
(
NSMutableDictionary
*
)
dicProduct
{
if
(
!
_dicProduct
)
{
_dicProduct
=
[
NSMutableDictionary
dictionary
];
}
return
_dicProduct
;
}
/*
#pragma mark - Navigation
...
...
XFFruit/ViewControllers/Transport/Controllers/TransportDetailViewController.m
View file @
c70042bf
...
...
@@ -550,7 +550,7 @@ typedef enum : NSUInteger {
}
}
else
if
(
alertView
.
tag
==
ReceiveTag
){
if
(
buttonIndex
==
1
)
{
[
self
httpRecieve
];
[
self
httpRecieve
];
}
}
else
if
(
alertView
.
tag
==
SaveTag
){
if
(
buttonIndex
==
1
)
{
...
...
@@ -717,6 +717,13 @@ typedef enum : NSUInteger {
return
NO
;
}
for
(
TransferPdtDetail
*
pdt
in
_pvc
.
productArr
)
{
if
(
pdt
.
rctQty
==
nil
)
{
ShowMessage
(
@"有商品未填写收货数量!"
);
return
NO
;
}
}
return
YES
;
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.h
View file @
c70042bf
...
...
@@ -18,4 +18,7 @@ typedef void(^GetPurchaseProduct)(NSArray *products);
* 如果是发运单界面进入,则只显示已收货的。否的话则是转运单进入,则不限时
*/
@property
(
nonatomic
,
assign
)
BOOL
isTransportIn
;
@property
(
weak
,
nonatomic
)
NSMutableDictionary
*
dicProduct
;
@end
XFFruit/ViewControllers/Transport/Controllers/TransportPurchaseViewController.m
View file @
c70042bf
...
...
@@ -124,7 +124,25 @@ NSInteger purchaseStockCheckNumber = 0;
PurchaseBill
*
purchaseBill
=
[[
PurchaseBill
alloc
]
init
];
[
purchaseBill
setValuesForKeysWithDictionary
:
purchaseBillDict
];
purchaseBill
.
products
=
[
self
coverTransportDetProduct
:
purchaseBillDict
[
@"products"
]
purchaseBill
:
purchaseBill
];
[
self
.
dataArr
addObject
:
purchaseBill
];
//*******筛选掉已经选择过的商品******
//获取缓存的商品数据
NSMutableArray
*
arr
=
[
self
.
dicProduct
objectForKey
:
purchaseBill
.
billNumber
];
if
(
arr
.
count
==
purchaseBill
.
products
.
count
)
{
CLog
(
@"采购单中的商品已经全部选择过了,不显示这个采购单"
);
}
else
{
NSMutableArray
*
tempProduct
=
purchaseBill
.
products
.
mutableCopy
;
for
(
TransportPdtDetail
*
pdt
in
arr
)
{
for
(
TransportPdtDetail
*
onlinePdt
in
purchaseBill
.
products
)
{
if
([
pdt
.
productCode
isEqualToString
:
onlinePdt
.
productCode
])
{
[
tempProduct
removeObject
:
onlinePdt
];
}
}
}
purchaseBill
.
products
=
tempProduct
.
mutableCopy
;
[
self
.
dataArr
addObject
:
purchaseBill
];
}
}
NSDictionary
*
pageDict
=
data
[
@"data"
][
@"paging"
];
...
...
@@ -160,6 +178,8 @@ NSInteger purchaseStockCheckNumber = 0;
detail
.
transferBaseQty
=
arrDict
[
@"shippedBaseQty"
];
detail
.
transferQty
=
arrDict
[
@"shippedQty"
];
detail
.
note
=
arrDict
[
@"remark"
]
!=
[
NSNull
null
]
?
arrDict
[
@"remark"
]
:
@"无"
;
[
transArr
addObject
:
detail
];
}
return
transArr
;
...
...
@@ -284,15 +304,16 @@ NSInteger purchaseStockCheckNumber = 0;
-
(
void
)
sureClick
{
NSMutableDictionary
*
dicProduct
=
[
NSMutableDictionary
dictionary
];
//
NSMutableDictionary *dicProduct = [NSMutableDictionary dictionary];
//把选中的商品和采购单对应,根据单号存储对应的商品
for
(
PurchaseBill
*
bill
in
self
.
dataArr
)
{
for
(
TransportPdtDetail
*
detail
in
bill
.
products
)
{
detail
.
purchasebillnumber
=
bill
.
billNumber
;
if
([
self
.
indexArr
containsObject
:
detail
])
{
NSMutableArray
*
arrProduct
=
[
dicProduct
objectForKey
:
bill
.
billNumber
];
NSMutableArray
*
arrProduct
=
[
self
.
dicProduct
objectForKey
:
bill
.
billNumber
];
if
(
!
arrProduct
)
{
arrProduct
=
[
NSMutableArray
array
];
[
dicProduct
setObject
:
arrProduct
forKey
:
bill
.
billNumber
];
[
self
.
dicProduct
setObject
:
arrProduct
forKey
:
bill
.
billNumber
];
}
[
arrProduct
addObject
:
detail
];
...
...
@@ -300,14 +321,14 @@ NSInteger purchaseStockCheckNumber = 0;
}
}
NSArray
*
array
=
dicProduct
.
allKeys
;
NSArray
*
array
=
self
.
dicProduct
.
allKeys
;
if
(
array
.
count
==
0
)
{
ShowMessage
(
@"请选择商品!"
);
return
;
}
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
//判断数量问题
[
self
stockValidWithDic
:
dicProduct
billNumbers
:
array
complete
:^
{
[
self
stockValidWithDic
:
self
.
dicProduct
billNumbers
:
array
complete
:^
{
[
weakSelf
PopViewControllerAnimated
:
YES
];
if
(
weakSelf
.
indexArr
.
count
>
0
)
{
NSMutableArray
*
arr
=
[
NSMutableArray
array
];
...
...
@@ -345,7 +366,8 @@ NSInteger purchaseStockCheckNumber = 0;
__weak
TransportPurchaseViewController
*
weakSelf
=
self
;
[
HTTP
purchaseStockWithPurchaseUuid
:
billNum
success
:
^
(
id
succ
)
{
if
(
!
[
succ
[
@"data"
]
isKindOfClass
:[
NSArray
class
]])
{
ShowMessage
(
@"库存不足!"
);
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"该批次<%@>在总部系统的库存不足!"
,
billNum
];
ShowMessage
(
msg
);
return
;
}
...
...
@@ -355,10 +377,10 @@ NSInteger purchaseStockCheckNumber = 0;
for
(
TransportPdtDetail
*
detail
in
arrProducts
)
{
if
([
detail
.
productCode
isEqualToString
:
model
.
productCode
])
{
if
(
detail
.
q
ty
.
floatValue
>
model
.
qty
.
floatValue
)
{
if
(
detail
.
baseQ
ty
.
floatValue
>
model
.
qty
.
floatValue
)
{
CLog
(
@"库存不足"
);
purchaseStockCheckNumber
=
0
;
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"
%@库存不足!"
,
detail
.
productName
];
NSString
*
msg
=
[
NSString
stringWithFormat
:
@"
该批次<%@>的商品%@在总部系统的库存不足!"
,
billNum
,
detail
.
productName
];
ShowMessage
(
msg
);
return
;
}
...
...
@@ -379,6 +401,13 @@ NSInteger purchaseStockCheckNumber = 0;
}];
}
-
(
NSMutableDictionary
*
)
dicProduct
{
if
(
!
_dicProduct
)
{
_dicProduct
=
[
NSMutableDictionary
dictionary
];
}
return
_dicProduct
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
XFFruit/ViewControllers/Transport/Models/TransportPdtDetail.h
View file @
c70042bf
...
...
@@ -34,6 +34,12 @@
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedQty
;
//收货数量
@property
(
strong
,
nonatomic
)
NSNumber
*
receivedBaseQty
;
//收货基础数量
///**
// * 自定义的采购单的单号
// */
//@property (nonatomic,strong)NSString *z_purchaseBillNumber;
@end
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