Эх сурвалжийг харах

After the check box is modified, the color block will cover the bottom plate of the contract -- 修改check box后,色块会覆盖合同底版 (resolve: #14738)
Debug and modify PDF creation module -- 调试和修改PDF创建模块(resolve: #14729)

Ray Zhang 4 жил өмнө
parent
commit
62e4cb6060

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 287 - 283
Ants Contract/Granite Expo eSign/2021 GECI - Home Improvement Contract.json


BIN
Ants Contract/Granite Expo eSign/GECI - Home Improvement Contract - Fong Huang.pdf


BIN
Ants Contract/Granite Expo eSign/GECI - Home Improvement Contract - Jim Xu.pdf


BIN
Ants Contract/Granite Expo eSign/GECI - Home Improvement Contract - Wilson Ma.pdf


+ 4 - 4
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -19,7 +19,7 @@
 		3C6B6291272149D400E74CF9 /* GECI - Home Improvement Contract - Wilson Ma.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C6B628D272149D400E74CF9 /* GECI - Home Improvement Contract - Wilson Ma.pdf */; };
 		3C6B6292272149D400E74CF9 /* GECI - Home Improvement Contract - Jim Xu.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C6B628E272149D400E74CF9 /* GECI - Home Improvement Contract - Jim Xu.pdf */; };
 		3C6B6293272149D400E74CF9 /* GECI - Home Improvement Contract - Tan.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C6B628F272149D400E74CF9 /* GECI - Home Improvement Contract - Tan.pdf */; };
-		3C6B62A9272BEB7B00E74CF9 /* 2021 GECI - Home Improvement Contract.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C6B62A8272BEB7B00E74CF9 /* 2021 GECI - Home Improvement Contract.json */; };
+		3C6B62B5272FBCD600E74CF9 /* 2021 GECI - Home Improvement Contract.json in Resources */ = {isa = PBXBuildFile; fileRef = 3C6B62B4272FBCD600E74CF9 /* 2021 GECI - Home Improvement Contract.json */; };
 		3CBB92F2248A26EB0099E429 /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CBB92F1248A26EB0099E429 /* NetworkUtils.m */; };
 		3CC7E73423BEDE9700BE5561 /* RAPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7E73323BEDE9700BE5561 /* RAPDFViewController.m */; };
 		3CC7E73623BEDEA000BE5561 /* wkweb.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3CC7E73523BEDEA000BE5561 /* wkweb.storyboard */; };
