diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index 1937ecd41..75071a8f7 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -345,6 +345,12 @@ * @apiSuccess {String} create_time 订单创建时间(最新订单为准)(yyyy-MM-dd HH:mm:ss,GMT+10) * @apiSuccess {String} currency 币种,通常为AUD * @apiSuccess {String} channel 支付渠道 Alipay|支付宝、Wechat|微信、Bestpay|翼支付 + * @apiSuccess {Json} customer_info + * + * 仅支付宝返回该参数,其他渠道为空对象 * * @apiUse GlobalError * @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在 diff --git a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java index 49a9136a4..3b51b69b3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java +++ b/src/main/java/au/com/royalpay/payment/manage/analysis/web/PartnerCardDashboardController.java @@ -74,8 +74,8 @@ public class PartnerCardDashboardController { } @RequestMapping("/{client_id}/settlement_logs/{detailId}") - public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable String detailId) { - return cleanService.getCleanLogTransactions(client_id, detailId); + public JSONObject listClearingTransactions(@PathVariable int client_id, @PathVariable int detailId,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return cleanService.getCleanLogTransactions(detailId, manager); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index cb718e7e6..49df6eff6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -20,7 +20,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientDeviceTokenMapper; import au.com.royalpay.payment.manage.mappers.system.ClientSettleDelayConfMapper; import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.notice.beans.NoticeInfo; import au.com.royalpay.payment.manage.notice.core.NoticeManage; @@ -129,7 +129,7 @@ public class RetailAppServiceImp implements RetailAppService { @Resource private DeviceSupport deviceSupport; @Resource - private CustomerRelationAlipayMapper customerRelationAlipayMapper; + private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; @Resource private CustomerMapper customerMapper; @Resource @@ -444,7 +444,7 @@ public class RetailAppServiceImp implements RetailAppService { } switch (order.getString("channel")) { case "Alipay": - JSONObject alipayUser = customerRelationAlipayMapper.findCustomerByUserId(customer_id); + JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id); if (alipayUser != null) { order.put("nickname", alipayUser.getString("nickname")); order.put("headimg", alipayUser.getString("headimg")); @@ -526,7 +526,7 @@ public class RetailAppServiceImp implements RetailAppService { } switch (order.getString("channel")) { case "Alipay": - JSONObject alipayUser = customerRelationAlipayMapper.findCustomerByUserId(customer_id); + JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id); order.put("nickname", alipayUser.getString("nickname")); order.put("headimg", alipayUser.getString("headimg")); break; diff --git a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java index 897ee17a5..724959373 100644 --- a/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/apps/core/impls/CustomerImpressionServiceImpl.java @@ -5,7 +5,7 @@ import au.com.royalpay.payment.manage.apps.core.CustomerImpressionService; import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper; import au.com.royalpay.payment.manage.mappers.payment.OrderMapper; import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.NotFoundException; import au.com.royalpay.payment.tools.lock.Locker; @@ -46,7 +46,7 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService @Resource private LookupService lookupService; @Resource - private CustomerRelationAlipayMapper customerRelationAlipayMapper; + private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; @Resource private CustomerMapper customerMapper; @Resource @@ -146,7 +146,7 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService String customer_id = order.getString("customer_id"); JSONObject userInfo = customerMapper.findCustomerByOpenId(customer_id); if (userInfo == null) { - userInfo = customerRelationAlipayMapper.findCustomerByUserId(customer_id); + userInfo = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id); } locker.lock(CUSTOMER_IMPRESSION_PREFIX + customer_id, 30_000, 30_000); try { diff --git a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java index 9e02222bc..5b1e79fc8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/bill/core/impl/BillOrderServiceImpl.java @@ -14,7 +14,7 @@ import au.com.royalpay.payment.manage.bill.bean.QueryBillOrderBean; import au.com.royalpay.payment.manage.bill.core.BillOrderService; import au.com.royalpay.payment.manage.mappers.bill.BillMapper; import au.com.royalpay.payment.manage.mappers.bill.BillOrderMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.utils.PageListUtils; @@ -28,7 +28,7 @@ public class BillOrderServiceImpl implements BillOrderService { @Resource private BillMapper billMapper; @Resource - private CustomerRelationAlipayMapper customerRelationAlipayMapper; + private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; @Override public List getByBillId(String bill_id, int client_id) { @@ -39,7 +39,7 @@ public class BillOrderServiceImpl implements BillOrderService { List wechatBillOrders = billOrderMapper.findByBillIdWithWechatInfo(bill_id); for (JSONObject order : wechatBillOrders) { if ("Alipay".equals(order.getString("channel"))) { - JSONObject alipayInfo = customerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); + JSONObject alipayInfo = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); if (alipayInfo != null) { order.put("nickname", alipayInfo.getString("nickname")); order.put("headimg", alipayInfo.getString("headimg")); diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 4e3b844c1..8237ba8bf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -257,6 +257,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider channelsObj.put(channel.getString("channel"), channel); } cleanLog.put("channels", channelsObj); + cleanLog.put("client_moniker", client.getString("client_moniker")); return cleanLog; } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerRelationAlipayMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java similarity index 92% rename from src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerRelationAlipayMapper.java rename to src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java index 5ab27c3d0..aedc27d49 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerRelationAlipayMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ManagerCustomerRelationAlipayMapper.java @@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Param; * Created by wangning on 2017/9/19. */ @AutoMapper(tablename = "sys_customer_relation_alipay", pkName = "relation_id") -public interface CustomerRelationAlipayMapper { +public interface ManagerCustomerRelationAlipayMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject customer); diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 18b0afe68..3862de24a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -12,10 +12,14 @@ 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.payment.*; +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; +import au.com.royalpay.payment.manage.mappers.payment.RefundMapper; +import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.CustomerMapper; -import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper; +import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean; @@ -28,11 +32,13 @@ import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils; import au.com.royalpay.payment.tools.utils.PageListUtils; import au.com.royalpay.payment.tools.utils.TimeZoneUtils; + 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 com.github.miemiedev.mybatis.paginator.domain.Paginator; + import net.sf.jasperreports.engine.JRDataSource; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; @@ -40,13 +46,24 @@ import net.sf.jasperreports.engine.JasperRunManager; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import net.sf.jasperreports.engine.export.JRXlsExporter; import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter; -import net.sf.jasperreports.export.*; +import net.sf.jasperreports.export.ExporterInput; +import net.sf.jasperreports.export.OutputStreamExporterOutput; +import net.sf.jasperreports.export.SimpleExporterInput; +import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; +import net.sf.jasperreports.export.SimpleXlsxReportConfiguration; + import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; -import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRichTextString; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.HSSFColor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,8 +71,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.ui.Model; -import javax.annotation.Resource; -import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -72,6 +87,9 @@ import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; + import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission; @@ -108,7 +126,7 @@ public class TradeLogServiceImpl implements TradeLogService { @Resource private CustomerMapper customerMapper; @Resource - private CustomerRelationAlipayMapper customerRelationAlipayMapper; + private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper; @Resource private ClientCustomersMapper clientCustomersMapper; @@ -298,7 +316,7 @@ public class TradeLogServiceImpl implements TradeLogService { order.put("nickname", customer.getString("nickname")); } - JSONObject customerAlipay = customerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); + JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); if (customerAlipay != null) { order.put("headimg", customerAlipay.getString("headimg")); order.put("nickname", customerAlipay.getString("nickname")); @@ -371,7 +389,7 @@ public class TradeLogServiceImpl implements TradeLogService { order.put("nickname", customer.getString("nickname")); } - JSONObject customerAlipay = customerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); + JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id")); if (customerAlipay != null) { order.put("headimg", customerAlipay.getString("headimg")); order.put("nickname", customerAlipay.getString("nickname")); @@ -448,6 +466,13 @@ public class TradeLogServiceImpl implements TradeLogService { clientManager.validateClients(client_id, params); params.put("client_id", client_id); List logs = transactionMapper.listTransFlow(params); + logs.stream().forEach(p->{ + String login_id = p.getString("login_id"); + if(StringUtils.isNotEmpty(login_id)) { + + p.put("order_detail", StringUtils.isEmpty(p.getString("order_detail"))?"":p.getString("order_detail") +"(alipay_id:"+login_id+")"); + } + }); TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Arrays.asList("transaction_time")); final JSONObject analysis = analysisTransLogs(logs); @@ -515,7 +540,7 @@ public class TradeLogServiceImpl implements TradeLogService { .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); analysis.put("total_surcharge", logs.parallelStream() .filter(log -> log.getBigDecimal("settle_amount") != null) - .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge"))) + .map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount")))) .reduce(BigDecimal::add).orElse(BigDecimal.ZERO)); analysis.put("wechat_fee", logs.parallelStream() .filter(log -> log.getBigDecimal("settle_amount") != null) diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml index 256b35234..d3411134c 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TaskManualSettleMapper.xml @@ -3,11 +3,11 @@ \ No newline at end of file diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 10b743cf8..b672d6c17 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -52,9 +52,14 @@ WHEN 1 THEN 'Cleared' WHEN 2 THEN 'Preauthorised' END) clear_status, - o.order_detail,o.display_amount,o.channel,o.currency,o.pre_authorization + o.order_detail,o.display_amount,o.channel,o.currency,o.pre_authorization, + CASE o.channel + WHEN 'Alipay' THEN ra.login_id + WHEN 'AlipayOnline' THEN ra.login_email + END login_id FROM pmt_transactions t LEFT JOIN pmt_orders o ON o.order_id=t.order_id + left join sys_customer_relation_alipay ra on ra.alipay_uid = o.customer_id AND t.client_id IN @@ -493,7 +498,7 @@ FROM pmt_transactions t INNER JOIN pmt_orders o ON o.order_id = t.order_id INNER JOIN sys_clients c ON c.client_id = o.client_id AND c.org_id = 1 - WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} AND + WHERE year(o.create_time) = #{year} AND month(o.create_time) = #{month} AND( t.transaction_type = 'Credit' OR t.refund_id IS NOT NULL diff --git a/src/main/resources/jasper/partner_invoice_gst.jasper b/src/main/resources/jasper/partner_invoice_gst.jasper index 95cd7257e..9c01d8c81 100644 Binary files a/src/main/resources/jasper/partner_invoice_gst.jasper and b/src/main/resources/jasper/partner_invoice_gst.jasper differ diff --git a/src/main/resources/jasper/partner_invoice_gst20180409.jasper b/src/main/resources/jasper/partner_invoice_gst20180409.jasper new file mode 100644 index 000000000..95cd7257e Binary files /dev/null and b/src/main/resources/jasper/partner_invoice_gst20180409.jasper differ diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 8ea63b82d..4474a573b 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -784,6 +784,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.partner) { return; } + if(!$state.is('partners.detail')){ + $scope.init.wechat_compliance = false; + return; + } if (!$scope.init.wechat_compliance) { $scope.init.wechat_compliance = true; return; @@ -802,6 +806,10 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter if (!$scope.partner) { return; } + if(!$state.is('partners.detail')){ + $scope.init.local_merchant = false; + return; + } if (!$scope.init.local_merchant) { $scope.init.local_merchant = true; return; diff --git a/src/main/ui/static/sys/templates/manual_settle.html b/src/main/ui/static/sys/templates/manual_settle.html index 5c81dad2c..dc67edcb0 100644 --- a/src/main/ui/static/sys/templates/manual_settle.html +++ b/src/main/ui/static/sys/templates/manual_settle.html @@ -26,7 +26,7 @@ - +