Return-path: <issuessicom@gmail.com>
Envelope-to: victor@ssf.com.mx
Delivery-date: Wed, 20 Jan 2016 19:25:53 -0600
Received: from mail-ob0-f176.google.com ([209.85.214.176]:34513)
	by vishnu.hosting-mexico.net with esmtps (TLSv1.2:AES128-GCM-SHA256:128)
	(Exim 4.86)
	(envelope-from <issuessicom@gmail.com>)
	id 1aM40V-000b65-Mw
	for victor@ssf.com.mx; Wed, 20 Jan 2016 19:25:53 -0600
Received: by mail-ob0-f176.google.com with SMTP id vt7so22880025obb.1
        for <victor@ssf.com.mx>; Wed, 20 Jan 2016 17:25:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:reply-to:to:message-id:references:subject:mime-version
         :content-type:content-transfer-encoding;
        bh=LiD1nvMIubbbNQuyOzCvd2gr47ZdGCYV3YDFhnbk88Y=;
        b=bVGAR1s5MGcc0dkwBFY3cNyjfhDmSUGVoqET5AvMF4rwQvxRwBPc9pFt2/nH6nfJRi
         7jLgUXVAgm0E2Vza8jE0mtzO36u1EMs3jifLo+kqjw5Aq5AhEjfxjb3J1JV1cUrni+Ju
         wl14EYnzwsk8tuZgs6+9RNq30D/Ix4eHoyoiSuIdpdY0X35wDpD/ip2PmbbpLBUxvNxz
         5jwKLGnrZhUphP1R7dV2DC15xS6MopiP2FBd3GAVTxg8pYlrgeyAfMLJwkqPRUV6uBLd
         4QpiqKYtfzdjyGYO165nwldn5UEm8RpIU14I3P9/k2UdkTrBDN720CQZYMIyOYX9Ojwl
         AoAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:reply-to:to:message-id:references
         :subject:mime-version:content-type:content-transfer-encoding;
        bh=LiD1nvMIubbbNQuyOzCvd2gr47ZdGCYV3YDFhnbk88Y=;
        b=gz3ODhKBxlfyRBAlpljRh2lFqJO3HNKHKEKZMVMk2Rgyxv0DITIx9aJOh9Jhl5Op4L
         OfV64hz8qea/kdpTYMR+7epgKroD+62m8HzWshcPo36gV4WC4TT/lwsjtjzd+fw0I3jK
         XwkEoU89ZDY1iBezFD/JWAottxD4bfCMvWU7rgbqksVMfpMcJ6VqhiE1ehifx7ya2Z4C
         SyY6Ij1Nx9uLDGnbPnaR9F0sAxIOY+0+jI/e4TWF1oDFCLUu9rH1dDddQCBMNSgjlJCC
         0my3JU6DDnoCx+49Rapd+erYOKCAopGWL2753cG/yJ6cL3j/MYngg8UlSdnhQ7rjMPhy
         dVNg==
X-Gm-Message-State: ALoCoQnVYr0dP4tlA9A4rZaDi7Bk9tPnY4iPTE1DesBGOrOby7d5tSDmu4++4mtAoSUrI3PWhhAjAhAlMyZUexTzGBvW9MBnig==
X-Received: by 10.60.159.72 with SMTP id xa8mr30324423oeb.25.1453339513439;
        Wed, 20 Jan 2016 17:25:13 -0800 (PST)
Received: from gmail.com ([108.161.137.201])
        by smtp.gmail.com with ESMTPSA id s200sm19310891oie.2.2016.01.20.17.25.12
        for <victor@ssf.com.mx>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 20 Jan 2016 17:25:12 -0800 (PST)
Date: Wed, 20 Jan 2016 19:25:11 -0600
From: luis <issuessicom@gmail.com>
Reply-To: noreply@108.161.137.201
To: victor@ssf.com.mx
Message-ID: <56a03377ecc14_9203fe8a962cb641554b7@develop.mail>
References: <merge_request_167@108.161.137.201>
Subject: smart-g4s | Correciones pedidos (#40)
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="--==_mimepart_56a03377ea929_9203fe8a962cb641553c2";
 charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Status: No, score=-0.8
X-Spam-Score: -7
X-Spam-Bar: /
X-Ham-Report: Spam detection software, running on the system "vishnu.hosting-mexico.net",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 root\@localhost for details.
 
 Content preview:  New comment for Merge Request 40 http://108.161.137.201:9000/luis/smart-g4s/merge_requests/40#note_308
    luis [...] 
 
 Content analysis details:   (-0.8 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was blocked.
                             See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
                              for more information.
                             [URIs: 108.161.137.201]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [209.85.214.176 listed in list.dnswl.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (issuessicom[at]gmail.com)
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 WEIRD_PORT             URI: Uses non-standard port number for HTTP
  0.0 NORMAL_HTTP_TO_IP      URI: URI host has a public dotted-decimal IPv4
                             address
  0.0 HTML_MESSAGE           BODY: HTML included in message
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from author's
                             domain
  0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily valid
 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.214.176 listed in wl.mailspike.net]
X-Spam-Flag: NO


----==_mimepart_56a03377ea929_9203fe8a962cb641553c2
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

New comment for Merge Request 40

http://108.161.137.201:9000/luis/smart-g4s/merge_requests/40#note_308


luis

Victor este metodo es poco eficiente, la manera en que estas obteniendo los datos es recursiva sobre consultas que ya habias realizado anterior mente, 
orderModel.setCustomer(Global.getCustomerDAO().findById(Global.getReceptionUnitDAO().findById(order.getReceptionUnitId()).getCustomerId()));

Buscas una unidad de recepcion por su id y luego buscas un cliente por el id que tiene la unidad de recepcion.

orderModel.setAddress(Global.getAddressDAO().findById(Global.getReceptionUnitDAO().findById(order.getReceptionUnitId()).getAddressId()));

Vuelves a buscar la misma unidad de recepcion y despues buscas el domicilio por la unidad de recepcion.

Lo que debes de hacer es buscar primero la unidad de recepcion (Que ya lo haces) y usar esa unidad de recepcion para buscar el cliente y el domicilio.

Ejemplo:

ReceptionUnit receptionUnit = Global.getReceptionUnitDAO().findById(order.getReceptionUnitId());
orderModel.setReceptionUnit(receptionUnit);
orderModel.setCustomer(Global.getCustomerDAO().findById(receptionUnit.getCustomerId()));

Optimiza donde lo requiera de este metodo.



----==_mimepart_56a03377ea929_9203fe8a962cb641553c2
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html lang=3D'en'>
<head>
<meta content=3D'text/html; charset=3Dutf-8' http-equiv=3D'Content-Type'>=

<title>
GitLab
</title>
</meta>
</head>
<style>
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
</style>
<body>
<div class=3D'content'>
<p class=3D'details'>
New comment on diff for
<a href=3D"http://108.161.137.201:9000/luis/smart-g4s/merge_requests/40#n=
ote_308">Smartg4s/app/src/main/java/mx/ssf/smartg4s/domain/sales/OrderSer=
vice.java</a>
:
</p>
<div>
<p>Victor este metodo es poco eficiente, la manera en que estas obteniend=
o los datos es recursiva sobre consultas que ya habias realizado anterior=
 mente, =

orderModel.setCustomer(Global.getCustomerDAO().findById(Global.getRecepti=
onUnitDAO().findById(order.getReceptionUnitId()).getCustomerId()));</p>

<p>Buscas una unidad de recepcion por su id y luego buscas un cliente por=
 el id que tiene la unidad de recepcion.</p>

<p>orderModel.setAddress(Global.getAddressDAO().findById(Global.getRecept=
ionUnitDAO().findById(order.getReceptionUnitId()).getAddressId()));</p>

<p>Vuelves a buscar la misma unidad de recepcion y despues buscas el domi=
cilio por la unidad de recepcion.</p>

<p>Lo que debes de hacer es buscar primero la unidad de recepcion (Que ya=
 lo haces) y usar esa unidad de recepcion para buscar el cliente y el dom=
icilio.</p>

<p>Ejemplo:</p>

<p>ReceptionUnit receptionUnit =3D Global.getReceptionUnitDAO().findById(=
order.getReceptionUnitId());
orderModel.setReceptionUnit(receptionUnit);
orderModel.setCustomer(Global.getCustomerDAO().findById(receptionUnit.get=
CustomerId()));</p>

<p>Optimiza donde lo requiera de este metodo.</p>

</div>


</div>
<div class=3D'footer' style=3D'margin-top: 10px;'>
<p>
=E2=80=94
<br>
You're receiving this notification because you are a member of the luis /=
 smart-g4s project team.
<a href=3D"http://108.161.137.201:9000/luis/smart-g4s/merge_requests/40#n=
ote_308">View it on GitLab</a>
</p>
</div>
</body>
</html>

----==_mimepart_56a03377ea929_9203fe8a962cb641553c2--