@@ -119,7 +119,7 @@
 		3C6B628D272149D400E74CF9 /* GECI - Home Improvement Contract - Wilson Ma.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - Wilson Ma.pdf"; sourceTree = "<group>"; };
 		3C6B628E272149D400E74CF9 /* GECI - Home Improvement Contract - Jim Xu.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - Jim Xu.pdf"; sourceTree = "<group>"; };
 		3C6B628F272149D400E74CF9 /* GECI - Home Improvement Contract - Tan.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - Tan.pdf"; sourceTree = "<group>"; };
-		3C6B62A8272BEB7B00E74CF9 /* 2021 GECI - Home Improvement Contract.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "2021 GECI - Home Improvement Contract.json"; sourceTree = "<group>"; };
+		3C6B62B4272FBCD600E74CF9 /* 2021 GECI - Home Improvement Contract.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "2021 GECI - Home Improvement Contract.json"; sourceTree = "<group>"; };
 		3CBB92F0248A26EB0099E429 /* NetworkUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkUtils.h; path = ../../../common/NetworkUtils.h; sourceTree = "<group>"; };
 		3CBB92F1248A26EB0099E429 /* NetworkUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetworkUtils.m; path = ../../../common/NetworkUtils.m; sourceTree = "<group>"; };
 		3CC7E73223BEDE9700BE5561 /* RAPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAPDFViewController.h; path = "../../../common/WK PDF+Web/RAPDFViewController.h"; sourceTree = "<group>"; };
@@ -556,7 +556,7 @@
 		7128C3261E1251DE00FF635B /* pdf resource */ = {
 			isa = PBXGroup;
 			children = (
-				3C6B62A8272BEB7B00E74CF9 /* 2021 GECI - Home Improvement Contract.json */,
+				3C6B62B4272FBCD600E74CF9 /* 2021 GECI - Home Improvement Contract.json */,
 				3C6B628C272149D400E74CF9 /* GECI - Home Improvement Contract - Fong Huang.pdf */,
 				3C6B628E272149D400E74CF9 /* GECI - Home Improvement Contract - Jim Xu.pdf */,
 				3C6B628F272149D400E74CF9 /* GECI - Home Improvement Contract - Tan.pdf */,
@@ -653,13 +653,13 @@
 			buildActionMask = 2147483647;
 			files = (
 				42DDB87E1F91E949002CCE22 /* template_example.json in Resources */,
+				3C6B62B5272FBCD600E74CF9 /* 2021 GECI - Home Improvement Contract.json in Resources */,
 				3CC7E7B723C5CB7800BE5561 /* Launch Screen.storyboard in Resources */,
 				42DDB87C1F91E367002CCE22 /* template_type.json in Resources */,
 				425A00F41F8F196900286D6F /* attribute_template.json in Resources */,
 				7128C24B1E124F4500FF635B /* Assets.xcassets in Resources */,
 				7128C26F1E124FF200FF635B /* Main.storyboard in Resources */,
 				3CC7E73623BEDEA000BE5561 /* wkweb.storyboard in Resources */,
-				3C6B62A9272BEB7B00E74CF9 /* 2021 GECI - Home Improvement Contract.json in Resources */,
 				3C69618E23C819F70075172A /* 2020 GECI - Home Improvement Contract.pdf in Resources */,
 				42DDB87A1F91DCE8002CCE22 /* ControlTemplateCell.xib in Resources */,
 				7128C27D1E12500B00FF635B /* signature.storyboard in Resources */,

+ 18 - 18
Ants Contract/Granite Expo eSign/Granite Expo eSign/config.h

@@ -17,8 +17,8 @@
 
 //#define ENCRYPT_OFF
 # ifdef DEBUG
-    #define NO_SAVE_VERIFY false
-//    #define test_server
+    #define NO_SAVE_VERIFY true
+    #define test_server
     #define DEBUG_PDFSIG true
 # else
     #define NO_SAVE_VERIFY false
@@ -33,31 +33,31 @@
 
 #ifdef test_server
 //    #define  URL_ERR_LOG  @""
-//    #define  URL_UPDATE_AUTH  @"http://192.168.50.15:8888/index.php"
-//    #define  URL_UPLOAD_PDF  @"http://192.168.50.15:8888/index.php"
+//    #define  URL_UPDATE_AUTH  @"http://10.0.0.123:8888/index.php"
+//    #define  URL_UPLOAD_PDF  @"http://10.0.0.123:8888/index.php"
 //    #define  URL_LOGOUT  @"http://192.168.0.177/esign/admin.php"
 //    #define  URL_NEW_DOCUMENT  @"http://192.168.0.177/esign/admin.php"
 //    #define  URL_REQUEST_DOC  @"http://192.168.0.177/esign/admin.php"
 
 
     #define  URL_ERR_LOG  @""
-    #define  URL_UPDATE_AUTH  @"http://192.168.50.15:8888/admin_v2.php"
-    #define  URL_UPLOAD_PDF  @"http://192.168.50.15:8888/admin_v2.php"
-    #define  URL_LOGOUT  @"http://192.168.50.15:8888/admin_v2.php"
-    #define  URL_NEW_DOCUMENT  @"http://192.168.50.15:8888/admin_v2.php"
-    #define  URL_UPDATE_NOTES  @"http://192.168.50.15:8888/admin_v2.php"
-    #define  URL_REQUEST_DOC  @"http://192.168.50.15:8888/admin_v2.php"
-    #define URL_HEART_BEAT @"http://192.168.50.15:8888/admin_v2.php"
+    #define  URL_UPDATE_AUTH  @"http://10.0.0.123:8888/admin_v3.php"
+    #define  URL_UPLOAD_PDF  @"http://10.0.0.123:8888/admin_v3.php"
+    #define  URL_LOGOUT  @"http://10.0.0.123:8888/admin_v3.php"
+    #define  URL_NEW_DOCUMENT  @"http://10.0.0.123:8888/admin_v3.php"
+    #define  URL_UPDATE_NOTES  @"http://10.0.0.123:8888/admin_v3.php"
+    #define  URL_REQUEST_DOC  @"http://10.0.0.123:8888/admin_v3.php"
+    #define URL_HEART_BEAT @"http://10.0.0.123:8888/admin_v3.php"
     #define URL_PRIVACY @"https://ge.united-us.net/privacyPolicy.htm"
 #else
     #define  URL_ERR_LOG  @""
-    #define  URL_UPDATE_AUTH  @"https://ge.united-us.net/admin_v2.php"
-    #define  URL_UPLOAD_PDF  @"https://ge.united-us.net/admin_v2.php"
-    #define  URL_LOGOUT  @"https://ge.united-us.net/admin_v2.php"
-    #define  URL_REQUEST_DOC  @"https://ge.united-us.net/admin_v2.php"
-    #define  URL_NEW_DOCUMENT  @"https://ge.united-us.net/admin_v2.php"
-    #define  URL_UPDATE_NOTES  @"https://ge.united-us.net/admin_v2.php"
-    #define URL_HEART_BEAT @"https://ge.united-us.net/admin_v2.php"
+    #define  URL_UPDATE_AUTH  @"https://ge.united-us.net/admin_v3.php"
+    #define  URL_UPLOAD_PDF  @"https://ge.united-us.net/admin_v3.php"
+    #define  URL_LOGOUT  @"https://ge.united-us.net/admin_v3.php"
+    #define  URL_REQUEST_DOC  @"https://ge.united-us.net/admin_v3.php"
+    #define  URL_NEW_DOCUMENT  @"https://ge.united-us.net/admin_v3.php"
+    #define  URL_UPDATE_NOTES  @"https://ge.united-us.net/admin_v3.php"
+    #define URL_HEART_BEAT @"https://ge.united-us.net/admin_v3.php"
     #define URL_PRIVACY @"https://ge.united-us.net/privacyPolicy.htm"
 #endif
 

+ 59 - 58
Ants Contract/common/PageViewController.m

@@ -1217,7 +1217,64 @@ typedef enum {
                                 tv.text = newvalue;
                                 
                             }
-                        }
+                            NSMutableDictionary* json_cd=action[@"conditional_constraint"][checked?@"true":@"false"] ;
+                            {
+                                for(int i=0;i<[json_cd[@"count"] intValue];i++)
+                                {
+                                    
+                                    NSMutableDictionary * destination =  json_cd [[NSString stringWithFormat:@"item_%d",i] ];
+                                    int page = [destination[@"page"] intValue];
+                                    NSString* control = destination[@"control"];
+                                    self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"disable"]=destination[@"disable"];
+                                    id value =destination[@"set_val"];
+                                                            self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"value"]=value;
+            //                        UITextView* tv = (UITextView*) [self findControl:destination[@"control"]];
+            //                        NSString* value = control[@"value"];
+            //
+            //                        UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
+            //                        NSString* text = tv6.text;
+            //                        NSString* newvalue = nil;
+            //                        if([value isEqualToString:@"*0.1"])
+            //                        {
+            //
+            //                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+            //                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+            //                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+            //                            if(prefix_str.length==0)
+            //                                prefix_str = @"";
+            //                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+            //                            double f = [[formatter numberFromString:text] doubleValue]*0.1;
+            //                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
+            //
+            //                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+            //                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
+            //                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+            //                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+            //                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+            //                        }
+            //                        else if([value isEqualToString:@"*0.9"])
+            //                        {
+            //                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
+            //                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
+            //                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
+            //                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
+            //                            if(prefix_str.length==0)
+            //                                prefix_str = @"";
+            //                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
+            //                            double f = [[formatter numberFromString:text] doubleValue]*0.9;
+            //                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
+            //                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
+            //                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
+            //                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
+            //                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
+            //                        }
+            //
+            //
+            //                        tv.text = newvalue;
+                                    
+                                }
+                            }
+                    }
                     else if([action[@"type"] isEqualToString:@"change contract"] )
                     {
                         NSString* pdf = action[@"contract"];
@@ -1228,63 +1285,7 @@ typedef enum {
                 }
                 
                 
-                NSMutableDictionary* json_cd=action[@"conditional_constraint"][checked?@"true":@"false"] ;
-                {
-                    for(int i=0;i<[json_cd[@"count"] intValue];i++)
-                    {
-                        
-                        NSMutableDictionary * destination =  json_cd [[NSString stringWithFormat:@"item_%d",i] ];
-                        int page = [destination[@"page"] intValue];
-                        NSString* control = destination[@"control"];
-                        self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"disable"]=destination[@"disable"];
-                        id value =destination[@"set_val"];
-                                                self.doc_controlTemplate[[NSString stringWithFormat:@"page_%d",page]][control][@"value"]=value;
-//                        UITextView* tv = (UITextView*) [self findControl:destination[@"control"]];
-//                        NSString* value = control[@"value"];
-//                        
-//                        UITextView* tv6 = (UITextView*) [self findControl:@"control_10"];
-//                        NSString* text = tv6.text;
-//                        NSString* newvalue = nil;
-//                        if([value isEqualToString:@"*0.1"])
-//                        {
-//                            
-//                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
-//                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
-//                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
-//                            if(prefix_str.length==0)
-//                                prefix_str = @"";
-//                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
-//                            double f = [[formatter numberFromString:text] doubleValue]*0.1;
-//                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
-//                            
-//                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
-//                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.1;
-//                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
-//                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
-//                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
-//                        }
-//                        else if([value isEqualToString:@"*0.9"])
-//                        {
-//                            //                                float f= [[text stringByReplacingOccurrencesOfString:@"$" withString:@"" ] floatValue]*0.9;
-//                            NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
-//                            formatter.numberStyle =kCFNumberFormatterCurrencyStyle;
-//                            NSString* prefix_str= self.page_controlTemplate [control[@"control"] ][@"prefix_str"];
-//                            if(prefix_str.length==0)
-//                                prefix_str = @"";
-//                            text=[text stringByReplacingOccurrencesOfString:prefix_str withString:@"$"];
-//                            double f = [[formatter numberFromString:text] doubleValue]*0.9;
-//                            newvalue = [formatter stringFromNumber:[NSNumber numberWithDouble: f]];
-//                            newvalue=[newvalue stringByReplacingOccurrencesOfString:@"$" withString:prefix_str];
-//                            //                                newvalue = [NSString stringWithFormat:@"$ %.2f",f];
-//                            self.page_controlTemplate [control[@"control"] ][@"value"] = newvalue;
-//                            self.page_controlTemplate [control[@"control"] ][@"dirty"] = [NSNumber numberWithBool:true];
-//                        }
-//                        
-//                        
-//                        tv.text = newvalue;
-                        
-                    }
-                }
+
                 
             }
             

