转为json类型

public class listGageData
{
public string gcustName
{
set;
get;
}
public string gcustIdtype
{
set;
get;
}
public string gcustIdno
{
set;
get;
}
public string gType
{
set;
get;
}
public string gName
{
set;
get;
}
public string gDesc
{
set;
get;
}
public decimal gValue
{
set;
get;
}
public string gLicno
{
set;
get;
}
public string gLicType
{
set;
get;
}
}
public class listComData
{
public string comName
{
set;
get;
}
public string comIdtype
{
set;
get;
}
public string comIdno
{
set;
get;
}
public string comTel
{
set;
get;
}
}
public class listRelData
{
public string relName
{
set;
get;
}
public string relIdtype
{
set;
get;
}
public string relIdno
{
set;
get;
}
public string relTel
{
set;
get;
}
}

public class IntoPiecesData
{
public string BrNo
{
set;
get;
}
public string BatNo
{
set;
get;
}
public int DataCnt
{
set;
get;
}
public List<IntoData> list
{
set;
get;
}
}
public class IntoData
{
public string PactNo
{
set;
get;
}
public string CustName
{
set;
get;
}
public string IdType
{
set;
get;
}
public string IdNo
{
set;
get;
}
public string CustType
{
set;
get;
}
public string Sex
{
set;
get;
}
public string Birth
{
set;
get;
}
public string Marriage
{
set;
get;
}
public string Children
{
set;
get;
}
public string Edu
{
set;
get;
}
public string Degree
{
set;
get;
}
public string TelNo
{
set;
get;
}
public string PhoneNo
{
set;
get;
}
public string PostCode
{
set;
get;
}
public string PostAddr
{
set;
get;
}
public string HomeArea
{
set;
get;
}
public string HomeTel
{
set;
get;
}
public string HomeCode
{
set;
get;
}
public string HomeAddr
{
set;
get;
}
public string HomeSts
{
set;
get;
}
public double Income
{
set;
get;
}
public string MateName
{
set;
get;
}
public string MateIdtype
{
set;
get;
}
public string MateIdno
{
set;
get;
}
public string MateWork
{
set;
get;
}
public string MateTel
{
set;
get;
}
public string ProjNo
{
set;
get;
}
public string PrdtNo
{
set;
get;
}
public double PactAmt
{
set;
get;
}
public double FeeTotal
{
set;
get;
}
public string PremNo
{
set;
get;
}
public double PremRate
{
set;
get;
}
public decimal LnRate
{
set;
get;
}
public string AppArea
{
set;
get;
}
public string AppUse
{
set;
get;
}
public int TermMon
{
set;
get;
}
public int TermDay
{
set;
get;
}
public string VouType
{
set;
get;
}
public string EndDate
{
set;
get;
}
public string PayType
{
set;
get;
}
public int PayDay
{
set;
get;
}
public decimal VouAmt
{
set;
get;
}
public string WorkType
{
set;
get;
}
public string WorkName
{
set;
get;
}
public string WorkSts
{
set;
get;
}
public string WorkWay
{
set;
get;
}
public string WorkCode
{
set;
get;
}
public string WorkAddr
{
set;
get;
}
public string WorkDuty
{
set;
get;
}
public string WorkTitle
{
set;
get;
}
public string WorkYear
{
set;
get;
}
public string IfCar
{
set;
get;
}
public string IfCarCred
{
set;
get;
}
public string IfRoom
{
set;
get;
}
public string IfMort
{
set;
get;
}
public string IfCard
{
set;
get;
}
public double CardAmt
{
set;
get;
}
public string IfApp
{
set;
get;
}
public string IfId
{
set;
get;
}
public string IfPact
{
set;
get;
}
public string PrePactNo
{
set;
get;
}
public string CzPactNo
{
set;
get;
}
public string CardChn
{
set;
get;
}

public List<listGageData> listGage
{
set;
get;
}

public List<listComData> listCom
{
set;
get;
}

public List<listRelData> listRel
{
set;
get;
}
public List<listAcData> listAc
{
set;
get;
}
}
public class listAcData
{
public String acUse 
{
set;
get;
}
public double acAmt 
{
set;
get;
}
public String acType 
{
set;
get;
}
public String acno // 账户号
{
set;
get;
}
public String acName 
{
set;
get;
}
public String bankCode 
{
set;
get;
}
public String bankProv 
{
set;
get;
}
public String bankCity 
{
set;
get;
}
public String bankSite 
{
set;
get;
}
public String idType 
{
set;
get;
}
public String idNo 
{
set;
get;
}
public String phoneNo 
{
set;
get;
}
public String validDate 
{
set;
get;
}
public String cvvNo 
{
set;
get;
}
}

public string I2101(string aa)
        {
            string getData = "";
            try
            {
                IntoPiecesData IntoPiecesInfo = new IntoPiecesData();

                IntoPiecesInfo.BrNo = "023";
                IntoPiecesInfo.BatNo = SourceCaseNo.Replace("-", "");
                IntoPiecesInfo.DataCnt = 1;
                DAL.ControllerBase con = DAL.ControllerFactory.GetNewController(DAL.e_ConsType.Main2);

                string sqlIntoData = string.Format(@"  ", aa);
                IntoData IntoDataInfo = new IntoData();
                DataTable dtIntoData = con.GetDataTable(sqlIntoData);
                List<listGageData> GageDataList = new List<listGageData>();

                if (dtIntoData.Rows.Count > 0)
                {
                    GageDataList.AddRange(CConvert.DataTableToList<listGageData>(dtIntoData));
                }
                IntoDataInfo.listGage = GageDataList;

                string sqlAcData = string.Format(@"   ", aa);
                DataTable dtAcData = con.GetDataTable(sqlAcData);
                List<listAcData> AcList = new List<listAcData>();
                if (dtAcData.Rows.Count > 0)
                {
                    AcList.AddRange(CConvert.DataTableToList<listAcData>(dtAcData));
                }
                IntoDataInfo.listAc = AcList;

                string sqlComData = string.Format(@"   ", aa);
                DataTable dtComData = con.GetDataTable(sqlComData);
                List<listComData> ComList = new List<listComData>();
                if (dtComData.Rows.Count > 0)
                {
                    ComList.AddRange(CConvert.DataTableToList<listComData>(dtComData));
                }
                IntoDataInfo.listCom = ComList;

                List<listRelData> RelList = new List<listRelData>();
                IntoDataInfo.listRel = RelList;

                string sql = string.Format(@"   ", aa);

                    DataTable dt = con.GetDataTable(sql);

                    IntoDataInfo.PactNo = SourceCaseNo.Replace("-", "");
                    IntoDataInfo.CustName = dt.Rows[0]["custName"].ToString();
                    IntoDataInfo.IdType = dt.Rows[0]["idType"].ToString();
                    IntoDataInfo.IdNo = dt.Rows[0]["idNo"].ToString();
                    IntoDataInfo.CustType = "03";
                    IntoDataInfo.Sex = dt.Rows[0]["sex"].ToString();
                    IntoDataInfo.Birth = dt.Rows[0]["birth"].ToString();
                    IntoDataInfo.Marriage = dt.Rows[0]["marriage"].ToString();
                    IntoDataInfo.Children = dt.Rows[0]["children"].ToString();
                    IntoDataInfo.Edu = dt.Rows[0]["edu"].ToString();
                    IntoDataInfo.Degree = "9";
                    IntoDataInfo.TelNo = dt.Rows[0]["telNo"].ToString();
                    IntoDataInfo.PhoneNo = dt.Rows[0]["phoneNo"].ToString();
                    IntoDataInfo.PostCode = "";
                    IntoDataInfo.PostAddr = "";
                    IntoDataInfo.HomeArea = "000000";
                    IntoDataInfo.HomeTel = "";
                    IntoDataInfo.HomeCode = "";
                    IntoDataInfo.HomeAddr = dt.Rows[0]["homeAddr"].ToString();
                    IntoDataInfo.HomeSts = dt.Rows[0]["homeSts"].ToString();
                    IntoDataInfo.Income = dt.Rows[0]["income"].AsTargetType<double>(0);
                    IntoDataInfo.MateName = dt.Rows[0]["mateName"].ToString();
                    IntoDataInfo.MateIdtype = dt.Rows[0]["mateIdtype"].ToString();
                    IntoDataInfo.MateIdno = dt.Rows[0]["mateIdno"].ToString();
                    IntoDataInfo.MateWork = dt.Rows[0]["mateWork"].ToString();
                    IntoDataInfo.MateTel = dt.Rows[0]["mateTel"].ToString();
                    IntoDataInfo.ProjNo = "30856";
                    IntoDataInfo.PrdtNo = "100001";
                    IntoDataInfo.FeeTotal = 0d;
                    IntoDataInfo.PremNo="";
                    IntoDataInfo.PremRate=0d;
                    IntoDataInfo.PactAmt = dt.Rows[0]["pactAmt"].AsTargetType<double>(0);
                    IntoDataInfo.LnRate = Math.Round(dt.Rows[0]["lnRate"].AsTargetType<decimal>(0), 6); //dt.Rows[0]["lnRate"].AsTargetType<double>(0);
                    IntoDataInfo.AppArea = "000000";
                    IntoDataInfo.AppUse = dt.Rows[0]["AppUse"].ToString();
                    IntoDataInfo.TermMon = dt.Rows[0]["termMon"].AsTargetType<int>(0);
                    IntoDataInfo.TermDay = 0;
                    IntoDataInfo.VouType = "2";
                    IntoDataInfo.EndDate = "";
                    IntoDataInfo.PayType = "02";
                    IntoDataInfo.PayDay = dt.Rows[0]["payDay"].AsTargetType<int>(0);
                    IntoDataInfo.VouAmt = Math.Round(dt.Rows[0]["VouAmt"].AsTargetType<decimal>(0), 2);
                    IntoDataInfo.WorkType = "Z";
                    IntoDataInfo.WorkName = "";//dt.Rows[0]["workName"].ToString();
                    IntoDataInfo.WorkSts = "01";
                    IntoDataInfo.WorkWay = dt.Rows[0]["workWay"].ToString();
                    IntoDataInfo.WorkCode = "";
                    IntoDataInfo.WorkAddr = "";//dt.Rows[0]["workAddr"].ToString();
                    IntoDataInfo.WorkDuty = dt.Rows[0]["workDuty"].ToString();
                    IntoDataInfo.WorkTitle = "9";
                    IntoDataInfo.WorkYear = "";
                    IntoDataInfo.IfCar = "2";
                    IntoDataInfo.IfCarCred = "2";
                    IntoDataInfo.IfRoom = "1";
                    IntoDataInfo.IfMort = "1";
                    IntoDataInfo.IfCard = "2";
                    IntoDataInfo.CardAmt = 0;
                    IntoDataInfo.IfApp = "2";
                    IntoDataInfo.IfId = "1";
                    IntoDataInfo.IfPact = "2";
                    IntoDataInfo.PrePactNo = SourceCaseNo.Replace("-", "");
                    IntoDataInfo.CzPactNo = "";
                    IntoDataInfo.CardChn = "CL0002";

                    List<IntoData> IntoDataList = new List<IntoData>();

                    IntoDataList.Add(IntoDataInfo);

                    IntoPiecesInfo.list = IntoDataList;

                    string IntoPiecesJson = JsonConvert.SerializeObject(IntoPiecesInfo);

            }
            catch (Exception ex)
            {
                return ex.Message;
            }

            return getData;
        }
时间: 2024-10-09 07:04:15

转为json类型的相关文章

使用alibaba的json工具将String类型转为JSONArray类型

转化流程:先将输入流转为String类型,再使用alibaba的json转换工具,将字符串转化为json数组 SensorDevices sensorDevices = new SensorDevices(); request.setCharacterEncoding("utf-8"); JSONObject json = new JSONObject(); JSONArray list = new JSONArray(); BufferedReader br; String line

C#操作json类型数据

将对象序列化为 JavaScript 对象表示法 (JSON),并将 JSON 数据反序列化为对象. 此类不能继承. // msdn 例子: [csharp] view plaincopy namespace SL_DataContractJsonSerializer { public partial class Page : UserControl { public Page() { InitializeComponent(); } //This uses an event handler, 

python里如何将字典转为json字符串

在Pyhton里有一个叫simplejson的库可以方便的将完成对json的生成与解析.这个包里主要有四个方法:dump和dumps由python数据类型生成json,load和loads将json解析成为python的数据类型. load和loads(解析JSON成Python的数据类型)dump和dumps的唯一区别是dump会生成一个类文件对象,dumps会生成字符串,同理load和loads分别解析类文件对象和字符串格式的JSON 在django的HttpResponse中的返回中需要将

关于MySQL5.7 这几天的总结(json类型)

一开始,老板让调整一下 innodb_buffer_pool_size 大小,因为这台机器内存大. 看了下内存,16G,再SQL下面命令,得到结果是4G. SELECT @@innodb_buffer_pool_size; 果断vim /etc/my.cnf 修改了 innodb_buffer_pool_size = 8G # (adjust value here, 50%-70% of total RAM) 括号中内容是官方给的建议. 然后再执行下面的命令,调整到8G,这样不用重启mysql服

使用mysql innodb 使用5.7的json类型遇到的坑和解决办法

---------------------------------------------- #查询JSON的某个字段 select data -> '$.Host' from temp #创建虚拟列 ALTER TABLE temp ADD host varchar(128) GENERATED ALWAYS AS (json_extract(data,'$.Host')) VIRTUAL; #给虚拟列创建索引 ALTER TABLE temp ADD INDEX index_temp_hos

SpringMVC—对Ajax的处理(含 JSON 类型)(1)

一.首先要搞明白的一些事情. 1.从客户端来看,需要搞明白: (1)要发送什么样格式的 JSON 数据才能被服务器端的 SpringMVC 很便捷的处理,怎么才能让我们写更少的代码,如何做好 JSON 数据和实体之间的对应. (2)如何组织这些发送的数据. 2.从服务器端来看,需要搞明白: (1)SpringMVC 如何返回 JSON 数据. (2)SpringMVC 如何处理请求的复杂数据. 3.$.ajax 的几个参数: (1)contentType: contentType: 'appli

JavaScript基础 空字符串转为数值类型 Number()

镇场诗: 清心感悟智慧语,不着世间名与利.学水处下纳百川,舍尽贡高我慢意. 学有小成返哺根,愿铸一良心博客.诚心于此写经验,愿见文者得启发.------------------------------------------ code: 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=ut

Swift中对C语言接口缓存的使用以及数组、字符串转为指针类型的方法

由于Swift编程语言属于上层编程语言,而Swift中由于为了低层的高性能计算接口,所以往往需要C语言中的指针类型,由此,在Swift编程语言刚诞生的时候就有了UnsafePointer与UnsafeMutablePointer类型,分别对应为const Type*类型与Type *类型. 而在Swift编程语言中,由于一般数组(Array)对象都无法直接用于C语言中含有指针类型的函数参数(比如:void*),所以往往需要将数组转为指针类型,此外也需要将数组中元素内容存放到连续的存储空间.此外,

Struts2自定义返回Json类型result

本来Struts2有自己的json类型的返回结果,并提供了插件,但是它有一个问题,那就是它会将所有序列化的字段都返回,如果想要制定返回Action的某一个属性,则需要在配置result时,配置参数(这里只是举个例子): <param name="root">responseMap</param> 配置了这个参数,返回结果就会从Action中的responseMap为根进行返回. 但是如果自定义结果类型,就可以自己控制了,而且不需要struts2-json-res