Merge branch 'develop'

master
taylor.dang 6 years ago
commit 4050e36b3f

@ -16,12 +16,15 @@ public interface ClearingDistributedSurchargeMapper {
List<JSONObject> findTransactions(@Param("client_id") int clientId); List<JSONObject> findTransactions(@Param("client_id") int clientId);
@AutoSql(type = SqlType.UPDATE)
void update(JSONObject transaction);
@AutoSql(type = SqlType.INSERT) @AutoSql(type = SqlType.INSERT)
void save(JSONObject transactions); void save(JSONObject transactions);
List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto); List<JSONObject> getMonthDetailByClientId(@Param("datefrom") Date datefrom, @Param("dateto") Date dateto);
List<JSONObject> findTransactionsByDate(JSONObject params); List<JSONObject> findSurchargeTransactionsByDetailId(@Param("client_id") int clientId, @Param("detailId") String detailId);
List<JSONObject> listUnClearedByMonth(@Param("dateto") DateTime dateTo); List<JSONObject> listUnClearedByMonth(@Param("dateto") DateTime dateTo);
} }

@ -3,33 +3,23 @@ package au.com.royalpay.payment.manage.merchants.core;
import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean;
import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO; import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse;
/** /**
* Created by yixian on 2016-06-25. * Created by yixian on 2016-06-25.
*/ */
@ -287,7 +277,7 @@ public interface ClientManager {
List<JSONObject> getAccountDetailByMonths(JSONObject account,String clientMoniker); List<JSONObject> getAccountDetailByMonths(JSONObject account,String clientMoniker);
List<JSONObject> getAccountTransactionsByDate(JSONObject account,String clientMoniker, String date); List<JSONObject> getAccountTransactionsByDetailId(JSONObject account,String clientMoniker, String detailId);
List<JSONObject> getAccountMonthDetails(JSONObject account,String clientMoniker); List<JSONObject> getAccountMonthDetails(JSONObject account,String clientMoniker);

@ -3495,24 +3495,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} }
@Override @Override
public List<JSONObject> getAccountTransactionsByDate(JSONObject account, String clientMoniker, String date) { public List<JSONObject> getAccountTransactionsByDetailId(JSONObject account, String clientMoniker, String detailId) {
JSONObject client = getClientInfoByMoniker(clientMoniker); JSONObject client = getClientInfoByMoniker(clientMoniker);
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
JSONObject params = new JSONObject(); return clearingDistributedSurchargeMapper.findSurchargeTransactionsByDetailId(client.getIntValue("client_id"),detailId);
params.put("client_id", client.getIntValue("client_id"));
params.put("year", date.substring(0, 4));
params.put("month", date.substring(date.length() - 2, date.length()));
List<JSONObject> transactions = clearingDistributedSurchargeMapper.findTransactionsByDate(params);
transactions.forEach(e -> {
if ("Credit".equals(e.getString("type"))) {
JSONObject manager = managerMapper.findDetail(e.getString("operation"));
e.put("operator_displayname", manager.getString("display_name"));
}
});
return transactions;
} }
@Override @Override
@ -3521,8 +3509,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
List<JSONObject> details = financialSurchargeAccountDetailMapper.findDetailsByClientId(client.getIntValue("client_id")); return financialSurchargeAccountDetailMapper.findDetailsByClientId(client.getIntValue("client_id"));
return details;
} }
@Override @Override
@ -3540,19 +3527,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new ServerErrorException("Processing task, wait for a moment"); throw new ServerErrorException("Processing task, wait for a moment");
} }
try { try {
JSONObject surcharge_account = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id")); JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id"));
transaction.put("client_id", client.getIntValue("client_id")); transaction.put("client_id", client.getIntValue("client_id"));
transaction.put("type", "Credit"); transaction.put("type", "Credit");
transaction.put("total_surcharge", BigDecimal.ZERO); transaction.put("total_surcharge", BigDecimal.ZERO);
transaction.put("tax_amount", BigDecimal.ZERO); transaction.put("tax_amount", BigDecimal.ZERO);
transaction.put("post_balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("operation", account.getString("manager_id")); transaction.put("operation", account.getString("manager_id"));
transaction.put("create_time", new Date()); transaction.put("create_time", new Date());
clearingDistributedSurchargeMapper.save(transaction); clearingDistributedSurchargeMapper.save(transaction);
surcharge_account.put("balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surcharge_account); clientsSurchargeAccountsMapper.update(surchargeAccount);
} finally { } finally {
locker.unlock(clientMoniker + "_surcharge_account_save"); locker.unlock(clientMoniker + "_surcharge_account_save");

@ -1,13 +1,7 @@
package au.com.royalpay.payment.manage.merchants.web; package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.manage.dev.core.MerchantLocationService; import au.com.royalpay.payment.manage.dev.core.MerchantLocationService;
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo; import au.com.royalpay.payment.manage.merchants.beans.*;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientRateConfig;
import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.beans.PartnerQuery;
import au.com.royalpay.payment.manage.merchants.beans.SubMerchantIdApply;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequireManager; import au.com.royalpay.payment.manage.permission.manager.RequireManager;
@ -19,21 +13,14 @@ import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/** /**
* Created by yixian on 2016-06-27. * Created by yixian on 2016-06-27.
@ -415,9 +402,10 @@ public class PartnerManageController {
public List<JSONObject> accountTransactions(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { public List<JSONObject> accountTransactions(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return clientManager.getAccountTransactions(manager, clientMoniker); return clientManager.getAccountTransactions(manager, clientMoniker);
} }
@ManagerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) { public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String detailId) {
return clientManager.getAccountTransactionsByDate(manager, clientMoniker, date); return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, detailId);
} }
@ManagerMapping(value = "/{clientMoniker}/account/save", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) @ManagerMapping(value = "/{clientMoniker}/account/save", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR})

@ -7,7 +7,6 @@ import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo;
import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean;
import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.permission.manager.RequirePartner; import au.com.royalpay.payment.manage.permission.manager.RequirePartner;
import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl; import au.com.royalpay.payment.manage.support.wechatclients.KangaLandWechatApiImpl;
@ -21,31 +20,21 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/** /**
* view for partner client * view for partner client
@ -197,7 +186,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody @ResponseBody
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) { public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
return clientManager.getAccountTransactionsByDate(manager, clientMoniker, date); return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, date);
} }
@PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER}) @PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ -254,7 +243,7 @@ public class PartnerViewController {
return "wechat_bind"; return "wechat_bind";
} }
@RequestMapping(value = "/account_receive_notice", method = RequestMethod.PUT) @PutMapping(value = "/account_receive_notice")
@ResponseBody @ResponseBody
public JSONObject toggleReceiveNotice(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user, @RequestBody JSONObject enable) { public JSONObject toggleReceiveNotice(@ModelAttribute(CommonConsts.WECHATINFO) JSONObject user, @RequestBody JSONObject enable) {
if (user == null) { if (user == null) {

@ -2,7 +2,6 @@ package au.com.royalpay.payment.manage.surchargeAccount.core;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import java.util.List; import java.util.List;
public interface SurchargeAccountService { public interface SurchargeAccountService {
@ -11,6 +10,6 @@ public interface SurchargeAccountService {
List<JSONObject> listSettledDatesInMonth(String mon); List<JSONObject> listSettledDatesInMonth(String mon);
void fillMothsSurcharge(JSONObject manager, String detail_id); void fillMothsSurcharge(JSONObject manager, String detailId);
} }

@ -11,8 +11,6 @@ import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import au.com.royalpay.payment.tools.lock.Locker; import au.com.royalpay.payment.tools.lock.Locker;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -21,7 +19,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DateFormat;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -39,12 +36,11 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
private Locker locker; private Locker locker;
@Resource @Resource
private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper; private ClientsSurchargeAccountsMapper clientsSurchargeAccountsMapper;
private Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class);
Logger logger = LoggerFactory.getLogger(ClientContractServiceImpl.class);
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void generatorMonthDetail() { public void generatorMonthDetail() {
DateTime dateTo = DateTime.now().withMillisOfDay(0).withDayOfMonth(1); DateTime dateTo = DateTime.now().withMillisOfDay(0).withDayOfMonth(1);
logger.info("===============Start generator surcharge account month detail==============={}", new Date()); logger.info("===============Start generator surcharge account month detail==============={}", new Date());
@ -67,6 +63,7 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO); .reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
detail.put("credit_amount", creditAmount); detail.put("credit_amount", creditAmount);
detail.put("debit_amount", debitAmount); detail.put("debit_amount", debitAmount);
detail.put("total_surcharge", creditAmount.add(debitAmount));
JSONObject lastTrans = surchargeTrans.stream().max(Comparator.comparing(trans -> trans.getDate("create_time"))) JSONObject lastTrans = surchargeTrans.stream().max(Comparator.comparing(trans -> trans.getDate("create_time")))
.orElse(null); .orElse(null);
BigDecimal postBalance; BigDecimal postBalance;
@ -80,8 +77,13 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
detail.put("send_mail", 0); detail.put("send_mail", 0);
detail.put("wx_send", 0); detail.put("wx_send", 0);
detail.put("create_time", new Date()); detail.put("create_time", new Date());
detail.put("is_valid", 0); detail.put("checkout", 0);
financialSurchargeAccountDetailMapper.save(detail); financialSurchargeAccountDetailMapper.save(detail);
//更新手续费明细中的账单id
surchargeTrans.forEach(trans -> {
trans.put("bill_id", detail.getString("detail_id"));
clearingDistributedSurchargeMapper.update(trans);
});
} }
logger.info("===============generator OVER==============={}", new Date()); logger.info("===============generator OVER==============={}", new Date());
} }
@ -92,35 +94,36 @@ public class SurchargeAccountServiceImpl implements SurchargeAccountService {
} }
@Override @Override
public void fillMothsSurcharge(JSONObject manager, String detail_id) { public void fillMothsSurcharge(JSONObject manager, String detailId) {
if (!(ManagerRole.ADMIN.hasRole(manager.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(manager.getIntValue("role")) || ManagerRole.FINANCIAL_STAFF.hasRole(manager.getIntValue("role")))) { if (!(ManagerRole.ADMIN.hasRole(manager.getIntValue("role")) || ManagerRole.OPERATOR.hasRole(manager.getIntValue("role")) || ManagerRole.FINANCIAL_STAFF.hasRole(manager.getIntValue("role")))) {
throw new ForbiddenException("无法执行平账操作,权限不足"); throw new ForbiddenException("无法执行平账操作,权限不足");
} }
JSONObject detail = financialSurchargeAccountDetailMapper.findByDetailId(detail_id); JSONObject detail = financialSurchargeAccountDetailMapper.findByDetailId(detailId);
if (detail.getBooleanValue("is_valid")) { if (detail.getBooleanValue("checkout")) {
throw new BadRequestException("该记录已结清"); throw new BadRequestException("该记录已结清");
} }
if (!locker.lock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill", 120_000)) { if (!locker.lock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill", 120_000)) {
throw new ServerErrorException("Processing task, wait for a moment"); throw new ServerErrorException("Processing task, wait for a moment");
} }
try { try {
JSONObject surcharge_account = clientsSurchargeAccountsMapper.find(detail.getIntValue("client_id")); JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(detail.getIntValue("client_id"));
JSONObject transaction = new JSONObject(); JSONObject transaction = new JSONObject();
transaction.put("client_id", detail.getIntValue("client_id")); transaction.put("client_id", detail.getIntValue("client_id"));
transaction.put("type", "Credit"); transaction.put("type", "Credit");
transaction.put("bill_id", detailId);
transaction.put("total_surcharge", BigDecimal.ZERO); transaction.put("total_surcharge", BigDecimal.ZERO);
transaction.put("tax_amount", BigDecimal.ZERO); transaction.put("tax_amount", BigDecimal.ZERO);
transaction.put("amount", detail.getBigDecimal("debit_amount").negate()); transaction.put("amount", detail.getBigDecimal("debit_amount").negate());
transaction.put("post_balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); transaction.put("post_balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
transaction.put("operation", manager.getString("manager_id")); transaction.put("operation", manager.getString("manager_id"));
transaction.put("create_time", new Date()); transaction.put("create_time", new Date());
transaction.put("remark", detail.getString("settle_month") + "冲正"); transaction.put("remark", detail.getString("settle_month") + "冲正");
clearingDistributedSurchargeMapper.save(transaction); clearingDistributedSurchargeMapper.save(transaction);
surcharge_account.put("balance", surcharge_account.getBigDecimal("balance").add(transaction.getBigDecimal("amount"))); surchargeAccount.put("balance", surchargeAccount.getBigDecimal("balance").add(transaction.getBigDecimal("amount")));
clientsSurchargeAccountsMapper.update(surcharge_account); clientsSurchargeAccountsMapper.update(surchargeAccount);
detail.put("is_valid", 1); detail.put("checkout", 1);
detail.put("operator_id", manager.getString("manager_id")); detail.put("operator_id", manager.getString("display_name"));
financialSurchargeAccountDetailMapper.update(detail); financialSurchargeAccountDetailMapper.update(detail);
} finally { } finally {
locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill"); locker.unlock(detail.getIntValue("client_id") + "_" + detail.getString("settle_month") + "_fill");

@ -3,16 +3,11 @@ package au.com.royalpay.payment.manage.surchargeAccount.web;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService; import au.com.royalpay.payment.manage.surchargeAccount.core.SurchargeAccountService;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
@RequestMapping("/sys/surcharge_account") @RequestMapping("/sys/surcharge_account")
@ -27,8 +22,8 @@ public class SurchargeAccountController {
return surchargeAccountService.listSettledDatesInMonth(month); return surchargeAccountService.listSettledDatesInMonth(month);
} }
@ManagerMapping(value = "/fill/{detail_id}", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.PUT) @ManagerMapping(value = "/fill/{detailId}", role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.FINANCIAL_STAFF}, method = RequestMethod.PUT)
public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detail_id) { public void fillMothsSurcharge(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String detailId) {
surchargeAccountService.fillMothsSurcharge(manager, detail_id); surchargeAccountService.fillMothsSurcharge(manager, detailId);
} }
} }

@ -1183,7 +1183,7 @@ public class TradeLogServiceImpl implements TradeLogService {
String preRefundDataStr = stringRedisTemplate.boundValueOps("payment:pre_refund_data").get(); String preRefundDataStr = stringRedisTemplate.boundValueOps("payment:pre_refund_data").get();
if (StringUtils.isEmpty(preRefundDataStr)) { if (StringUtils.isEmpty(preRefundDataStr)) {
JSONObject preRefundData = PageListUtils.buildPageListResult(transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit()))); JSONObject preRefundData = PageListUtils.buildPageListResult(transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())));
stringRedisTemplate.boundValueOps("payment:pre_refund_data").set(preRefundData.toJSONString(), 6, TimeUnit.HOURS); stringRedisTemplate.boundValueOps("payment:pre_refund_data").set(preRefundData.toJSONString(), 1, TimeUnit.HOURS);
return preRefundData; return preRefundData;
} else { } else {
return JSONObject.parseObject(preRefundDataStr); return JSONObject.parseObject(preRefundDataStr);

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.system.ClearingDistributedSurchargeMapper">
<select id="getMonthDetailByClientId" resultType="com.alibaba.fastjson.JSONObject"> <select id="getMonthDetailByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.client_id, SELECT d.client_id,
c.client_moniker, c.client_moniker,
c.company_name, c.company_name,
@ -13,37 +12,30 @@
FROM log_clearing_distributed_surcharge d FROM log_clearing_distributed_surcharge d
INNER JOIN sys_clients c ON c.client_id = d.client_id INNER JOIN sys_clients c ON c.client_id = d.client_id
WHERE d.create_time >= #{datefrom} WHERE d.create_time >= #{datefrom}
AND d.create_time < #{dateto} AND #{dateto} > d.create_time
AND c.is_valid = 1 AND c.is_valid = 1
GROUP BY d.client_id GROUP BY d.client_id
]]>
</select> </select>
<select id="findTransactions" resultType="com.alibaba.fastjson.JSONObject"> <select id="findTransactions" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT * SELECT *
FROM log_clearing_distributed_surcharge FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id} WHERE client_id = #{client_id}
ORDER BY create_time DESC ORDER BY create_time DESC
]]>
</select> </select>
<select id="findTransactionsByDate" resultType="com.alibaba.fastjson.JSONObject"> <select id="findSurchargeTransactionsByDetailId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ SELECT clearing_detail_id, settle_date,total_surcharge,tax_amount, type, amount,create_time,operation,remark
SELECT *
FROM log_clearing_distributed_surcharge FROM log_clearing_distributed_surcharge
WHERE client_id = #{client_id} WHERE client_id = #{client_id}
AND year(create_time) = #{year} AND bill_id = #{detailId}
AND month(create_time) = #{month} ORDER BY create_time
ORDER BY create_time DESC DESC
]]>
</select> </select>
<select id="listUnClearedByMonth" resultType="com.alibaba.fastjson.JSONObject"> <select id="listUnClearedByMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
select d.* select d.*
from log_clearing_distributed_surcharge d from log_clearing_distributed_surcharge d
where d.bill_id is null where d.bill_id is null
and d.create_time < #{dateto} and #{dateto} > d.create_time
]]>
</select> </select>
</mapper> </mapper>

@ -2,37 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper"> <mapper namespace="au.com.royalpay.payment.manage.mappers.system.FinancialSurchargeAccountDetailMapper">
<select id="findDetailsByMonth" resultType="com.alibaba.fastjson.JSONObject"> <select id="findDetailsByMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.settle_month = #{settle_month} WHERE d.settle_month = #{settle_month}
]]>
</select> </select>
<select id="findDetailsByClientId" resultType="com.alibaba.fastjson.JSONObject"> <select id="findDetailsByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name SELECT d.*,c.client_moniker,c.short_name,c.company_name
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
WHERE d.client_id = #{client_id} ORDER BY create_time desc WHERE d.client_id = #{client_id} ORDER BY create_time desc
]]>
</select> </select>
<select id="listSettlementDatesInMonth" resultType="com.alibaba.fastjson.JSONObject"> <select id="listSettlementDatesInMonth" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ SELECT fsad.detail_id,
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance fsad.settle_month,
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id fsad.total_surcharge,
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id fsad.credit_amount,
WHERE fsad.debit_amount,
d.settle_month= #{month} sc.client_moniker,
ORDER BY s.balance ASC sc.short_name,
]]> sc.company_name
FROM financial_surcharge_account_detail fsad,
sys_clients sc
WHERE fsad.client_id = sc.client_id
AND fsad.settle_month = #{month}
</select> </select>
<select id="listSettlementDatesByClientId" resultType="com.alibaba.fastjson.JSONObject"> <select id="listSettlementDatesByClientId" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance SELECT d.*,c.client_moniker,c.short_name,c.company_name,s.balance
FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id FROM financial_surcharge_account_detail d INNER JOIN sys_clients c ON c.client_id=d.client_id
LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id LEFT JOIN sys_clients_surcharge_accounts s ON s.client_id = d.client_id
WHERE WHERE
s.client_id = #{client_id} s.client_id = #{client_id}
ORDER BY s.create_time DESC ORDER BY s.create_time DESC
]]>
</select> </select>
</mapper> </mapper>

@ -605,7 +605,7 @@ margin-bottom: 10%;"/>
</li> </li>
<li ui-sref-active="active" ng-if="('preRefund'|withModule)"> <li ui-sref-active="active" ng-if="('preRefund'|withModule)">
<a ui-sref="analysis_monitoring.pre_refund" ui-sref-opts="{reload:true}"> <a ui-sref="analysis_monitoring.pre_refund" ui-sref-opts="{reload:true}">
<i class="fa fa-tv"></i> <span>授信退款|Credit refund/span> <i class="fa fa-tv"></i> <span>授信退款|Credit refund</span>
</a> </a>
</li> </li>
<li ui-sref-active="active"> <li ui-sref-active="active">

@ -2307,7 +2307,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
}); });
}; };
$scope.getBankInfo = function (bsb_no) { $scope.getBankInfo = function (bsb_no) {
if (bsb_no != null && bsb_no != "") { if (bsb_no != null && bsb_no !== "") {
$http.get('/sys/partners/' + $scope.partner.client_moniker + '/bank_account/bank_info/' + bsb_no).then(function (resp) { $http.get('/sys/partners/' + $scope.partner.client_moniker + '/bank_account/bank_info/' + bsb_no).then(function (resp) {
$scope.bankInfo = resp.data; $scope.bankInfo = resp.data;
$scope.bankaccount.bank = $scope.bankInfo.bank; $scope.bankaccount.bank = $scope.bankInfo.bank;

@ -3,7 +3,6 @@
*/ */
define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angular) { define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angular) {
'use strict'; 'use strict';
var colors = ['#00c0ef', '#00a65a', '#ff851b', '#f39c12', '#d81b60', '#605ca8', '#dd4b39', '#008080', '#8B008B', '#D2691E', '#708090'];
var app = angular.module('surchargeAccountApp', ['ui.bootstrap', 'ui.router', 'ngEcharts']); var app = angular.module('surchargeAccountApp', ['ui.bootstrap', 'ui.router', 'ngEcharts']);
app.config(['$stateProvider', function ($stateProvider) { app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('surcharge_account', { $stateProvider.state('surcharge_account', {
@ -25,22 +24,13 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.partner = angular.copy(partner.data); $scope.partner = angular.copy(partner.data);
$scope.getBalance = function () { $scope.getBalance = function () {
$scope.surcharge = {}; $scope.surcharge = {};
if ($scope.partner.surcharge_mode != undefined && $scope.partner.surcharge_mode == "distributed") { if ($scope.partner.surcharge_mode !== undefined && $scope.partner.surcharge_mode === "distributed") {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) { $http.get('/client/partner_info/' + $scope.partner.client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data; $scope.surcharge = resp.data;
}) })
} }
}; };
$scope.getTransactions = function () {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/transactions').then(function (resp) {
$scope.transactions = resp.data;
})
}
$scope.getBalance(); $scope.getBalance();
$scope.getTransactions();
$scope.getDetailByMonths = function () { $scope.getDetailByMonths = function () {
$http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/months').then(function (resp) { $http.get('/client/partner_info/' + $scope.partner.client_moniker + '/account/months').then(function (resp) {
$scope.report = resp.data; $scope.report = resp.data;
@ -93,20 +83,17 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}; };
}) })
}; };
$scope.surchargeAccountDetail = function (client_moniker,mon) { $scope.surchargeAccountDetail = function (detail) {
$uibModal.open({ $uibModal.open({
templateUrl: '/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html', templateUrl: '/static/payment/surchargeaccount/templates/partner_surcharge_account_month_dialog.html',
controller: 'accountDetailCtrl', controller: 'accountDetailCtrl',
size: 'lg', size: 'lg',
resolve: { resolve: {
client_moniker: function () { detail: function(){
return client_moniker; return detail;
},
month: function () {
return mon;
}, },
transactions: ['$http', function ($http) { surchargeDetailData: ['$http', function ($http) {
return $http.get('/sys/partners/' + client_moniker + '/account/transactions/date?date='+mon); return $http.get('/sys/partners/' + detail.client_moniker + '/account/transactions/date?detailId=' + detail.detail_id);
}] }]
} }
}).result.then(function () { }).result.then(function () {
@ -115,9 +102,8 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
$scope.loadReport($scope.report.month); $scope.loadReport($scope.report.month);
}); });
}; };
$scope.fillMonthsSurcharge = function (details) { $scope.fillMonthsSurcharge = function (detail) {
var contentHtml = $sce.trustAsHtml('即将为[' + details.short_name + ']冲正,<span style="color: red">请确认商户信息</span>'); var contentHtml = $sce.trustAsHtml('请确认商户[' + detail.short_name + ']已线下付款,再执行此操作</span>');
commonDialog.confirm({ commonDialog.confirm({
title: '后付费账户冲正', title: '后付费账户冲正',
content: '', content: '',
@ -125,7 +111,7 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
{label: 'Cancel', className: 'btn-danger', key: '2', dismiss: true}], {label: 'Cancel', className: 'btn-danger', key: '2', dismiss: true}],
contentHtml: contentHtml contentHtml: contentHtml
}).then(function () { }).then(function () {
$http.put('/sys/surcharge_account/fill/' + details.detail_id).then(function () { $http.put('/sys/surcharge_account/fill/' + detail.detail_id).then(function () {
commonDialog.alert({title: 'Success', content: '冲正成功', type: 'success'}); commonDialog.alert({title: 'Success', content: '冲正成功', type: 'success'});
$scope.loadReport($scope.report.month); $scope.loadReport($scope.report.month);
}, function (resp) { }, function (resp) {
@ -136,26 +122,10 @@ define(['angular', 'decimal', 'uiBootstrap', 'uiRouter', 'angularEcharts'], func
}; };
}]); }]);
app.controller('accountDetailCtrl', ['$scope','$http','transactions','client_moniker','commonDialog','month', function ($scope, $http, transactions,client_moniker,commonDialog,month) { app.controller('accountDetailCtrl', ['$scope', '$http', 'detail', 'surchargeDetailData', function ($scope, $http, detail, surchargeDetailData) {
$scope.transactions = angular.copy(transactions.data); $scope.surchargeDetailData = angular.copy(surchargeDetailData.data);
$scope.params = {}; $scope.month = angular.copy(detail.settle_month);
$scope.month = angular.copy(month);
$scope.getBalance = function () {
$http.get('/sys/partners/' + client_moniker + '/surcharge_account').then(function (resp) {
$scope.surcharge = resp.data;
})
};
$scope.getBalance();
$scope.getTransactions = function () {
$http.get('/sys/partners/' + client_moniker + '/account/transactions/date?date=' + $scope.month).then(function (resp) {
$scope.transactions = resp.data;
});
}
}]); }]);
return app; return app;
}); });

@ -20,7 +20,7 @@
</div> </div>
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
<div class="col-xs-3" ng-repeat="mon in months"> <div class="col-xs-1" ng-repeat="mon in months">
<a class="text-success" role="button" ng-click="loadReport(mon)" ng-if="hasReport(mon)"> <a class="text-success" role="button" ng-click="loadReport(mon)" ng-if="hasReport(mon)">
<h2 ng-bind="mon.substring(5,7)"></h2> <h2 ng-bind="mon.substring(5,7)"></h2>
</a> </a>
@ -37,41 +37,32 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th>商户编号</th> <th>商户编码</th>
<th>Short Name</th> <th>商户简称</th>
<th>Total Surcharge</th> <th>总手续费</th>
<!--<th>充值总额</th>-->
<!--<th>支出总额</th>-->
<th>是否结清</th> <th>是否结清</th>
<!--<th>余额</th>-->
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="details in report.details"> <tr ng-repeat="detail in report.details">
<td style="vertical-align:middle"> <td style="vertical-align:middle">
<a class="text-primary" role="button" title="Detail" <a class="text-primary" role="button" title="Detail"
ui-sref="partners.detail({clientMoniker:details.client_moniker})"> ui-sref="partners.detail({clientMoniker:detail.client_moniker})">
<span ng-bind="details.client_moniker"></span></a> <span ng-bind="detail.client_moniker"></span></a>
</td> </td>
<td ng-bind="details.short_name" style="vertical-align:middle"></td> <td ng-bind="detail.short_name" style="vertical-align:middle"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td> <td ng-bind="detail.total_surcharge | currency:'AUD'"></td>
<!--<td ng-bind="details.credit_amount|currency:'$'" style="color: green;vertical-align:middle" ></td>-->
<!--<td ng-bind="details.debit_amount|currency:'$'" style="color: red;vertical-align:middle"></td>-->
<td style="vertical-align:middle"> <td style="vertical-align:middle">
<span ng-if="details.is_valid">已结清</span> <span ng-if="detail.checkout">已结清</span>
<span ng-if="!details.is_valid">未付款</span> <span ng-if="!detail.checkout">未付款</span>
</td> </td>
<!--<td>-->
<!--<span ng-if="details.balance>=0" style="color: green">{{details.balance|currency:'$'}}</span>-->
<!--<span ng-if="details.balance<0" style="color: red">{{details.balance|currency:'$'}}</span>-->
<!--</td>-->
<td style="vertical-align:middle"> <td style="vertical-align:middle">
<!-- 等待邮件和微信推送模板 --> <button class="btn btn-warning" ng-if="!detail.checkout" type="button"
<!--<a style="cursor: pointer" > 催款</a>--> ng-click="fillMonthsSurcharge(detail)">冲正
<!--<a style="cursor: pointer" ng-click="showDetail()">充值</a>--> </button>
<button class="btn btn-warning" ng-if="!details.is_valid" type="button" ng-click="fillMonthsSurcharge(details)">冲正</button> <i class="fa fa-bars" style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px"
<i class="fa fa-bars" style="font-size: 15px;color: #3c8dbc;cursor: pointer;padding-left: 15px" ng-click="surchargeAccountDetail(details.client_moniker,details.settle_month)"></i> ng-click="surchargeAccountDetail(detail)"></i>
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -1,110 +1,8 @@
<section class="content-header"> <section class="content-header">
<h1> <h1>
Client Surcharge Account Monthly Surcharge
</h1> <span style="float: right">Merchant Surcharge (<span
<ol class="breadcrumb"> style="color: red">{{surcharge.balance|currency:'AUD'}}</span>)</span>
<li class="active"><i class="fa fa-dashboard"></i> Surcharge Account</li>
</ol>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="box-solid">
<div class="box box-warning">
<div class="box-header">
<div class="form-horizontal col-sm-8" style="margin-top: 30px">
<div class="form-group">
<label class="control-label col-xs-4 col-sm-3">手续费账户余额</label>
<div class="col-sm-6" style="font-size: 25px">
<p>{{surcharge.balance|currency:'AUD'}}</p>
</div>
</div>
<!--<div class="form-group" ng-if="partner.surcharge_mode=='distributed'">-->
<!--<label class="control-label col-xs-4 col-sm-3">允许手续费账户欠款</label>-->
<!--<div class="col-sm-6">-->
<!--<input type="checkbox" ng-model="partner.allow_surcharge_credit" bs-switch-->
<!--switch-change="allowSurchargeCredit(partner.allow_surcharge_credit)" switch-readonly="true">-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-4 col-sm-3" style="padding-top:0px">Surcharge Mode:</label>-->
<!--<div class="col-xs-8 col-sm-6">-->
<!--<span class="control-label" ng-bind="partner.surcharge_mode"></span>-->
<!--<p class="text-info">-->
<!--<i class="fa fa-info"></i>启用到收支分离(distributed)模式,将使消费者支付手续费模式失效-->
<!--</p>-->
<!--</div>-->
<!--</div>-->
</div>
</div>
</div>
<div class="box">
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Create Time</th>
<th>Amount</th>
<th>Remark</th>
<th>Operator</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Credit',create_time:ctrl.day}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
<td ng-bind="tr.operator_displayname"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Num</th>
<th>Settle Date</th>
<th>Amount</th>
<th>Total Surcharge</th>
<th>Tax Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit',create_time:ctrl.day}:true">
<td>{{$index+1}}</td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.remark"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<section class="content-header">
<h1>
每月手续费
</h1> </h1>
</section> </section>
<div class="content"> <div class="content">
@ -115,22 +13,20 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>清算月份</th> <th>Settle Month</th>
<th>Total Surcharge</th> <th>Total Surcharge</th>
<th>支出总额</th> <th>Whether Settle</th>
<th>是否结清</th> <th>Detail</th>
<th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="details in report"> <tr ng-repeat="details in report">
<td ng-bind="details.settle_month"></td> <td ng-bind="details.settle_month"></td>
<td ng-bind="details.total_surcharge | currency:'$'"></td> <td ng-bind="details.total_surcharge|currency:'$'"
<td ng-bind="details.debit_amount|currency:'$'"
style="color: red;vertical-align:middle"></td> style="color: red;vertical-align:middle"></td>
<td style="vertical-align:middle"> <td style="vertical-align:middle">
<span ng-if="details.is_valid">已结清</span> <span ng-if="details.is_valid">Yes</span>
<span ng-if="!details.is_valid">未付款</span> <span ng-if="!details.is_valid">No</span>
</td> </td>
<td style="vertical-align:middle"> <td style="vertical-align:middle">
<i class="fa fa-bars" <i class="fa fa-bars"

