Advertisement
Evra70

Untitled

Apr 29th, 2020
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.91 KB | None | 0 0
  1. package org.jleaf.erp.sls.bo.customer;
  2.  
  3. import java.text.DateFormat;
  4. import java.text.SimpleDateFormat;
  5. import java.util.Date;
  6. import java.util.List;
  7.  
  8. import javax.persistence.Query;
  9.  
  10. import org.jleaf.common.entity.User;
  11. import org.jleaf.core.AbstractBusinessFunction;
  12. import org.jleaf.core.BusinessFunction;
  13. import org.jleaf.core.Dto;
  14. import org.jleaf.core.GeneralConstants;
  15. import org.jleaf.core.annotation.Info;
  16. import org.jleaf.core.annotation.InfoIn;
  17. import org.jleaf.core.annotation.InfoOut;
  18. import org.jleaf.core.dao.CriteriaHelper;
  19. import org.jleaf.core.dao.QueryBuilder;
  20. import org.jleaf.erp.master.bo.partner.FindPartnerByIndex;
  21. import org.jleaf.erp.master.dao.PartnerDao;
  22. import org.jleaf.erp.master.entity.Partner;
  23. import org.jleaf.erp.master.entity.PartnerAddress;
  24. import org.jleaf.erp.master.entity.PartnerCp;
  25. import org.jleaf.erp.master.entity.PartnerType;
  26. import org.jleaf.erp.sls.SalesConstants;
  27. import org.jleaf.erp.sls.dao.SalesmanVisitPlanDao;
  28. import org.jleaf.erp.sls.entity.Order;
  29. import org.jleaf.erp.sls.entity.PolicyCustomerGroupBrand;
  30. import org.jleaf.erp.sls.entity.SalesmanDate;
  31. import org.jleaf.erp.sls.entity.SalesmanVisitPlan;
  32. import org.jleaf.erp.sls.entity.UserPartner;
  33. import org.jleaf.util.DateUtil;
  34. import org.jleaf.util.DtoUtil;
  35. import org.jleaf.util.ValidationUtil;
  36. import org.slf4j.Logger;
  37. import org.slf4j.LoggerFactory;
  38. import org.springframework.beans.factory.annotation.Autowired;
  39. import org.springframework.stereotype.Service;
  40.  
  41. /**
  42.  *
  43.  * @author Ephraim Jehudah, April 09, 2020
  44.  *
  45.  **/
  46.  
  47. //@formatter:off
  48. @Service
  49. @InfoIn(value = {
  50.     @Info(name = "userLoginId", description = "user Login Id", type = Long.class),
  51.     @Info(name = "tenantLoginId", description = "tenant Login Id", type = Long.class),
  52.     @Info(name = "roleLoginId", description = "roleLoginId", type = Long.class),
  53.     @Info(name = "datetime", description = "datetime", type = String.class),
  54.     @Info(name = "customerId", description = "customer Id", type = Long.class),
  55.     @Info(name = "apiKey", description = "apiKey", type = String.class),
  56. })
  57. @InfoOut(value = {
  58.     @Info(name = "summarySaldoHutangCustomer", description = "summarySaldoHutangCustomer {totalDebt, totalDebtDueDate, totalDebtNotDueDate, totalInvoice    , totalInvoiceDueDate, totalInvoiceNotDueDate}", type = Object.class)
  59. })
  60. //@formatter:on
  61. public class GetTodaySummarySaldoHutangByCustomerId extends AbstractBusinessFunction implements BusinessFunction {
  62.     private static final Logger log = LoggerFactory.getLogger(GetTodaySummarySaldoHutangByCustomerId.class);
  63.    
  64.     @Autowired
  65.     PartnerDao partnerDao;
  66.  
  67.     @Override
  68.     public String getDescription() {
  69.         return "Get Today Summary Saldo Hutang By Customer Id";
  70.     }
  71.  
  72.     @SuppressWarnings("unchecked")
  73.     @Override
  74.     public Dto execute(Dto inputDto) throws Exception {
  75.         log.info("Input YANG MASUK BF {} -. {} ", inputDto);
  76.  
  77.         ValidationUtil.valDtoContainsKey(inputDto, "userLoginId");
  78.         ValidationUtil.valDtoContainsKey(inputDto, "tenantLoginId");
  79.         ValidationUtil.valDtoContainsKey(inputDto, "roleLoginId");
  80.         ValidationUtil.valDtoContainsKey(inputDto, "datetime");
  81.         ValidationUtil.valDtoContainsKey(inputDto, "customerId");
  82.  
  83.         Long userLoginId = inputDto.getLong("userLoginId");
  84.         Long tenantLoginId = inputDto.getLong("tenantLoginId");
  85.         Long roleLoginId = inputDto.getLong("roleLoginId");
  86.         String datetime = inputDto.getString("datetime");
  87.        
  88.         String today = datetime.substring(0,8);
  89.         Long customerId = inputDto.getLong("customerId");
  90.        
  91.         Dto outputDto = new Dto();
  92.         Dto summaryDto = new Dto();
  93.         List<Object[]> result =  null;  
  94.        
  95.        
  96. //        outputDto.put("summarySaldoHutangCustomer", summaryDto);
  97.        
  98.         log.info("Output BF {} --> {} ", this.getClass(), outputDto);
  99.  
  100.         return outputDto;
  101.     }
  102.  
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement