Receipt Address Table structure and create modification process

Source: Internet
Author: User

The process of creating a shipping address involves three tables   a process created for postaladdress  contact_mech    party_contact_mech     Call Createpartypostaladdress this service, in which the simple_method of the service have successively called two service services, the first one for createpostaladdress   The second service is the Simple_method method called in the Createpartycontactmechcreatepostaladdress service, which calls the Createcontactmech service, The value of this parameter is postal_address for the fixed parameter Contactmechtypeid, and the Contactmechid returned after the contact is created saves the Postaladress object, Based on the returned Contactmechid, this service is called Createpartycontactmech, creating the PartyId corresponding contact data, creating the Partycontactmech object.    set the default delivery address for the Partyprofiledefault object, which is specifically designed to record the default Reclaim address data. The general process is to determine whether the current login PartyId set the default delivery address, if the default delivery address is set, then save the operation, if the default delivery address has never been set, then create the operation.    Modify the delivery address process updatepartypostaladdress This service is used to modify the delivery address, the service calls the Updatepartypostaladdress In the Simplemethod method, the two services were called before and after two Updatepostaladdress,updatepartycontactmech, in the Updatepostaladdress service, According to the parameter corresponding to a new Postaladress entity object NewValue, through the primary key query to the original existence of the data contained in the database encapsulated into object oldvalue, to determine whether two entity objects are equal, if not equal, Call Createcontactmech This service to create a new shipping address (within this service, there will be two additional entity objects, each of which is a ContactmecH with PostalAddress), because created two new shipping address related to the object, if the original receipt address has been set as the default delivery address, if modified, then the original default shipping address will disappear, so you can add a judgment in the corresponding section, If two new objects are added, call the service that sets the default address and pass some necessary parameters so that the user experience is guaranteed to be changed after the modification, so that the user can see that the default address does not change.      
 <!--WQC A new record when modified, and set the identity to 1 the rest is set to empty, you need to reset the party's default address-<i                 F -compare-field to-field= "parameters.defaultshipaddr" field= "Oldvalue.contactmechid" operator= "equals" > <set-service-fields service-name= "Setpartyprofiledefaults" map= "parameters" to-map= "Partyprofiledefaultsctx"/&                 Gt <set field= "partyprofiledefaultsctx.defaultshipaddr" from-field= "Newvalue.contactmechid"/> <set F Ield= "Partyprofiledefaultsctx.partyid" from-field= "Userlogin.partyid"/> <set field= "PartyProfileDefa Ultsctx.productstoreid "from-field=" Parameters.productstoreid "/> <set field=" PartyProfileDefaultsCtx  . CompanyID "from-field=" Parameters.companyid "/> <call-service service-name=" Setpartyprofiledefaults " In-map-name= "Partyprofiledefaultsctx"/> </if -compare-field>

In the Updatepartycontactmech service, according to PartyId query out the list of existing objects, and then take out the first to clone, the original party's effective time is set to the current time, that is, the original data is set to invalid, Then re-create a Partycontactmech object.

Receipt Address Table structure and create modification process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.