@ -1,5 +1,5 @@
<div class="modal-header"> <div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4> <h4>Surcharge Accountdddd Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="box box-default"> <div class="box box-default">
@ -9,7 +9,6 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Num</th>
<th>Settle Date</th> <th>Settle Date</th>
<th>Amount</th> <th>Amount</th>
<th>Total Surcharge</th> <th>Total Surcharge</th>
@ -18,15 +17,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true"> <tr ng-repeat="detail in surchargeDetailData">
<td>{{$index+1}}</td> <td ng-bind="detail.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td> <td ng-bind="detail.amount|currency:'AUD'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td> <td ng-bind="detail.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td> <td ng-bind="detail.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td> <td>
{{tr.remark}} {{detail.remark}}
<a ng-href="/client/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download"> <a ng-href="/client/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
</a> </a>
</td> </td>

@ -1,34 +1,7 @@
<div class="modal-header"> <div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4> <h4>Surcharge Account Detail</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="box box-warning">
<div class="box-body" style="font-size: 35px;text-align: right">
{{surcharge.balance|currency:'AUD'}}<i class="fa fa-plus-square-o" style="font-size: 15px;padding-left: 15px;cursor: pointer" ng-click="addDetail()"></i>
</div>
</div>
<div class="box box-warning" ng-if="canAddDetail">
<div class="box-body">
<div class="row" style="margin-left: 20px;">
<div class="form-group">
<label>
Amount:
</label>
<input type="number" ng-model="params.amount">
<label>
remark:
</label>
<input type="text" ng-model="params.remark">
<div class="btn-group">
<a class="btn btn-success" role="button" ng-click="save()">Submit</a>
</div>
<div class="btn-group">
<a class="btn btn-danger" ng-click="cancel()" >Cancel</a>
</div>
</div>
</div>
</div>
</div>
<div class="box box-default"> <div class="box box-default">
<div class="box-header">Credits</div> <div class="box-header">Credits</div>
<div class="box-body"> <div class="box-body">
@ -36,7 +9,6 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Num</th>
<th>Create Time</th> <th>Create Time</th>
<th>Amount</th> <th>Amount</th>
<th>Remark</th> <th>Remark</th>
@ -44,12 +16,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Credit'}:true"> <tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Credit'}:true">
<td>{{$index+1}}</td> <td ng-bind="surcharge.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="tr.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td> <td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td> <td ng-bind="surcharge.remark"></td>
<td ng-bind="tr.remark"></td> <td ng-bind="surcharge.operator"></td>
<td ng-bind="tr.operator_displayname"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -63,7 +34,6 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Num</th>
<th>Settle Date</th> <th>Settle Date</th>
<th>Amount</th> <th>Amount</th>
<th>Total Surcharge</th> <th>Total Surcharge</th>
@ -72,15 +42,15 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true"> <tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Debit'}:true">
<td>{{$index+1}}</td> <td ng-bind="surcharge.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td> <td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td> <td ng-bind="surcharge.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td> <td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td>
<td> <td>
{{tr.remark}} {{surcharge.remark}}
<a ng-href="/sys/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download"> <a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
target="_blank" title="Download">
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
</a> </a>
</td> </td>

@ -1,12 +1,7 @@
<div class="modal-header"> <div class="modal-header">
<h4>Surcharge Account Detail{{partner.client_moniker?'('+partner.client_moniker+')':''}}</h4> <h4>Surcharge Account Detail</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="box box-warning">
<div class="box-body" style="font-size: 35px;text-align: right">
{{surcharge.balance|currency:'AUD'}}
</div>
</div>
<div class="box box-default"> <div class="box box-default">
<div class="box-header">Credits</div> <div class="box-header">Credits</div>
<div class="box-body"> <div class="box-body">
@ -14,7 +9,6 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Num</th>
<th>Create Time</th> <th>Create Time</th>
<th>Amount</th> <th>Amount</th>
<th>Remark</th> <th>Remark</th>
@ -22,12 +16,12 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Credit'}:true"> <tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Credit'}:true">
<td>{{$index+1}}</td> <td ng-bind="surcharge.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td>
<td ng-bind="tr.create_time|date:'yyyy-MM-dd HH:mm:ss'"></td> <td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td> <td ng-bind="surcharge.remark"></td>
<td ng-bind="tr.remark"></td> <td ng-bind="surcharge.operation"></td>
<td ng-bind="tr.operator_displayname"></td> </tr>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -41,24 +35,24 @@
<table class="table table-bordered table-striped table-hover"> <table class="table table-bordered table-striped table-hover">
<thead> <thead>
<tr> <tr>
<th>Num</th>
<th>Settle Date</th> <th>Settle Date</th>
<th>Amount</th> <th>Amount</th>
<th>Total Surcharge</th> <th>Total Surcharge</th>
<th>Tax Amount</th> <th>Tax Amount</th>
<th>Remark</th> <th>Remark</th>
<th>Details</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="tr in transactions|propsFilter:{type:'Debit'}:true"> <tr ng-repeat="surcharge in surchargeDetailData|propsFilter:{type:'Debit'}:true">
<td>{{$index+1}}</td> <td ng-bind="surcharge.settle_date|date:'yyyy-MM-dd'"></td>
<td ng-bind="tr.settle_date|date:'yyyy-MM-dd'"></td> <td ng-bind="surcharge.amount|currency:'AUD'"></td>
<td ng-bind="tr.amount|currency:'AUD'"></td> <td ng-bind="surcharge.total_surcharge|currency:'AUD'"></td>
<td ng-bind="tr.total_surcharge|currency:'AUD'"></td> <td ng-bind="surcharge.tax_amount|currency:'AUD'"></td>
<td ng-bind="tr.tax_amount|currency:'AUD'"></td> <td ng-bind="surcharge.remark"></td>
<td> <td>
{{tr.remark}} <a ng-href="/sys/clean_logs/{{surcharge.client_id}}/settlement_logs/{{surcharge.clearing_detail_id}}/export"
<a ng-href="/sys/clean_logs/{{tr.client_id}}/settlement_logs/{{tr.clearing_detail_id}}/export" target="_blank" title="Download"> target="_blank" title="Download">
<i class="fa fa-download"></i> <i class="fa fa-download"></i>
</a> </a>
</td> </td>

Loading…
Cancel
Save