+ 10 - 1
RedAnt ERP Mobile/common/PDFUtils.m

@@ -441,7 +441,16 @@ isnew:(bool)isNewDocument
                     CGRect text_rect = [self WindowRect2PDFRect:control_rect pdf_rect:papersize window_size:window_rect.size];
 
                     CGRect bg_rect= text_rect;
-                    PDFDrawable * rect_drawable = [[RectDrawable alloc] init:bg_rect color:@"0xffff00"];
+                    PDFDrawable * rect_drawable = nil;
+                    if([control_type isEqualToString:@"Check"])
+                    {
+                        rect_drawable = [[RectDrawable alloc] init:bg_rect color:@"0xffff00" alpha:0.2];
+                    }
+                    else
+                    {
+                        rect_drawable = [[RectDrawable alloc] init:bg_rect color:@"0xffff00"];
+                    }
+                    
                     if(rect_drawable)
                         [pdfPage DirectDraw:pdfContext drawable:rect_drawable];
                 }

+ 2 - 2
RedAnt ERP Mobile/common/pdfCreator/RectDrawable.h

@@ -11,9 +11,9 @@
 @interface RectDrawable : BasicDrawable
 
 @property (nonatomic,strong) UIColor * bgColor;
-
-
+@property (assign, nonatomic) double  alpha;
 -(instancetype) init:(CGRect) rect color:(NSString*) color;
+-(instancetype) init:(CGRect) rect color:(NSString*) color alpha:(double) alpha;
 +(NSMutableDictionary *) createRectTemplate:(CGRect) rect color:(NSString*) color;
 
 @end

+ 20 - 3
RedAnt ERP Mobile/common/pdfCreator/RectDrawable.m

@@ -9,7 +9,18 @@
 #import "RectDrawable.h"
 
 @implementation RectDrawable
+
+
+
 -(instancetype) init:(CGRect) rect color:(NSString*) color
+{
+    
+    return [self init:rect color:color alpha:1];
+    
+    
+}
+
+-(instancetype) init:(CGRect) rect color:(NSString*) color alpha:(double) alpha
 {
     
     if (self = [super init]) {
@@ -17,7 +28,7 @@
         //        NSMutableDictionary* m2=[drawableTemplate mutableCopy];
         //        [self setDrawableTemplate:[[RAUtils string2dict:[RAUtils dict2string:drawableTemplate]]  mutableCopy] ];
         
-        NSMutableDictionary * drawableTemplate = [RectDrawable createRectTemplate:rect color:color];
+        NSMutableDictionary * drawableTemplate = [RectDrawable createRectTemplate:rect color:color alpha:alpha];
         
         [self setDrawableTemplate:[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:drawableTemplate]] ];
         
@@ -25,7 +36,7 @@
     return self;
     
 }
