fix partner invoice + settlement log tip

master
eason.qian 7 years ago
parent 470f5d191e
commit 3f4a2cf9a6

@ -345,3 +345,15 @@ alter table act_app_list
ALTER TABLE `sys_clients_apply`
MODIFY COLUMN `bd_user` varchar(300) DEFAULT NULL COMMENT '所属BD用户';
ALTER TABLE `pmt_orders`
ADD COLUMN `surcharge_rate` decimal(10,5) NULL AFTER `customer_surcharge`;
ALTER TABLE `pmt_orders`
ADD COLUMN `custom_surcharge_rate` decimal(10,5) NULL AFTER `surcharge_rate`;
ALTER TABLE `pmt_transactions`
ADD COLUMN `input_amount` decimal(20,2) NULL AFTER `clearing_amount`;
ALTER TABLE `pmt_transactions`
ADD COLUMN `surcharge_cashback` decimal(10,4) default 0 after `royalpay_surcharge` comment '返现至营销账户';

@ -1,22 +1,22 @@
package au.com.royalpay.payment.manage.analysis.core.impls;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.core.PaymentApi;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
import au.com.royalpay.payment.manage.analysis.core.PartnerCardDashboardService;
import au.com.royalpay.payment.manage.analysis.mappers.CustomerAndOrdersStatisticsMapper;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
@ -44,7 +44,7 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
@Resource
private MerchantInfoProvider merchantInfoProvider;
@Resource
private PaymentApi paymentApi;
private LogSettleMailMapper logSettleMailMapper;
@Override
public JSONObject getCommonAnalysis(String client_moniker) {
JSONObject client = clientManager.getClientInfoByMoniker(client_moniker);
@ -140,6 +140,17 @@ public class PartnerCardDashboardServiceImp implements PartnerCardDashboardServi
params.put("client_id", client_id);
PageList<JSONObject> logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
if (query.getPage()==1){
if (!logs.isEmpty() && logs.size()>0){
JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time"));
if (sendMailLog == null) {
result.put("padding",true);
}
if (sendMailLog!=null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding",true);
}
}
}
return result;
}

@ -10,6 +10,7 @@ import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
@ -127,4 +128,6 @@ public interface RetailAppService {
void changeSurchargeEnable(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO);
JSONObject getInvoiceData(JSONObject device, AppQueryBean appQueryBean) throws Exception;
void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception;
}

@ -31,6 +31,7 @@ import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
import au.com.royalpay.payment.tools.cms.RoyalPayCMSSupport;
import au.com.royalpay.payment.tools.device.DeviceSupport;
import au.com.royalpay.payment.tools.device.message.AppMessage;
@ -86,6 +87,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yishuqian on 28/03/2017.
@ -142,6 +144,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private NoticePartnerMapper noticePartnerMapper;
@Resource
private TradeLogService tradeLogService;
@Resource
private AppActService appActService;
private Map<String, AppMsgSender> senderMap = new HashMap<>();
@ -265,9 +269,27 @@ public class RetailAppServiceImp implements RetailAppService {
clientManager.validateClients(client_id, params);
params.put("client_id", client_id);
JSONObject analysis = transactionMapper.analysisTransFlow(params);
BigDecimal total_surcharge = analysis.getBigDecimal("total_surcharge").add(analysis.getBigDecimal("tax_amount"));
analysis.put("total_surcharge",total_surcharge);
return analysis;
}
@Override
public void getInvoiceFile(JSONObject device, AppQueryBean appQueryBean, HttpServletResponse httpResponse) throws Exception {
String clientType = device.getString("client_type");
deviceSupport.findRegister(clientType);
int client_id = device.getIntValue("client_id") ;
//JSONObject client = clientManager.getClientInfo(client_id);
TradeLogQuery tradeLogQuery = new TradeLogQuery();
tradeLogQuery.setDatefrom(appQueryBean.getBegin());
tradeLogQuery.setDateto(appQueryBean.getEnd());
if (appQueryBean.getApp_client_ids()==null){
appQueryBean.setApp_client_ids(String.valueOf(client_id));
}
tradeLogQuery.setClient_ids(appQueryBean.getApp_client_ids().split(","));
tradeLogService.exportTransFlow(tradeLogQuery,device,httpResponse);
}
@Override
public void updateClient(JSONObject device, AppClientBean appClientBean) {
String clientType = device.getString("client_type");

@ -45,6 +45,7 @@ import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import static au.com.royalpay.payment.tools.CommonConsts.RETAIL_DEVICE;
@ -456,4 +457,9 @@ public class RetailAppController {
public JSONObject getInvoiceData(@ModelAttribute(RETAIL_DEVICE) JSONObject device,AppQueryBean appQueryBean) throws Exception {
return retailAppService.getInvoiceData(device,appQueryBean);
}
@RequestMapping(value = "/invoice/file",method = RequestMethod.GET)
public void getInvoiceFile(@ModelAttribute(RETAIL_DEVICE) JSONObject device,AppQueryBean appQueryBean,HttpServletResponse httpResponse) throws Exception {
retailAppService.getInvoiceFile(device,appQueryBean,httpResponse);
}
}

@ -12,6 +12,7 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundAuditionMapper;
@ -129,6 +130,8 @@ public class TradeLogServiceImpl implements TradeLogService {
private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper;
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Resource
LogSettleMailMapper logSettleMailMapper;
@Resource
private OrgManager orgManager;
@ -818,6 +821,17 @@ public class TradeLogServiceImpl implements TradeLogService {
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
JSONObject result = PageListUtils.buildPageListResult(logs);
result.put("analysis", transactionMapper.getClientAmountAnalysis(params));
if (query.getPage()==1){
if (!logs.isEmpty() && logs.size()>0){
JSONObject sendMailLog = logSettleMailMapper.findByDate(logs.get(0).getDate("clearing_time"));
if (sendMailLog == null) {
result.put("padding",true);
}
if (sendMailLog!=null && sendMailLog.getIntValue("mail_status") != 1) {
result.put("padding",true);
}
}
}
return result;
}

@ -10,6 +10,7 @@ import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@ -55,7 +56,7 @@ public class CustomerImpressionImplTest {
// }
// }
@Test
@Ignore
public void excel() {
try {

Loading…
Cancel
Save