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
404500c5
Commit
404500c5
authored
Sep 05, 2015
by
freecui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加工单接口bug修改
parent
cad79801
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
148 additions
and
99 deletions
+148
-99
NSDate+FormatterAdditions.m
XFFruit/General/Categories/NSDate+FormatterAdditions.m
+1
-0
IBTModel.h
XFFruit/Utilities/IBTModels/IBTModel.h
+1
-0
IBTModel.m
XFFruit/Utilities/IBTModels/IBTModel.m
+42
-0
GXFNewProcessViewController.m
...rollers/Process/Controllers/GXFNewProcessViewController.m
+104
-99
No files found.
XFFruit/General/Categories/NSDate+FormatterAdditions.m
View file @
404500c5
...
...
@@ -290,6 +290,7 @@
}
-
(
NSString
*
)
httpParameterString
{
NSString
*
str
=
[
self
stringWithFormatter
:
@"%Y-%m-%d %H:%M:%S"
];
return
[
self
stringWithFormatter
:
@"%Y-%m-%d %H:%M:%S"
];
}
-
(
NSString
*
)
coverStringFromString
{
...
...
XFFruit/Utilities/IBTModels/IBTModel.h
View file @
404500c5
...
...
@@ -20,6 +20,7 @@
// Fuctions
-
(
NSDictionary
*
)
dictForCommit
;
-
(
NSMutableDictionary
*
)
mutableDictDateToStringForCommit
;
//把属性为日期类型的转化为string
-
(
NSDictionary
*
)
dictForLocalSave
;
-
(
void
)
praseFromJsonDict
:(
NSDictionary
*
)
dict
;
-
(
void
)
praseFromLocalDict
:(
NSDictionary
*
)
dict
;
...
...
XFFruit/Utilities/IBTModels/IBTModel.m
View file @
404500c5
...
...
@@ -418,6 +418,48 @@
return
mDict
;
}
-
(
NSMutableDictionary
*
)
mutableDictDateToStringForCommit
{
unsigned
int
count
;
objc_property_t
*
properties
=
class_copyPropertyList
([
self
class
],
&
count
);
if
(
count
==
0
)
{
free
(
properties
);
return
nil
;
}
NSMutableDictionary
*
mDict
=
[
NSMutableDictionary
dictionary
];
NSDictionary
*
dictSpKeyDict
=
[[
self
class
]
specialKeysAndReplaceKeys
];
NSArray
*
arrSpecialKeys
=
[
dictSpKeyDict
allKeys
];
NSArray
*
arrCustomKeys
=
[[
self
class
]
customAcitonKeys
];
NSArray
*
arrLocalKeys
=
[[
self
class
]
localKeys
];
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
objc_property_t
property
=
properties
[
i
];
NSString
*
key
=
[
NSString
stringWithUTF8String
:
property_getName
(
property
)];
id
value
=
[
self
valueForKey
:
key
];
if
([
value
isKindOfClass
:[
NSDate
class
]])
{
value
=
[
value
httpParameterString
];
}
if
(
value
)
{
if
([
arrCustomKeys
containsObject
:
key
]
||
[
arrLocalKeys
containsObject
:
key
])
{
continue
;
}
else
if
([
arrSpecialKeys
containsObject
:
key
])
{
[
mDict
addEntriesFromDictionary
:@{
dictSpKeyDict
[
key
]
:
value
}];
}
else
{
[
mDict
addEntriesFromDictionary
:@{
key
:
value
}];
}
}
}
free
(
properties
);
return
mDict
;
}
-
(
NSDictionary
*
)
dictForLocalSave
{
unsigned
int
count
;
objc_property_t
*
properties
=
class_copyPropertyList
([
self
class
],
&
count
);
...
...
XFFruit/ViewControllers/Process/Controllers/GXFNewProcessViewController.m
View file @
404500c5
...
...
@@ -58,8 +58,8 @@ typedef NS_ENUM(NSInteger, cellRow) {
@property
(
nonatomic
,
assign
)
BOOL
d_isProduct
;
@property
(
nonatomic
,
strong
)
NSArray
*
d_meteilHeaderArr
;
@property
(
nonatomic
,
strong
)
NSArray
*
d_productHeaderArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
d_meteilArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
d_productArr
;
//
@property (nonatomic, strong) NSMutableArray *d_meteilArr;
//
@property (nonatomic, strong) NSMutableArray *d_productArr;
@property
(
nonatomic
,
assign
)
NSInteger
d_editOrDelete
;
...
...
@@ -86,29 +86,29 @@ typedef NS_ENUM(NSInteger, cellRow) {
}
-
(
void
)
addNewMaterail
:
(
NSNotification
*
)
aNotification
{
GXFProcessMaterial
*
material
=
aNotification
.
object
;
if
(
_d_m
eteil
Arr
)
{
[
_d_m
eteil
Arr
addObject
:
material
];
if
(
_d_m
aterialMu
Arr
)
{
[
_d_m
aterialMu
Arr
addObject
:
material
];
[
self
p_refreshData
];
}
}
-
(
void
)
addNewProduct
:
(
NSNotification
*
)
aNotification
{
GXFProcessProduct
*
product
=
aNotification
.
object
;
if
(
_d_productArr
)
{
[
_d_productArr
addObject
:
product
];
if
(
_d_product
Mu
Arr
)
{
[
_d_product
Mu
Arr
addObject
:
product
];
[
self
p_refreshData
];
}
}
-
(
void
)
editProduct
:
(
NSNotification
*
)
aNotification
{
GXFProcessProduct
*
product
=
aNotification
.
object
;
if
(
_d_productArr
)
{
[
_d_productArr
replaceObjectAtIndex
:
_d_editOrDelete
withObject
:
product
];
//待做:优化为刷新这一条
if
(
_d_product
Mu
Arr
)
{
[
_d_product
Mu
Arr
replaceObjectAtIndex
:
_d_editOrDelete
withObject
:
product
];
//待做:优化为刷新这一条
[
self
p_refreshData
];
}
}
-
(
void
)
deleteProduct
:
(
NSNotification
*
)
aNotification
{
GXFProcessProduct
*
product
=
aNotification
.
object
;
if
(
_d_productArr
)
{
[
_d_productArr
removeObject
:
product
];
////待做:优化为刷新这一条
if
(
_d_product
Mu
Arr
)
{
[
_d_product
Mu
Arr
removeObject
:
product
];
////待做:优化为刷新这一条
[
self
p_refreshData
];
}
}
...
...
@@ -184,31 +184,31 @@ typedef NS_ENUM(NSInteger, cellRow) {
_selectRowArr
=
[[
NSMutableArray
alloc
]
init
];
self
.
d_processBill
=
[[
GXFProcessBill
alloc
]
init
];
if
(
!
self
.
d_m
eteil
Arr
)
{
self
.
d_m
eteil
Arr
=
[
NSMutableArray
array
];
if
(
!
self
.
d_m
aterialMu
Arr
)
{
self
.
d_m
aterialMu
Arr
=
[
NSMutableArray
array
];
}
GXFProcessMaterial
*
processM
=
[[
GXFProcessMaterial
alloc
]
init
];
processM
.
uuid
=
@"00"
;
processM
.
productName
=
@"Material"
;
processM
.
productUuid
=
@"01"
;
processM
.
baseQty
=
@
(
10
);
processM
.
instockDate
=
[
NSDate
date
];
[
self
.
d_meteil
Arr
addObject
:
processM
];
[
self
.
d_meteil
Arr
addObject
:
processM
];
//
GXFProcessMaterial *processM = [[GXFProcessMaterial alloc]init];
//
processM.uuid = @"00";
//
processM.productName = @"Material";
//
processM.productUuid = @"01";
//
processM.baseQty = @(10);
//
processM.instockDate = [NSDate date];
// [self.d_materialMu
Arr addObject:processM];
// [self.d_materialMu
Arr addObject:processM];
if
(
!
self
.
d_productArr
)
{
self
.
d_productArr
=
[
NSMutableArray
array
];
if
(
!
self
.
d_product
Mu
Arr
)
{
self
.
d_product
Mu
Arr
=
[
NSMutableArray
array
];
}
GXFProcessProduct
*
processP
=
[[
GXFProcessProduct
alloc
]
init
];
processP
.
uuid
=
@"11"
;
processP
.
productName
=
@"product"
;
processP
.
productUuid
=
@"12"
;
processP
.
baseQty
=
@
(
10
);
processP
.
outstockDate
=
[
NSDate
date
];
[
self
.
d_product
Arr
addObject
:
processP
];
NSDictionary
*
dict
=
[
processP
dictForCommit
];
//
GXFProcessProduct *processP = [[GXFProcessProduct alloc]init];
//
processP.uuid = @"11";
//
processP.productName = @"product";
//
processP.productUuid = @"12";
//
processP.baseQty = @(10);
//
processP.outstockDate = [NSDate date];
// [self.d_productMu
Arr addObject:processP];
}
-
(
void
)
initSubViews
{
self
.
view
.
backgroundColor
=
XXFBgColor
;
...
...
@@ -231,9 +231,9 @@ typedef NS_ENUM(NSInteger, cellRow) {
return
_d_arrLeftTableV
.
count
;
}
else
{
if
(
_d_isProduct
)
{
return
2
+
_d_productArr
.
count
;
return
2
+
_d_product
Mu
Arr
.
count
;
}
return
2
+
_d_m
eteil
Arr
.
count
;
return
2
+
_d_m
aterialMu
Arr
.
count
;
}
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
...
...
@@ -394,10 +394,10 @@ typedef NS_ENUM(NSInteger, cellRow) {
if
(
cell
==
nil
)
{
if
(
_d_isProduct
)
{
GXFProcessProduct
*
processP
=
(
GXFProcessProduct
*
)
_d_productArr
[
indexPath
.
row
-
2
];
GXFProcessProduct
*
processP
=
(
GXFProcessProduct
*
)
_d_product
Mu
Arr
[
indexPath
.
row
-
2
];
cell
=
[[
GXFProcessProductTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
processProduct
:
processP
];
}
else
{
GXFProcessMaterial
*
pm
=
(
GXFProcessMaterial
*
)
_d_m
eteil
Arr
[
indexPath
.
row
-
2
];
GXFProcessMaterial
*
pm
=
(
GXFProcessMaterial
*
)
_d_m
aterialMu
Arr
[
indexPath
.
row
-
2
];
cell
=
[[
GXFProcessMaterialTableViewCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
processMaterial
:
pm
];
}
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
...
...
@@ -527,7 +527,7 @@ typedef NS_ENUM(NSInteger, cellRow) {
-
(
void
)
editClick
:
(
UIButton
*
)
btn
{
if
(
_d_isProduct
)
{
self
.
d_editOrDelete
=
btn
.
tag
-
2
;
GXFProcessProduct
*
product
=
_d_productArr
[
btn
.
tag
-
2
];
GXFProcessProduct
*
product
=
_d_product
Mu
Arr
[
btn
.
tag
-
2
];
GXFPopNewProductViewController
*
productVC
=
[[
GXFPopNewProductViewController
alloc
]
initWithProcessProduct
:
product
isEdit
:
YES
];
[
self
PushViewController
:
productVC
animated
:
NO
];
}
else
{
...
...
@@ -558,19 +558,23 @@ typedef NS_ENUM(NSInteger, cellRow) {
#pragma GXFBottomViewDelegate
-
(
void
)
bottomViewleftButtonClicked
:
(
UIButton
*
)
leftBtn
{
}
-
(
void
)
bottomViewRightButtonClicked
:
(
UIButton
*
)
rightBtn
{
CLog
(
@"ffff"
);
//[IBTCommon checkString:_d_processBill.title]
if
([
IBTCommon
checkStringIsNilOrSpance
:
_d_processBill
.
title
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示信息"
message
:
@"标题不能为空"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
return
;
}
if
([
IBTCommon
checkStringIsNilOrSpance
:
_d_processBill
.
vendor_name
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示信息"
message
:
@"请选择供应商"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
return
;
}
//
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.title]) {
//
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"标题不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//
[alert show];
//
return;
//
}
//
if ([IBTCommon checkStringIsNilOrSpance:_d_processBill.vendor_name]) {
//
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"提示信息" message:@"请选择供应商" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
//
[alert show];
//
return;
//
}
if
([
IBTCommon
checkStringIsNilOrSpance
:
_d_processBill
.
warehouse_name
])
{
UIAlertView
*
alert
=
[[
UIAlertView
alloc
]
initWithTitle
:
@"提示信息"
message
:
@"请选择加工工厂"
delegate
:
nil
cancelButtonTitle
:
@"确定"
otherButtonTitles
:
nil
,
nil
];
[
alert
show
];
...
...
@@ -580,29 +584,29 @@ typedef NS_ENUM(NSInteger, cellRow) {
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
// if (data) {
// NSInteger success = [data[@"success"] integerValue];
// NSString *message = data[@"message"];
// if (success == 1) {
// //成功
// if ([state isEqualToString:@"initial"]) {//保存成功
// [IBTLoadingView showTips:@"操作成功"];
// }else{//提交成功
// SurveyViewController *svc = [SurveyViewController new];
// [self PushViewController:svc animated:YES];
// }
// }else{
// [IBTLoadingView showTips:message];
// }
// }
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
//保存
void
(
^
succ
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
// if (data) {
// NSInteger success = [data[@"success"] integerValue];
// NSString *message = data[@"message"];
// if (success == 1) {
// //成功
// if ([state isEqualToString:@"initial"]) {//保存成功
// [IBTLoadingView showTips:@"操作成功"];
// }else{//提交成功
// SurveyViewController *svc = [SurveyViewController new];
// [self PushViewController:svc animated:YES];
// }
// }else{
// [IBTLoadingView showTips:message];
// }
// }
};
void
(
^
fail
)(
id
)
=
^
(
id
data
)
{
[
IBTLoadingView
hideHUDWithText
:
nil
];
[
IBTLoadingView
showTips
:
data
];
};
// if(self.survey.uuid.length > 0 && uuidObject == [NSNull null]){
// uuidObject = self.survey.uuid;
...
...
@@ -614,42 +618,43 @@ typedef NS_ENUM(NSInteger, cellRow) {
// version = self.survey.version;
// }
// NSDictionary *material = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
// NSDictionary *product = @{@"uuid":@"",@"productUuid":@"",@"productCode":@"",@"productName":@"",@"instockDate":@"",@"place":@"",@"quality":@"",@"baseQty":@"",@"basePrice":@"",@"total":@"",@"remark":@"",};
NSMutableArray
*
productMuArr
=
[
NSMutableArray
array
];
for
(
int
count
=
0
;
count
<
_d_productArr
.
count
;
count
++
)
{
GXFProcessProduct
*
product
=
(
GXFProcessProduct
*
)
_d_productArr
[
count
];
[
productMuArr
addObject
:[
product
dictForCommit
]];
for
(
int
count
=
0
;
count
<
_d_productMuArr
.
count
;
count
++
)
{
GXFProcessProduct
*
product
=
(
GXFProcessProduct
*
)
_d_productMuArr
[
count
];
NSMutableDictionary
*
dic
=
[
product
mutableDictDateToStringForCommit
];
// NSDictionary *materialdict = @{@"uuid":@"11",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"unit":@"",@"qpc":@"kk",@"qpcStr":@"ll",@"quality":@"9",@"baseQty":@"8",@"remark":@""};
[
productMuArr
addObject
:
dic
];
//productdict];
}
NSMutableArray
*
materialMuArr
=
[
NSMutableArray
array
];
for
(
int
count
=
0
;
count
<
_d_
product
Arr
.
count
;
count
++
)
{
for
(
int
count
=
0
;
count
<
_d_
materialMu
Arr
.
count
;
count
++
)
{
GXFProcessMaterial
*
material
=
(
GXFProcessMaterial
*
)
_d_materialMuArr
[
count
];
[
materialMuArr
addObject
:[
material
dictForCommit
]];
NSMutableDictionary
*
dic
=
[
material
mutableDictDateToStringForCommit
];
// NSDictionary *productdict = @{@"uuid":@"",@"productUuid":@"402880e64e287fe2014e28895b8a0032",@"productCode":@"农夫山泉",@"productName":@"dd",@"outstockDate":@"2015-09-05 13:36:16 +0000",@"place":@"",@"quality":@"",@"baseQty":@"1",@"basePrice":@"2",@"total":@"2",@"remark":@""};
[
materialMuArr
addObject
:
dic
];
//materialdict];
}
NSDictionary
*
dict
=
@{
@"uuid"
:
@""
,
@"version"
:
@
(
0
),
@"billnumber"
:
@""
,
@"title"
:
@"title"
,
//[IBTCommon checkString:self.titleStr],
@"vendor_uuid"
:
_d_processBill
.
vendor_uuid
,
@"vendor_code"
:
_d_processBill
.
vendor_code
,
@"vendor_name"
:
_d_processBill
.
vendor_name
,
@"warehouse_uuid"
:
_d_processBill
.
warehouse_uuid
,
@"warehouse_code"
:
_d_processBill
.
warehouse_code
,
@"warehouse_name"
:
_d_processBill
.
warehouse_name
,
@"contact"
:
[
IBTCommon
checkString
:
_d_processBill
.
contact
],
@"contactPhone"
:
[
IBTCommon
checkString
:
_d_processBill
.
contact
],
@"total"
:
_d_processBill
.
total
,
@"remark"
:
[
IBTCommon
checkString
:
_d_processBill
.
remark
],
@"materials"
:
materialMuArr
,
@"products"
:
productMuArr
};
//[IBTLoadingView showProgressLabel:msg];
[[
ICRHTTPController
sharedController
]
saveSurveyWithAuthenticode
:
dict
success
:
succ
failure
:
fail
];
}
-
(
void
)
bottomViewRightButtonClicked
:
(
UIButton
*
)
rightBtn
{
NSDictionary
*
dict
=
@{
@"uuid"
:
@""
,
@"version"
:
@
(
0
),
@"billnumber"
:
@""
,
@"title"
:
@"title"
,
//[IBTCommon checkString:self.titleStr],
@"vendor_uuid"
:
@"000"
,
//_d_processBill.vendor_uuid,
@"vendor_code"
:
@"111"
,
//_d_processBill.vendor_code,
@"vendor_name"
:
@"ff"
,
//_d_processBill.vendor_name,
@"warehouse_uuid"
:
_d_processBill
.
warehouse_uuid
,
@"warehouse_code"
:
_d_processBill
.
warehouse_code
,
@"warehouse_name"
:
_d_processBill
.
warehouse_name
,
@"contact"
:
[
IBTCommon
checkString
:
_d_processBill
.
contact
],
@"contactPhone"
:
[
IBTCommon
checkString
:
_d_processBill
.
contactPhone
],
@"total"
:
_d_processBill
.
total
,
@"remark"
:
[
IBTCommon
checkString
:
_d_processBill
.
remark
],
@"materials"
:
materialMuArr
,
@"products"
:
productMuArr
};
//[IBTLoadingView showProgressLabel:msg];
[[
ICRHTTPController
sharedController
]
saveSurveyWithAuthenticode
:
dict
success
:
succ
failure
:
fail
];
}
...
...
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