| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- //
- // OtherOutStorageListDetailModel.m
- // IBOSSmini
- //
- // Created by guan hong hou on 2018/4/27.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "OtherOutStorageListDetailModel.h"
- @implementation OtherOutStorageListDetailModel
- -(void)parseDic:(NSDictionary *)dic{
- if(dic!=nil){
- _onlyCode=[dic objectForKey:@"OnlyCode"];
- _goodsCode=[dic objectForKey:@"Code"];
- _brandName=[dic objectForKey:@"BrandName"];
- _kindName=[dic objectForKey:@"KindName"];
- _varietyName=[dic objectForKey:@"VarietyName"];
- _seriesName=[dic objectForKey:@"SeriesName"];
- _specification=[dic objectForKey:@"Specification"];
- _gradeName=[dic objectForKey:@"GradeName"];
- _colorNumber=[dic objectForKey:@"ColorNumber"];
- _warehouseName=[dic objectForKey:@"WarehouseName"];
- _positionNumber=[dic objectForKey:@"PositionNumber"];
- _outQuantity=[NSString stringWithFormat:@"%.6f",[[dic objectForKey:@"DeliveryQuantity"]doubleValue]];
-
- _accountDate=[DateFormat dateFormatSplit:[dic objectForKey:@"AccountDate"]];
- _package=[NSString stringWithFormat:@"%d",[[dic objectForKey:@"Package"]integerValue]];
-
- _unitName=[dic objectForKey:@"UnitName"];
- _circulateTypeName=[dic objectForKey:@"GoodsCirculateTypeName"];
- _weight=[NSString stringWithFormat:@"%.6f",[[dic objectForKey:@"Weight"]doubleValue]];
- _acreage=[NSString stringWithFormat:@"%.6f",[[dic objectForKey:@"Acreage"]doubleValue]];
- _volume=[NSString stringWithFormat:@"%.6f",[[dic objectForKey:@"Volume"]doubleValue]];
- _goodsName=[dic objectForKey:@"GoodsName"];
-
- _expandAtrribute=[dic objectForKey:@"ExpandAttribute"];
- _expandAtrribute2=[dic objectForKey:@"ExpandAttribute2"];
- _goodsRemarks=[dic objectForKey:@"GoodsRemarks"];
- _remarks=[dic objectForKey:@"Remarks"];
- _circulateType=[[dic objectForKey:@"CirculateType"]integerValue];
-
- double M2Value;
- if(_acreage!=nil&&_acreage.length>0){
- if(_circulateType==1){
- M2Value=[_acreage doubleValue]*[_outQuantity doubleValue];
- _M2=[NSString stringWithFormat:@"%.6f",M2Value];
- }
- else{
- _M2=_outQuantity;
- }
- }
- if(_circulateType==1){
- if([_package integerValue]>0){
- if([_outQuantity doubleValue]>=0){
- _box = [NSString stringWithFormat:@"%ld",(long)floor([_outQuantity doubleValue]/[_package integerValue])];
-
- }
- else{
- _box=[NSString stringWithFormat:@"%ld",(long)ceil([_outQuantity doubleValue]/[_package integerValue])];
- }
-
- _piece = [NSString stringWithFormat:@"%d",(int)[_outQuantity doubleValue]%[_package integerValue]];
-
- }
- }
- else if(_circulateType==2){
- if([_package integerValue]>0&&[_acreage doubleValue]>0){
- long pieces=0;
- if([_outQuantity doubleValue]>=0){
- pieces=ceil([_outQuantity doubleValue]/[_acreage doubleValue]);
- _box=[NSString stringWithFormat:@"%ld",(long)floor(pieces/[_package integerValue])];
- }
- else{
- pieces=floor([_outQuantity doubleValue]/[_acreage doubleValue]);
- _box=[NSString stringWithFormat:@"%ld",(long)ceil(pieces/[_package integerValue])];
-
- }
- _piece=[NSString stringWithFormat:@"%d",(int)pieces%[_package integerValue]];
- }
-
- }
- else{
- _box=@"0";
- _piece=@"1";
-
- }
-
-
- }
- }
- @end
|