-+(NSMutableDictionary *) createRectTemplate:(CGRect) rect color:(NSString*) color
++(NSMutableDictionary *) createRectTemplate:(CGRect) rect color:(NSString*) color alpha:(double)alpha
 {
     
     
@@ -36,6 +47,7 @@
     
     ret[@"type"]=@"rect" ;
     ret[@"color"]=color ;
+    ret[@"alpha"]=@(alpha);
     
     return ret;
 }
@@ -45,14 +57,18 @@
     [super setDrawableTemplate:drawableTemplate];
     
     NSString* colorvalue=drawableTemplate[@"color"];
+    double alpha=[drawableTemplate[@"alpha"] doubleValue];
     if(colorvalue.length>0 )
     {
         unsigned long color = strtoul([colorvalue UTF8String],0,16);
         self.bgColor= UIColorFromRGB(color);
+        self.alpha = alpha;
+//        [self.bgColor colorWithAlphaComponent:alpha];
     }
     else
     {
         self.bgColor= [UIColor blackColor];
+        self.alpha = 1;
         
     }
 //    if(self.color==nil)
@@ -78,7 +94,8 @@
     CGRect rect= [self parent_to_pdf_rect:parentrect contextHeight:flip_height];
         CGContextSaveGState(context);
     
-    CGContextSetFillColorWithColor(context, self.bgColor.CGColor);
+    
+    CGContextSetFillColorWithColor(context, [self.bgColor colorWithAlphaComponent:self.alpha].CGColor);
 //   CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0);
 //    
 //    CGContextAddRect(context, parentrect);

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно