Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.jleaf.erp.sls.bo.customer;
- import java.util.List;
- import javax.persistence.Query;
- import org.jleaf.common.entity.User;
- import org.jleaf.core.AbstractBusinessFunction;
- import org.jleaf.core.BusinessFunction;
- import org.jleaf.core.Dto;
- import org.jleaf.core.GeneralConstants;
- import org.jleaf.core.annotation.Info;
- import org.jleaf.core.annotation.InfoIn;
- import org.jleaf.core.annotation.InfoOut;
- import org.jleaf.core.dao.CriteriaHelper;
- import org.jleaf.core.dao.QueryBuilder;
- import org.jleaf.erp.master.dao.PartnerDao;
- import org.jleaf.erp.master.entity.Partner;
- import org.jleaf.erp.master.entity.PartnerAddress;
- import org.jleaf.erp.master.entity.PartnerCp;
- import org.jleaf.erp.master.entity.PartnerType;
- import org.jleaf.erp.sls.SalesConstants;
- import org.jleaf.erp.sls.dao.OrderDao;
- import org.jleaf.erp.sls.entity.PolicyCustomerGroupBrand;
- import org.jleaf.erp.sls.entity.UserPartner;
- import org.jleaf.util.DtoUtil;
- import org.jleaf.util.ValidationUtil;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- /**
- *
- * @author Ephraim Jehudah, April 09, 2020
- *
- **/
- //@formatter:off
- @Service
- @InfoIn(value = {
- @Info(name = "apiKey", description = "api Key", type = String.class),
- @Info(name = "salesmanId", description = "salesmanId", type = Long.class),
- @Info(name = "datetime", description = "datetime", type = String.class),
- @Info(name = "userLoginId", description = "user Login Id", type = Long.class),
- @Info(name = "tenantLoginId", description = "tenant Login Id", type = Long.class),
- @Info(name = "roleLoginId", description = "roleLoginId", type = Long.class),
- })
- @InfoOut(value = {
- @Info(name = "customerWithSaldoPiutangList", description = "customerWithSaldoPiutangList (customerId, customerName, totalSaldoPiutang, totalSaldoPiutangDueDate, totalSaldoPiutangNotDueDate)", type = List.class)
- })
- //@formatter:on
- public class GetCustomerListWithSaldoPiutangBySalesmanId extends AbstractBusinessFunction implements BusinessFunction {
- private static final Logger log = LoggerFactory.getLogger(GetCustomerListWithSaldoPiutangBySalesmanId.class);
- @Autowired
- OrderDao orderDao;
- @Override
- public String getDescription() {
- return "Get Customer List With Saldo Piutang By Salesman";
- }
- @SuppressWarnings("unchecked")
- @Override
- public Dto execute(Dto inputDto) throws Exception {
- log.info("Input BF {} -. {} ", inputDto);
- ValidationUtil.valDtoContainsKey(inputDto, "apiKey");
- ValidationUtil.valDtoContainsKey(inputDto, "salesmanId");
- ValidationUtil.valDtoContainsKey(inputDto, "datetime");
- ValidationUtil.valDtoContainsKey(inputDto, "userLoginId");
- ValidationUtil.valDtoContainsKey(inputDto, "tenantLoginId");
- ValidationUtil.valDtoContainsKey(inputDto, "roleLoginId");
- Long salesmanId = inputDto.getLong("salesmanId");
- Long userLoginId = inputDto.getLong("userLoginId");
- Long tenantLoginId = inputDto.getLong("tenantLoginId");
- Long roleLoginId = inputDto.getLong("roleLoginId");
- String datetime = inputDto.getString("datetime");
- Dto outputDto = new Dto();
- List<Object[]> result = null;
- // jumlah key pada list harus sama dengan jumlah kolom yang diselect
- outputDto = new Dto();
- // outputDto.putList("customerWithSaldoPiutangList",DtoUtil.createDtoListFromArray(result, "customerId", "customerName",
- // "totalSaldoPiutang", "totalSaldoPiutangDueDate", "totalSaldoPiutangNotDueDate"));
- log.debug("Output BF {} -. {} ", this.getClass(), outputDto);
- return outputDto;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement